Skip to content

ci(rust): fail the build on rustdoc and rustc warnings - #3925

Open
hubcio wants to merge 2 commits into
masterfrom
ci/doctest-deny-warnings
Open

ci(rust): fail the build on rustdoc and rustc warnings#3925
hubcio wants to merge 2 commits into
masterfrom
ci/doctest-deny-warnings

Conversation

@hubcio

@hubcio hubcio commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Two classes of warning were accumulating unseen. The doctest
leg ran cargo doc with no gate and stayed green through 69
rustdoc diagnostics across 20 crates; broken intra-doc links
are the costly ones, since they render as plain text and the
docs quietly lose their navigation. Separately, the clippy
leg denies warnings but runs with --all-features while the
test legs build at default features, so a warning that only
shows up when a feature is off was invisible - that is how
four dead_code findings in the integration test binary sat
in CI output.

RUSTDOCFLAGS closes the first and is cache-safe: it enters
the fingerprint of doc units only, never lib or bin units.

For the second the Cargo lints table beat RUSTFLAGS=-D
warnings. RUSTFLAGS enters the fingerprint of every unit
including registry dependencies, so it forces a full rebuild
of the dep tree and would have to be mirrored into
coverage-baseline, the sole writer of the shared cargo
cache. Measured both ways here: the lints table rebuilt 50
workspace crates and zero registry crates.

Eleven crates keep a local [lints.rust] block because cargo
refuses to merge an inherited table with the [lints.clippy]
they already carry. That makes their nursery = "warn"
effectively deny, since rustc resolves the warnings group at
emission time and catches anything left at warn whatever the
flag order. CI behaviour is unchanged: the clippy leg
already appended -D warnings.

Most rustdoc fixes drop the link brackets where the target
is private and rustdoc has nothing to point at under
--no-deps. Widening visibility to satisfy a doc comment is
backwards, and --document-private-items would publish the
internals of every crate.

The dead ci-qemu feature goes with it; nothing has
referenced it since the monorepo restructure in 8db64db.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Aug 19, 2026
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.65%. Comparing base (2b1406b) to head (f87cfb3).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3925      +/-   ##
============================================
- Coverage     83.87%   83.65%   -0.22%     
  Complexity     1358     1358              
============================================
  Files          1212     1212              
  Lines        166845   166845              
  Branches     134304   134432     +128     
============================================
- Hits         139935   139568     -367     
- Misses        23269    23489     +220     
- Partials       3641     3788     +147     
Components Coverage Δ
Rust Core 84.62% <ø> (-0.03%) ⬇️
Java SDK 66.67% <ø> (ø)
C# SDK 75.00% <ø> (-1.48%) ⬇️
Python SDK 90.13% <ø> (ø)
PHP SDK 84.48% <ø> (ø)
Node SDK 94.03% <ø> (-1.92%) ⬇️
Go SDK 68.32% <ø> (ø)
Files with missing lines Coverage Δ
core/cli/src/args/context.rs 100.00% <ø> (ø)
core/common/src/types/options/mod.rs 86.66% <ø> (ø)
core/common/src/wire_conversions.rs 90.89% <ø> (ø)
core/configs/src/server_config/cluster.rs 98.70% <ø> (ø)
core/configs/src/server_config/server.rs 85.48% <ø> (ø)
core/configs_derive/src/lib.rs 100.00% <ø> (ø)
...igs/connectors/http_provider/response_extractor.rs 87.62% <ø> (ø)
core/connectors/sinks/http_sink/src/lib.rs 85.70% <ø> (-0.09%) ⬇️
core/consensus/src/client_table.rs 88.84% <ø> (ø)
core/consensus/src/dvc_merge.rs 93.61% <ø> (ø)
... and 25 more

... and 61 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

spetz
spetz previously approved these changes Aug 21, 2026
Two classes of warning were accumulating unseen. The doctest
leg ran cargo doc with no gate and stayed green through 69
rustdoc diagnostics across 20 crates; broken intra-doc links
are the costly ones, since they render as plain text and the
docs quietly lose their navigation. Separately, the clippy
leg denies warnings but runs with --all-features while the
test legs build at default features, so a warning that only
shows up when a feature is off was invisible - that is how
four dead_code findings in the integration test binary sat
in CI output.

RUSTDOCFLAGS closes the first and is cache-safe: it enters
the fingerprint of doc units only, never lib or bin units.

For the second the Cargo lints table beat RUSTFLAGS=-D
warnings. RUSTFLAGS enters the fingerprint of every unit
including registry dependencies, so it forces a full rebuild
of the dep tree and would have to be mirrored into
coverage-baseline, the sole writer of the shared cargo
cache. Measured both ways here: the lints table rebuilt 50
workspace crates and zero registry crates.

Eleven crates keep a local [lints.rust] block because cargo
refuses to merge an inherited table with the [lints.clippy]
they already carry. That makes their nursery = "warn"
effectively deny, since rustc resolves the warnings group at
emission time and catches anything left at warn whatever the
flag order. CI behaviour is unchanged: the clippy leg
already appended -D warnings.

Most rustdoc fixes drop the link brackets where the target
is private and rustdoc has nothing to point at under
--no-deps. Widening visibility to satisfy a doc comment is
backwards, and --document-private-items would publish the
internals of every crate.

The dead ci-qemu feature goes with it; nothing has
referenced it since the monorepo restructure in 8db64db.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants