Skip to content

wip: feat: adding guarded minimum rust version checks - #85

Draft
dotkas wants to merge 2 commits into
developfrom
dotkas/minimum-rust-version-verification-checks
Draft

wip: feat: adding guarded minimum rust version checks#85
dotkas wants to merge 2 commits into
developfrom
dotkas/minimum-rust-version-verification-checks

Conversation

@dotkas

@dotkas dotkas commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot AI review requested due to automatic review settings August 3, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-version value and surface it in the dependency report output.
  • Add an msrv-check crate 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_manifest test) 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.

Comment thread Makefile Outdated
Comment thread crates/oapi-codegen/tests/msrv-check/build.rs Outdated
@dotkas dotkas changed the title fix: adding guarded minimum rust version checks wip: feat: adding guarded minimum rust version checks Aug 3, 2026
@dotkas dotkas added the help wanted Extra attention is needed label Aug 3, 2026
@dotkas
dotkas marked this pull request as draft August 3, 2026 08:22
@dotkas dotkas added the enhancement New feature or request label Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants