wip: feat: adding guarded minimum rust version checks - #85
Draft
dotkas wants to merge 2 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an explicit, test-enforced MSRV for consumer-compiled generated code (separate from the workspace/tooling Rust version), and wires that MSRV through the CLI output, documentation, and CI so the reported floor is measured rather than merely stated.
Changes:
- Add a dedicated
package.metadata.generated-code.rust-versionvalue and surface it in the dependency report output. - Add an
msrv-checkcrate plus CI job to compile all committed golden files on the declared generated-code MSRV. - Add a generated/guarded manifest flow (
make update-msrv-manifest+msrv_manifesttest) and document the three Rust-version concepts.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Links to MSRV documentation and reflects the new “generated code needs Rust …” note in example output. |
| Makefile | Adds msrv-manifest refresh target and MSRV verification target used by CI. |
| examples/bookstore/README.md | Updates example sessions to include the generated-code MSRV note. |
| docs/msrv.md | New document describing the generator/build MSRV vs generated-code MSRV, how it’s measured, and how to raise it. |
| docs/configuration.md | Cross-links dependency reporting to the Rust versions/MSRV explanation. |
| crates/oapi-codegen/tests/support/apimodel.rs | Factors shared test-only apimodel module out for reuse by msrv-check. |
| crates/oapi-codegen/tests/msrv-check/src/lib.rs | New detached crate that compiles all golden outputs as the MSRV assertion. |
| crates/oapi-codegen/tests/msrv-check/Cargo.toml | Generated manifest for the detached MSRV-check crate (source-of-truth: dependency report). |
| crates/oapi-codegen/tests/msrv-check/Cargo.lock | Lockfile for deterministic MSRV-check dependency resolution. |
| crates/oapi-codegen/tests/msrv-check/build.rs | Build script that generates module includes for all committed golden files. |
| crates/oapi-codegen/tests/msrv_manifest.rs | New test to keep msrv-check/Cargo.toml in sync with the dependency report. |
| crates/oapi-codegen/tests/generated.rs | Switches apimodel stub to include! the shared support file. |
| crates/oapi-codegen/tests/fixtures/manifests/two_rust_versions.toml | Fixture to ensure generated-code MSRV parsing doesn’t fall back to [package].rust-version. |
| crates/oapi-codegen/tests/fixtures/manifests/generated_code_table_without_rust_version.toml | Fixture to ensure parsing stops at the next table header. |
| crates/oapi-codegen/src/deps.rs | Adds generated-code MSRV parsing from the crate manifest and tests for correctness. |
| crates/oapi-codegen/src/console.rs | Prints the generated-code MSRV alongside dependency guidance. |
| crates/oapi-codegen/Cargo.toml | Adds metadata table declaring the generated-code MSRV; adds crates.io metadata fields. |
| Cargo.toml | Declares workspace/tooling rust-version and workspace homepage. |
| .github/workflows/ci.yml | Adds generated-code-msrv job compiling goldens on the consumer MSRV and gates CI pass on it. |
dotkas
marked this pull request as draft
August 3, 2026 08:22
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.
Currently too sloppy for a real PR. Needs more investigation / thoughts.
Want the CLI to self-report the minimum supported rust version (msrv) of the generated code to the user, as well as best-effort keep that in sync automatically as dependencies gets bumped / features change over time.