Skip to content

feat(core): add force rerun triggers#1257

Merged
9aoy merged 4 commits into
mainfrom
9aoy/feat-force-rerun-triggers
May 15, 2026
Merged

feat(core): add force rerun triggers#1257
9aoy merged 4 commits into
mainfrom
9aoy/feat-force-rerun-triggers

Conversation

@9aoy

@9aoy 9aoy commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Background

--changed can miss files that affect the whole test environment when those files are not represented in the module graph.

Implementation

  • Added forceRerunTriggers config support and wired --changed to run the full suite when changed files match.
  • Added adapter-provided triggers for loaded Rsbuild, Rslib, and Rspack config files while keeping explicit user config as a full override.
  • Documented the option and adapter merge behavior in English and Chinese docs.

User Impact

Users get safer --changed results for package, Rstest config, and adapter-loaded build config changes, with forceRerunTriggers: [] available to opt out.

Related Links

None

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Validation

  • pnpm --filter @rstest/core build
  • pnpm --filter @rstest/adapter-rsbuild build
  • pnpm --filter @rstest/adapter-rslib build
  • pnpm --filter @rstest/adapter-rspack build
  • pnpm rstest packages/core/tests/cli/commands.test.ts packages/core/tests/config.test.ts
  • pnpm 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.ts
  • cd e2e && pnpm test filter/changed.test.ts
  • pnpm run check-unused

Comment thread packages/adapter-rslib/src/index.ts Fixed
@github-actions

github-actions Bot commented May 14, 2026

Copy link
Copy Markdown

Rsdoctor Bundle Diff Analysis

Found 12 projects in monorepo, 4 projects with changes.

📊 Quick Summary
Project Total Size Change
adapter-rsbuild 3.7 KB 📈 +97.0 B (+2.6%)
adapter-rslib 24.7 KB +96.0 B (0.4%)
adapter-rspack 7.8 KB 📈 +107.0 B (+1.4%)
browser 2.0 MB 0
browser-react 3.7 KB 0
browser-ui 803.5 KB 0
coverage-istanbul 9.6 KB 0
core/browser 970.0 KB 0
core/loaders 869.0 B 0
core/main 1.7 MB +1.9 KB (0.1%)
vscode/extension 26.9 MB 0
vscode/worker 14.4 KB 0
📋 Detailed Reports (Click to expand)

📁 adapter-rsbuild

Path: packages/adapter-rsbuild/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: a541fa349d | PR: #1252

Metric Current Baseline Change
📊 Total Size 3.7 KB 3.6 KB +97.0 B (+2.6%)
📄 JavaScript 3.7 KB 3.6 KB +97.0 B (+2.6%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: adapter-rsbuild Bundle Diff

📁 adapter-rslib

Path: packages/adapter-rslib/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: a541fa349d | PR: #1252

Metric Current Baseline Change
📊 Total Size 24.7 KB 24.6 KB +96.0 B (0.4%)
📄 JavaScript 24.7 KB 24.6 KB +96.0 B (0.4%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: adapter-rslib Bundle Diff

📁 adapter-rspack

Path: packages/adapter-rspack/.rsdoctor/rsdoctor-data.json

📌 Baseline Commit: a541fa349d | PR: #1252

Metric Current Baseline Change
📊 Total Size 7.8 KB 7.7 KB +107.0 B (+1.4%)
📄 JavaScript 7.8 KB 7.7 KB +107.0 B (+1.4%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 0 B 0 B 0

📦 Download Diff Report: adapter-rspack Bundle Diff

📁 core/main

Path: packages/core/.rsdoctor/main/rsdoctor-data.json

📌 Baseline Commit: a541fa349d | PR: #1252

Metric Current Baseline Change
📊 Total Size 1.7 MB 1.7 MB +1.9 KB (0.1%)
📄 JavaScript 1.6 MB 1.6 MB +1.9 KB (0.1%)
🎨 CSS 0 B 0 B 0
🌐 HTML 0 B 0 B 0
📁 Other Assets 81.6 KB 81.6 KB 0

📦 Download Diff Report: core/main Bundle Diff

Generated by Rsdoctor GitHub Action

@9aoy 9aoy marked this pull request as ready for review May 14, 2026 09:33
@9aoy

9aoy commented May 14, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/core/src/cli/commands.ts Outdated
@9aoy 9aoy requested a review from fi3ework May 14, 2026 10:38
@fi3ework

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread packages/core/src/cli/commands.ts Outdated
options.changed !== undefined &&
hasForceRerunTrigger({
changedFiles: sourceFilters,
triggers: rstest.context.normalizedConfig.forceRerunTriggers,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@fi3ework fi3ework May 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@9aoy PLAT, is need to be fixed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@9aoy 9aoy merged commit d22de71 into main May 15, 2026
12 checks passed
@9aoy 9aoy deleted the 9aoy/feat-force-rerun-triggers branch May 15, 2026 05:57
@9aoy 9aoy mentioned this pull request May 18, 2026
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