feat(core): add force rerun triggers#1257
Conversation
Rsdoctor Bundle Diff AnalysisFound 12 projects in monorepo, 4 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 adapter-rsbuildPath:
📦 Download Diff Report: adapter-rsbuild Bundle Diff 📁 adapter-rslibPath:
📦 Download Diff Report: adapter-rslib Bundle Diff 📁 adapter-rspackPath:
📦 Download Diff Report: adapter-rspack Bundle Diff 📁 core/mainPath:
📦 Download Diff Report: core/main Bundle Diff Generated by Rsdoctor GitHub Action |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 546fb46390
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4aaf78616d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| options.changed !== undefined && | ||
| hasForceRerunTrigger({ | ||
| changedFiles: sourceFilters, | ||
| triggers: rstest.context.normalizedConfig.forceRerunTriggers, |
There was a problem hiding this comment.
Include per-project rerun triggers when evaluating --changed
The new --changed fast path only checks rstest.context.normalizedConfig.forceRerunTriggers, which is the top-level config, so triggers defined by project-level extends (for example adapter-provided config-file triggers in projects[]) are ignored. In multi-project setups this causes --changed to skip full reruns when a project’s Rsbuild/Rslib/Rspack config changes, because those files are typically outside the module graph and rely on this trigger mechanism. The check should aggregate triggers from context.projects[*].normalizedConfig.forceRerunTriggers (or otherwise resolve per-project triggers) before deciding whether to fall back to full-suite execution.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
See 292debc. forceRerunTriggers are currently evaluated across the selected run scope. Project-level triggers are included to avoid missing reruns, and a future optimization can narrow forced reruns to only affected projects.
Summary
Background
--changedcan miss files that affect the whole test environment when those files are not represented in the module graph.Implementation
forceRerunTriggersconfig support and wired--changedto run the full suite when changed files match.User Impact
Users get safer
--changedresults for package, Rstest config, and adapter-loaded build config changes, withforceRerunTriggers: []available to opt out.Related Links
None
Checklist
Validation
pnpm --filter @rstest/core buildpnpm --filter @rstest/adapter-rsbuild buildpnpm --filter @rstest/adapter-rslib buildpnpm --filter @rstest/adapter-rspack buildpnpm rstest packages/core/tests/cli/commands.test.ts packages/core/tests/config.test.tspnpm rstest packages/core/tests/config.test.ts packages/adapter-rsbuild/tests/toRstestConfig.test.ts packages/adapter-rsbuild/tests/index.test.ts packages/adapter-rslib/tests/index.test.ts packages/adapter-rspack/tests/toRstestConfig.test.ts packages/adapter-rspack/tests/index.test.tscd e2e && pnpm test filter/changed.test.tspnpm run check-unused