Repository navigation
Build the Rust crate on its MSRV, without its default feature, and as docs.rs would - #155
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟡 Changes recommended
Both stable Rust setup steps use an argument-less command that fails before tests can run.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Hardens Rust CI across pinned stable, MSRV, docs.rs, and no-default-feature builds.
Changes:
- Pins the Rust toolchain and adds MSRV/docs.rs jobs.
- Expands checks across feature configurations.
- Adds a test-only custom HTTP transport.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
File summaries
| File | Description |
|---|---|
.github/workflows/test.yml |
Adds and updates Rust CI jobs. |
rust-toolchain.toml |
Pins stable Rust and components. |
rust/Makefile |
Expands Rust checks. |
rust/hey-sdk/tests/support/mod.rs |
Adds feature-aware test transport. |
rust/hey-sdk/tests/services_attachments.rs |
Gates reqwest-specific coverage. |
rust/hey-sdk/tests/raw.rs |
Supplies the test transport. |
rust/hey-sdk/tests/observability.rs |
Supplies the test transport. |
rust/hey-sdk/tests/form.rs |
Gates reqwest-specific coverage. |
rust/hey-sdk/tests/client_pipeline.rs |
Supplies the test transport. |
rust/hey-sdk/tests/body_limit.rs |
Supplies the test transport. |
rust/hey-sdk/src/services/messages.rs |
Gates reqwest wire tests. |
rust/hey-sdk/src/services/entries.rs |
Gates reqwest wire tests. |
rust/hey-sdk/src/oauth.rs |
Gates reqwest-dependent OAuth tests. |
Review details
Suppressed comments (1)
.github/workflows/test.yml:232
- This repeats the argument-less
rustup toolchain install, which fails before the conformance runner can start. Letrustup showresolve and install the toolchain declared byrust-toolchain.tomlinstead.
run: rustup toolchain install && rustup show
- Files reviewed: 13/13 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3801707 to
bcbc4ea
Compare
bcbc4ea to
9ff87f1
Compare
|
From an external adversarial pass over the stack: the test-only DevTransport had no deadline of its own, so under --no-default-features a stalled mock could hang a test until the job timeout instead of failing the way the shipped transport does. It now carries a 30 s request timeout. Rebased on main after #153; nothing else changed. |
9ff87f1 to
af9bde0
Compare
af9bde0 to
d403df3
Compare
… docs.rs would The Rust gate ran on whatever stable was current, with the default feature only. Nothing compiled the crate on the 1.88 it promises in rust-version, nothing built it with the shipped HTTP client off, and the first docs.rs render would have been the first nightly rustdoc pass over it. CI now has three Rust build jobs beside the conformance run: test-rust, on the toolchain rust-toolchain.toml pins, runs `make rs-check`, which is fmt, clippy, the tests and the docs with all features and then clippy and the tests again with --no-default-features; msrv-rust reads rust-version out of rust/Cargo.toml and builds the library there, both feature sets; docs-rust builds the docs on nightly with --cfg docsrs. Without the reqwest feature the test suite has no transport, so tests/support grows one over the reqwest dev-dependency and hands it to every client it builds. The suite then proves what the feature promises: nothing above the HttpClient seam needs the shipped client. The handful of tests about the shipped client itself are gated on the feature. rust-toolchain.toml pins an exact stable so rustfmt and clippy agree everywhere and a new lint arrives through a bump rather than on an unrelated pull request; the stable jobs install from it, and the MSRV and nightly jobs outrank it with RUSTUP_TOOLCHAIN.
d403df3 to
bea5524
Compare
First of three CI-hardening pull requests for the Rust crate (card: hey-sdk Rust: CI hardening). This one is the build side;
cargo denyand the API-compatibility gate follow on top of it.What changes
test-rustinstalls the toolchain from the newrust-toolchain.tomland runsmake rs-check, which is now fmt, clippy, tests and docs with--all-features, then clippy and the tests again with--no-default-features. The same target a developer runs locally, in the same order.msrv-rustreadsrust-versionout ofrust/Cargo.tomland builds the library on exactly that toolchain, both feature sets. Only the library: the generator and the conformance runner are tooling and float on the pinned stable. A bump torust-versionis what moves this job; the job fails if it can't find the field.docs-rustbuilds the docs on nightly withRUSTDOCFLAGS="--cfg docsrs -D warnings", which is what docs.rs will do with the crate. Not proposed as a required check; nightly is nightly.rust-toolchain.tomlpins an exact stable (1.98.1, what.mise.tomlresolves1.98to) withclippyandrustfmt. The stable jobs install from it with a barerustup toolchain install; the MSRV and nightly jobs setRUSTUP_TOOLCHAIN, which outranks the file. It sits at the repo root rather than underrust/becauseconformance/runner/rustis a second workspace outside that directory.--no-default-featuresThe crate's one feature is the shipped
reqwesttransport, and without it the test suite had no way to reach wiremock.tests/supportnow builds every client with an explicithttp_client: the shippedReqwestClientwhen the feature is on, and otherwise a minimalDevTransportover thereqwestdev-dependency (no redirects, streamed body). So under--no-default-featuresthe whole integration suite runs through a transport of the caller's own, which is the thing the feature exists to allow. Tests that are specifically about the shipped client —ReqwestClient::from_builder, the OAuth wire tests that useOAuthClient::default(), the messages/entries unit tests that build a default client — are gated on the feature. Doctests are skipped in that configuration; they show the default client on purpose.Verified locally:
make rs-checkgreen on this branch;cargo build -p hey-sdk --lockedgreen on 1.88.0 with the committed lockfile.Not in this PR
cargo deny, Dependabotcargo, Trivy overCargo.lock— next PR.cargo semver-checksandcargo packagein the gate — third PR.cargo build --examples— lands with the examples (docs card).actions,goandrust.--all-featuresand the default set are the same build today (one feature); when a second feature lands the matrix gains a leg.Merge order
This PR is part of a five-PR stack, each rebased on the one below and all five on current
main, so they merge cleanly in this order and only this order: #155 (build/MSRV/feature matrix) → #157 (cargo deny, Dependabot, Trivy) → #159 (semver-checks, packaging) → #160 (docs, examples, rustfmt) → #162 (crates.io publishing). Every one of them touches.github/workflows/test.ymland/or the Makefiles; the stacking is the conflict resolution. Merge each one after the one below has landed; GitHub retargets the next PR tomainwhen the merged branch is deleted. #162 can merge before the crates.io bootstrap: it publishes nothing until the crate exists on crates.io (its publish job fails closed with instructions on a tag until then), and nothing in it changes after the bootstrap.