Skip to content

ci: modernize Actions, add cargo-deny gate, clear baseline lints - #433

Closed
MattJackson wants to merge 5 commits into
tiberius-rs:sync/s1from
MattJackson:sync/s2
Closed

ci: modernize Actions, add cargo-deny gate, clear baseline lints#433
MattJackson wants to merge 5 commits into
tiberius-rs:sync/s1from
MattJackson:sync/s2

Conversation

@MattJackson

Copy link
Copy Markdown
Contributor

CI modernization and supply-chain hardening, plus a batch of baseline correctness/lint fixes.

  • Modernize the GitHub Actions workflow; port stranded async-std tests to #[test_on_runtimes] (@jakewimmer).
  • Add a cargo-deny supply-chain gate; modernize dev-dependencies.
  • Resolve 12 panics/correctness bugs from the issue backlog.
  • Clear all clippy warnings and rustfmt the tree (also fixes the pre-existing runtimes-macro manual_unwrap_or_default lint under rust ≥1.98).

Supersedes #389 — cache-action update; our workflow already uses a newer action.

Part of a sequential series — please merge in order after #432 (security). This PR is based on main, so until #432 merges its diff also shows #432's 2 commits; once #432 lands, this reduces to its own 5 commits.
Reviewer note: please rebase-merge or merge-commit, not squash to preserve @jakewimmer's authorship.

jakewimmer and others added 5 commits September 1, 2026 12:51
Migrate the macOS runner to macos-26-intel and add docker/setup-docker-action
so Docker is available for SQL Server. Replace all manual cargo cache steps
with Swatinem/rust-cache and add a sanitization step that replaces commas
with + to keep matrix variants isolated.

(cherry picked from commit 66030d2)
Two tests written before #[test_on_runtimes] existed and never updated.

cyrillic_collations_should_work previously created a dedicated database with
a Cyrillic default collation, requiring an admin connection and DROP DATABASE
at teardown. The DROP raced against open connections on macOS/rustls CI,
causing flaky failures. Replace with a session-local temp table using
column-level COLLATE clauses. The code path under test (COLMETADATA collation
-> encoding_rs decode) is identical.

application_name_should_be_set_correctly needed the application name set
before connecting. Add APP_NAME_CONN_STR embedding it in the connection
string so the macro-generated harness connects with it set.

(cherry picked from commit 6247684)
- Add deny.toml: fails on any vulnerability/yanked crate in the built
  graph; documents justified ignores for advisories that are provably
  dev-dependency-only or reachable solely via the opt-in
  sql-browser-async-std feature (not part of the default shipped lib).
- Replace the broken prisma-org PR Code Security workflow (which fails at
  startup on the fork) with a self-contained Security audit workflow that
  runs cargo-deny on push/PR and weekly.
- Bump dev-deps env_logger 0.9->0.11 and indicatif 0.17->0.18, dropping the
  unmaintained atty/number_prefix transitives from the test graph.

cargo deny check advisories bans sources: advisories ok, bans ok, sources ok.

(cherry picked from commit 1ce85b7)
Direct fixes for long-standing reported issues (regression tests added,
128 lib tests pass):

- tiberius-rs#211: bounds-check usize column index (try_get returns Err, not panic)
- tiberius-rs#382: match raw-identifier column names (r#type -> SQL 'type')
- tiberius-rs#418: correct swapped old/new in EnvChange Display (Database, PacketSize)
- tiberius-rs#281: lower chatty per-connection/token logs from INFO to DEBUG
- tiberius-rs#263: convert SQL smallint (I16/Intn) into i32 via FromSql
- tiberius-rs#424/tiberius-rs#425: return Error instead of panicking on unexpected server input
  in the TDS decoder (incl. negotiated_encryption)
- tiberius-rs#305: error at connect time when encryption is required but no TLS
  feature is compiled in
- tiberius-rs#316: fix multiply-overflow panic decoding dates before 1900
- tiberius-rs#358/tiberius-rs#352: coerce numerics into Money/SmallMoney and strings into
  NText/Text columns during bulk insert
- tiberius-rs#348: send the ReadOnly intent flag in LOGIN7 when ApplicationIntent=ReadOnly

(cherry picked from commit 34e5e55)
- Resolve 20 pre-existing clippy lints under `cargo clippy --features=all
  -- -D warnings` (legacy numeric methods/constants, unused/elidable
  lifetimes, redundant closure, doc list indentation, format specifier,
  derivable Default via #[default]); narrow justified #[allow] for the
  uint_enum! cast and the tds::time module inception.
- rustfmt the files touched by the backlog fixes.

dev green gate: fmt --check clean, build ok, clippy -D warnings ok,
cargo-deny ok, 128 lib tests pass.

(cherry picked from commit edda463)
@aqrln

aqrln commented Sep 1, 2026

Copy link
Copy Markdown

Part of a sequential series — please merge in order after #432 (security). This PR is based on main, so until #432 merges its diff also shows #432 2 commits; once #432 lands, this reduces to its own 5 commits.

Would you mind using the native stacked PRs in GitHub via gh stack? This is not blocking but it will make reviewing easier and faster.

@MattJackson

Copy link
Copy Markdown
Contributor Author

Superseded by #440. Re-opened as a native GitHub stacked PR (stack #445) per @aqrln's request in #440 — the fork origin of these PRs made a native stack impossible (GitHub can't add fork-head PRs to a stack), so the branches now live in tiberius-rs/tiberius directly. Same commits, same authorship. Please review #440 instead.

@MattJackson MattJackson closed this Sep 2, 2026
@MattJackson
MattJackson deleted the sync/s2 branch September 2, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants