Skip to content

ci: narrow Rust CI filters to exclude JS-only files in shared packages#3176

Merged
QuantumExplorer merged 1 commit into
v3.1-devfrom
ci/narrow-rs-package-filters
Mar 4, 2026
Merged

ci: narrow Rust CI filters to exclude JS-only files in shared packages#3176
QuantumExplorer merged 1 commit into
v3.1-devfrom
ci/narrow-rs-package-filters

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

Summary

  • Replace broad packages/foo/** globs with specific Rust-only patterns (src/**, schema/**, Cargo.toml, etc.) for the 10 shared packages that exist in both Cargo.toml and package.json workspaces
  • Prevents the entire Rust test matrix (17+ suites) from triggering on JS-only changes (e.g., package.json updates, .js file edits) in contract packages, dapi-grpc, and wasm-* packages
  • Pure Rust packages (rs-*) are unchanged since they have no JS files

Issue being fixed or feature being added

Fixes excessive CI resource usage: PR #3174 (sinon upgrade) only changed JS package.json files yet triggered all 17+ Rust test suites due to broad globs matching JS files in shared packages, which then cascaded through YAML anchor dependencies (contract → dpp → drive → drive-abci → etc.).

Root cause

dorny/paths-filter evaluates patterns with some() (OR) logic — a negation pattern !foo/package.json returns FALSE for that file, but positive pattern foo/** returns TRUE, so some() still returns TRUE. The fix uses specific positive-only patterns instead of trying negation.

Impact

Scenario Before After
package.json change in contract 17+ Rust test suites 0
.js file change in dapi-grpc 5+ Rust test suites cascade 0
src/lib.rs change in contract All downstream Rust tests Same (correct)
Cargo.toml change in contract All downstream Rust tests Same (correct)
schema/*.json change in contract All downstream Rust tests Same (correct)

Safety net

Nightly cron runs test everything regardless of filters — any missed trigger is caught within 24 hours.

Test plan

  • Verify next JS-only PR shows empty rs-packages in the changes job output with no Rust test jobs spawned
  • Verify a Rust source change (e.g., in a contract src/) still triggers the correct downstream test cascade
  • Confirm nightly cron still runs all test suites regardless

🤖 Generated with Claude Code

Shared packages (contracts, dapi-grpc, wasm-*) exist in both Cargo.toml
and package.json workspaces. Their broad `packages/foo/**` globs matched
JS files like package.json, causing the entire Rust test matrix (17+
suites) to run on JS-only changes. Replace with specific positive-only
patterns (src/**, schema/**, Cargo.toml, etc.) so only Rust-relevant
file changes trigger Rust CI. Pure Rust packages (rs-*) are unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@QuantumExplorer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Run ID: 0ce2fea5-2145-4e0a-8585-fbdbba8fc13d

📥 Commits

Reviewing files that changed from the base of the PR and between 1617b26 and f3eb676.

📒 Files selected for processing (3)
  • .github/package-filters/rs-packages-direct.yml
  • .github/package-filters/rs-packages-no-workflows.yml
  • .github/package-filters/rs-packages.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/narrow-rs-package-filters

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added this to the v3.1.0 milestone Mar 4, 2026
@QuantumExplorer QuantumExplorer merged commit 55ec8dc into v3.1-dev Mar 4, 2026
18 of 19 checks passed
@QuantumExplorer QuantumExplorer deleted the ci/narrow-rs-package-filters branch March 4, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant