Skip to content

[Chore] Require changed-code mutation tests before review - #1479

Draft
zoomote[bot] wants to merge 2 commits into
mainfrom
feature/stryker-pr-gate-3uinx2ul0jc05
Draft

[Chore] Require changed-code mutation tests before review#1479
zoomote[bot] wants to merge 2 commits into
mainfrom
feature/stryker-pr-gate-3uinx2ul0jc05

Conversation

@zoomote

@zoomote zoomote Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

Related GitHub Issue

Closes: N/A - requested from the linked Discord discussion.

Description

Adds a fork-safe mutation-diff pull-request check that derives executable TypeScript/JavaScript line ranges from the PR merge base and runs StrykerJS only against those ranges. The gate covers focused Vitest suites in core, cloud, telemetry, vscode-shim, webview-ui, and the extension; unsupported or non-executable changes return an explicit not-applicable success.

Any surviving or uncovered changed-code mutant fails with bounded line annotations. Each package fails closed above 500 changed executable lines or 400 generated/valid mutants, and broad or unreasoned Stryker exclusions are rejected. Mutation results are never cached, and every selected run uses --force.

Webview and extension changes use Vitest's dependency graph to discover affected tests, then prefer directly named unit specs when available before passing exact test files to Stryker. This keeps the new surfaces practical without including VS Code e2e tests. The lockfile also pins patched qs@6.15.2, and the Stryker config remains safely importable by Knip.

Test Procedure

  • Run pnpm test:mutation-ci to exercise merge-base selection, executable ranges, caps, report evaluation, and exclusion policy.
  • Run pnpm test for the complete workspace suite.
  • Run actionlint .github/workflows/mutation-testing.yml.
  • Verify real webview and extension range runs discover focused unit tests, produce JSON/HTML reports, and emit blocking annotations for known surviving or uncovered mutants.

Pre-Submission Checklist

  • Issue Linked: The originating Discord request is linked above.
  • Scope: Changes are limited to the StrykerJS CI gate and its tests/dependencies.
  • Self-Review: The final diff received focused completion reviews.
  • Testing: Diff/range, cap, exclusion, timeout, and report-policy tests were added.
  • Visual Snapshot: Not applicable; this is non-visual CI tooling.
  • Documentation Impact: No user-facing documentation update is required.
  • Contribution Guidelines: Repository conventions and hooks were preserved.

Visual Snapshots

Not applicable.

Videos (interaction / animation only)

Not applicable.

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required.

Additional Notes

After this workflow lands on main, a repository administrator must add the stable mutation-diff context to the required-status-check ruleset. Requiring it before the workflow exists on the default branch could leave unrelated pull requests permanently pending.

CLI, types, and VS Code e2e surfaces remain explicit not-applicable paths. Webview and extension mutation runs are bounded by the existing 12-minute per-process and 30-minute workflow timeouts; multi-package PRs can therefore fail on runtime before reaching the numeric mutant cap and may need to be split.

Get in Touch

Continue in the originating Discord thread or mention @roomote on the pull request.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Review process

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

  1. Required CI checks pass.
  2. The workflow starts CodeRabbit automatically.
  3. For eligible human-authored PRs, CodeRabbit reviews and approves the latest commit.
  4. A human maintainer reviews and approves after CodeRabbit.

Current step: Mark the PR ready to start CodeRabbit after required CI passes.

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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