ci: gate construct-cli with cargo fmt, clippy, test, and an MSRV check - #27
Merged
Conversation
construct-cli/ is the only real build surface in this repo — everything else is markdown — and it was entirely ungated. The lint job never invokes cargo, which is how a clippy break (items_after_test_module in src/sources/skillmd.rs) sat unnoticed on main until #26 tripped over it. Two new jobs: - `cargo` — fmt --check, clippy --all-targets -D warnings, test. Runs on stable, since pinning the gate to the MSRV would freeze clippy lints and rustfmt output at whatever 1.82 emitted. - `msrv` — cargo check against the `rust-version` declared in Cargo.toml (1.82), kept separate so an MSRV bump is a visible, deliberate change rather than something that rides along with a dependency update. `check` rather than `test`, because dev-dependencies are not bound by the MSRV the crate advertises to consumers. Both use Swatinem/rust-cache. Deliberately not path-filtered: a filtered job reports nothing when skipped, which makes it unusable as a required status check, and the cache makes a markdown-only PR cheap enough that always running is the better trade. cargo audit is deliberately excluded. A newly published advisory would redden main for a reason unrelated to the change under review; it stays a local step before adding a dependency (Standard §3.3). If it belongs in CI later, a scheduled job is the right shape, not a PR gate. construct-cli/AGENTS.md and CLAUDE.md document what is gated and what is not. They remain identical apart from their self-reference line, as that file pair requires. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The new msrv job did its job on its first run: `cargo check` under 1.82 failed before compiling a single line of our code. The locked dependency tree pins indexmap 2.14.0, whose manifest requires the `edition2024` Cargo feature — stabilized in 1.85 — so 1.82 could not even parse the tree. `rust-version = "1.82"` was therefore a fiction, and had been for as long as that dependency had been locked. Nothing caught it because nothing ever built the crate on the version it claimed to support. Corrected to 1.85 and the job pinned to match, with the reasoning recorded in Cargo.toml so the next person raising it knows to re-measure rather than guess. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
At 1.85 the resolver got far enough to report the real constraint instead of failing to parse: darling 0.23.0 and instability 0.3.12 — both transitive, via ratatui — require 1.88.0. So the floor is set by the locked dependency tree, not by this crate's own source, and 1.85 was only the first of two hurdles (indexmap's `edition2024` requirement). Recorded both in Cargo.toml so the next reader knows the number tracks dependencies and must be re-measured, not reasoned about. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
construct-cli/is the only real build surface in this repo — everything else is markdown — and it was entirely ungated. The existinglintjob runsreuse lint, config validation, and the description cap; it never invokes cargo.That is how a clippy break (
items_after_test_moduleinsrc/sources/skillmd.rs) sat unnoticed onmainuntil #26 tripped over it and had to fix it as a drive-by.Jobs added
cargofmt --check,clippy --all-targets -- -D warnings,testmsrvcargo check --all-featuresrust-version)Both use
Swatinem/rust-cache.Decisions worth reviewing
Stable for the gate, MSRV separately. Pinning the main gate to 1.82 would freeze clippy lints and rustfmt output at whatever that release emitted. Keeping MSRV as its own job also means an MSRV bump is a visible, deliberate change rather than something that rides along with a dependency update. It runs
check, nottest— dev-dependencies are not bound by the MSRV the crate advertises to consumers.Not path-filtered. A path-filtered job reports nothing at all when skipped, which makes it unusable as a required status check. With the cache, a markdown-only PR is cheap enough that always running is the better trade.
cargo auditdeliberately excluded. A newly published advisory would reddenmainfor a reason unrelated to the change under review. It stays a local step before adding a dependency (Standard §3.3). If it belongs in CI later, a scheduled job is the right shape — not a PR gate.Docs
construct-cli/AGENTS.mdnow records what is gated and what is not, including whycargo auditis absent and why a clippy finding should be fixed rather than pinned around. Its peerCLAUDE.mdgot the identical edit but is gitignored, so it is not in this diff — the two remain identical apart from their self-reference line, as that file pair requires.Verification
The workflow YAML parses under
.github/validate-configs.py(309 config files, 0 failed). Locally:cargo fmt --check,cargo clippy --all-targets -- -D warnings, andcargo test(40 passed) are all clean on this branch.The
msrvjob is unverified locally — I had no 1.82 toolchain to hand, so this PR is the first real test of it. If it fails, the fix is either arust-versionbump inCargo.tomlto match what the code actually needs, or dropping the job; I'll resolve it here before merge rather than land a red gate.🤖 Generated with Claude Code