Skip to content

ci: skip JS build when no JS-related code changed#3186

Merged
QuantumExplorer merged 2 commits into
v3.1-devfrom
ci/conditional-build-js
Mar 5, 2026
Merged

ci: skip JS build when no JS-related code changed#3186
QuantumExplorer merged 2 commits into
v3.1-devfrom
ci/conditional-build-js

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

@QuantumExplorer QuantumExplorer commented Mar 5, 2026

Issue being fixed or feature implemented

build-js runs unconditionally on every non-draft PR, even for changes that only touch swift-sdk, rs-sdk, or other non-JS code.

What was done?

Made build-js depend on the changes job and only run when:

  • Any JS package has changes (js-packages != '[]'), OR
  • Test-suite-related code changed (test-suite == 'true') — since the test suite runs JS tests against a local network even for Rust-only changes

Downstream jobs (js-packages, js-codeql, etc.) that depend on build-js are naturally skipped when it's skipped.

How Has This Been Tested?

  • Verified workflow YAML syntax
  • Confirmed downstream job dependency chain handles skipped build-js correctly

Breaking Changes

None.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Adjusted build/test orchestration so JS build runs only when relevant changes or test-suite flag are present.
    • Added the new wasm-dpp2 package to package filtering and to CI test-suite triggers so changes there are included in workflows and tests.

Only run build-js when JS packages have changes or test-suite-related
code changed. This avoids building JS for PRs that only touch
swift-sdk, rs-sdk, or other non-JS code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v3.1.0 milestone Mar 5, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f7c281f-2ea4-4658-98cf-f7981f430223

📥 Commits

Reviewing files that changed from the base of the PR and between f7a9a8b and f4ab446.

📒 Files selected for processing (4)
  • .github/package-filters/js-packages-direct.yml
  • .github/package-filters/js-packages-no-workflows.yml
  • .github/package-filters/js-packages.yml
  • .github/package-filters/test-suite-triggers.yml

📝 Walkthrough

Walkthrough

Added @dashevo/wasm-dpp2 package filters and test-suite trigger entries across CI package-filter files; updated .github/workflows/tests.yml to make build-js depend on the changes job and gate its run on needs.changes.outputs.js-packages or needs.changes.outputs.test-suite.

Changes

Cohort / File(s) Summary
CI Workflow
\.github/workflows/tests.yml
Added needs: changes dependency to the build-js job and changed its if condition to use needs.changes.outputs.js-packages != '[]' OR needs.changes.outputs.test-suite == 'true' to gate execution.
JS package filters
\.github/package-filters/js-packages.yml, \.github/package-filters/js-packages-direct.yml, \.github/package-filters/js-packages-no-workflows.yml
Added new package filter entries for @dashevo/wasm-dpp2 (mapped to packages/wasm-dpp2/**) with corresponding anchors/exclusion patterns mirroring existing wasm-dpp rules.
Test-suite triggers
\.github/package-filters/test-suite-triggers.yml
Added packages/wasm-dpp2/** to the test-suite trigger paths.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • feat: add wallet contract #2314: Modifies the same .github/workflows/tests.yml file with related changes to the build-js job's dependencies and conditional execution.

Suggested reviewers

  • shumkov

Poem

🐰 I hopped through YAML, tidy and spry,
Added a package and told tests to try,
Jobs now check changes before they run,
A thump and a wiggle — CI's neatly done!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making the JS build conditional based on whether JS-related code changed, which aligns with the primary objective of skipping unnecessary builds.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci/conditional-build-js

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/tests.yml:
- Line 87: The CI condition gating JS jobs (the if: expression controlling
build-js and downstream JS jobs) relies on package filter outputs and currently
omits the packages/wasm-dpp2/** path, causing PRs touching that path to skip JS
workflows; update the package filters by adding packages/wasm-dpp2/** to
.github/package-filters/js-packages-no-workflows.yml (and also to
.github/workflows/test-suite-triggers.yml or its referenced trigger config if
that file controls test-suite detection) so that changes under
packages/wasm-dpp2 correctly flip needs.changes.outputs.js-packages and/or
needs.changes.outputs.test-suite and trigger the build-js and JS test jobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 272f63a9-3bb4-4344-ad4a-82f20a4c2627

📥 Commits

Reviewing files that changed from the base of the PR and between d448005 and f7a9a8b.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

Comment thread .github/workflows/tests.yml
wasm-dpp2 was missing from JS package filters, meaning changes to it
would not trigger JS builds or test suite runs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@QuantumExplorer QuantumExplorer merged commit a669991 into v3.1-dev Mar 5, 2026
32 of 34 checks passed
@QuantumExplorer QuantumExplorer deleted the ci/conditional-build-js branch March 5, 2026 10:51
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.

2 participants