Skip to content

ci: harden lint, add release build and audit jobs#85

Merged
shadowhand merged 2 commits into
refactor-extract-domain-modulefrom
refactor-ci-hardening
Apr 28, 2026
Merged

ci: harden lint, add release build and audit jobs#85
shadowhand merged 2 commits into
refactor-extract-domain-modulefrom
refactor-ci-hardening

Conversation

@shadowhand

Copy link
Copy Markdown
Contributor

Summary

Stacked on #84. Final PR in the architecture refactor stack.

CI changes

  • Clippy is now strict: cargo clippy --all-targets --all-features -- -D warnings. Any new warning fails CI.
  • New release-build job catches release-only compile/link issues (LTO, codegen-units, etc.) before they hit a tag.
  • New audit job runs cargo-audit against the lockfile to surface known-vulnerable transitive dependencies.

Pre-existing warnings fixed

Strict lint surfaced 10 warnings that had been accumulating because the previous CI step was cargo clippy with no flags:

File Fix
commands/api.rs useless format!() in a test fixture → .to_string()
commands/clinicians/prepare.rs setup_prepare_mocks_by_uuid has 10 args by design — #[allow] it locally
commands/config/default.rs (×3) map_or(true, …)is_none_or(…)
commands/skills.rs (×2) needless &path() borrows in tests
config.rs, version_check.rs (×3) field-reassign-with-default → struct-update syntax

CONTRIBUTING.md updated with the strict clippy invocation and the release build command so local checks match CI.

Stack — final

This closes the 9-PR series: #77#78#79#80#81#82#83#84 → this.

Cumulative results:

Metric Before After
Largest single file 2985 (clinicians.rs) 779 (config/profile.rs, mostly tests)
main.rs 464 302
HTTP boilerplate per command ~10 lines 1 line (api.get(path).await?)
Per-resource *ListResponse 5 hand-rolled 0 (replaced by jsonapi::List<A>)
Tests 248 291 (270 lib + 7 bin + 11 integration + 3 from new domain tests)
Library/binary split binary only lib.rs + thin binary
Clippy posture warnings ignored -D warnings strict
CI jobs 1 3 (lint/test, release-build, audit)

Test plan

  • cargo fmt --check clean
  • cargo clippy --all-targets --all-features -- -D warnings — clean
  • cargo build --release — succeeds in 1m35s
  • cargo test — 291 pass total

https://claude.ai/code/session_012fVDyKBysF1ERtvVuEAw2Y


Generated by Claude Code

- Clippy now runs with --all-targets --all-features and -D warnings,
  so any new warning fails CI.
- New release-build job catches release-only compile/link issues
  (LTO, codegen-units, etc.) before they hit a tag.
- New audit job runs cargo-audit against the lockfile to surface
  known-vulnerable transitive dependencies.

Fixes the 10 pre-existing clippy warnings that accumulated across
the codebase so the strict lint passes:

- src/commands/api.rs: useless format!() in a test fixture
- src/commands/clinicians/prepare.rs: setup_prepare_mocks_by_uuid
  has 10 args by design (mock-construction helper); allowed locally
- src/commands/config/default.rs: map_or(true, ...) → is_none_or(...)
  (3 occurrences in tests)
- src/commands/skills.rs: needless &Path::path() borrows in tests
- src/config.rs, src/version_check.rs: field-reassign-with-default
  in three test fixtures, replaced with struct-update syntax

CONTRIBUTING.md: documented the strict clippy invocation and the
release build command so local checks match CI.

288 → 291 tests still pass (no test changes; the +3 came in PR8 from
Stage::workos_config tests).

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

The new cargo-audit job in CI surfaced three vulnerabilities in
transitive dependencies. All three resolve to semver-compatible
patch versions reachable via `cargo update`:

- rustls-webpki 0.103.10 → 0.103.13
  - RUSTSEC-2026-0098: name constraints for URI names
  - RUSTSEC-2026-0099: name constraints accepted for wildcard certs
  - RUSTSEC-2026-0104: reachable panic in CRL parsing
- rand 0.9.2 → 0.9.4
  - RUSTSEC-2026-0097: unsoundness with custom logger via rand::rng()
- fastrand 2.4.0 → 2.4.1 (yanked → published)

No source changes; only Cargo.lock. All 291 tests still pass.
@shadowhand shadowhand merged commit 9f4086b into refactor-extract-domain-module Apr 28, 2026
4 checks passed
@shadowhand shadowhand deleted the refactor-ci-hardening branch April 28, 2026 02:21
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.

2 participants