ci: split lint into parallel jobs and remove redundant checks#3366
Open
bryantbiggs wants to merge 1 commit intoopen-telemetry:mainfrom
Open
ci: split lint into parallel jobs and remove redundant checks#3366bryantbiggs wants to merge 1 commit intoopen-telemetry:mainfrom
bryantbiggs wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
Split the monolithic lint job into two parallel CI jobs for faster feedback: - `lint`: format check, workspace-wide clippy, and multi-feature combination checks (~1-2 min) - `lint-feature-matrix`: per-feature clippy via cargo hack (~5-6 min) Previously, all 150 clippy invocations ran sequentially in a single job. The most common CI failure on PRs is the per-feature matrix catching dead code or unused warnings that only surface when individual features are tested in isolation. By splitting these into parallel jobs, contributors get fast feedback on the common checks while the thorough feature matrix runs alongside. Also removes 6 redundant cargo_feature checks from lint.sh that are already covered by `cargo hack --each-feature`: - opentelemetry-otlp "default", "http-proto", "metrics" - opentelemetry-jaeger-propagator "default" - opentelemetry-proto "default", "full" Updates CONTRIBUTING.md to document the cargo hack lint command so contributors can catch per-feature issues locally before pushing.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3366 +/- ##
=======================================
- Coverage 82.2% 82.2% -0.1%
=======================================
Files 128 128
Lines 24626 24626
=======================================
- Hits 20267 20266 -1
- Misses 4359 4360 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
The CI
lintjob is the most frequent source of PR failures. After investigating ~20 recent failures, every single one was a legitimate clippy error (dead code, unused variables, etc.) caught bycargo hack --each-feature— not resource exhaustion or flakiness.The root cause: PRs introduce code that compiles fine with
--all-featuresbut triggers warnings when individual features are tested in isolation (e.g., a function only used withgrpc-tonicenabled but missing#[cfg(feature = "grpc-tonic")]). Contributors don't know to runcargo hacklocally, so they only discover the issue after pushing.This PR improves the situation by:
Splitting lint into two parallel CI jobs for faster feedback:
lint: format, workspace clippy, and multi-feature combo checks (~1-2 min)lint-feature-matrix: per-feature clippy viacargo hack --each-feature(~5-6 min)Previously all ~150 clippy invocations ran sequentially in a single job. Now the quick checks give immediate feedback while the thorough feature matrix runs in parallel.
Removing 6 redundant
cargo_featurechecks fromlint.shthat are already covered bycargo hack --each-feature:opentelemetry-otlp "default","http-proto","metrics"(single-feature, already tested individually by cargo hack)opentelemetry-jaeger-propagator "default"(same)opentelemetry-proto "default","full"(same)Updating CONTRIBUTING.md to document the
cargo hacklint command so contributors can catch per-feature issues locally before pushing.Updating
scripts/precommit.shto include the feature matrix check.Test plan
lintjob passes (format + workspace clippy + multi-feature combos)lint-feature-matrixjob passes (cargo hack per-feature checks)