Skip to content

ci: enforce mutation-score floor as a release gate (#205) - #310

Merged
Chris-Wolfgang merged 2 commits into
vNextfrom
thorough/205-stryker-gate
Jul 23, 2026
Merged

ci: enforce mutation-score floor as a release gate (#205)#310
Chris-Wolfgang merged 2 commits into
vNextfrom
thorough/205-stryker-gate

Conversation

@Chris-Wolfgang

@Chris-Wolfgang Chris-Wolfgang commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Summary

Makes Stryker mutation testing an enforced release-gate quality bar and completes the observability around it (issue #205).

The gate

  • stryker-config.json break: 0 → 70. dotnet stryker exits non-zero (failing the job) below the floor. The floor sits below the measured full-project baseline of 74.4% (Stryker 4.16.0; 248 killed / 83 survived / 2 timeout of 333 tested, 2026-07-22) so CI timeout variance doesn't flake it.
  • stryker.yaml gains a path-scoped pull_request gate (src/** changes) — a regression below the floor fails the PR before merge. Scoped to source (a full run is tens of minutes); docs/test-only PRs skip. Weekly schedule + workflow_dispatch kept.
  • Stryker pinned to 4.16.0 for reproducibility.

Score history + survivor tracking (non-PR runs)

  • Trend chart on gh-pages /dev/stryker/ via github-action-benchmark (customBiggerIsBetter, same action/pin as the BDN charts). Trend visibility only — fail-on-alert: false.
  • Survivor tracking: writes the survivor worklist to the job summary and keeps one rolling kind:mutation-survives issue current — deliberately not one issue per survivor (dozens today would be noise). Best-effort; never fails the run.
  • The Run step tees output under set -o pipefail so the gate's exit code survives the pipe.

Docs

docs/mutation-testing.md documents the baseline, the floor, the ratchet-up-only policy, running locally, and the history/tracking behaviour.

This repo is on BannedApi 4.14 / PublicApi 3.3.4 (not the 5.6 analyzers), so it's not affected by the Stryker/CodeAnalysis-5.6 crash — verified by a clean full run.

Acceptance criteria (#205)

  • Documented mutation-score floor, ratchet up (break: 70, docs/mutation-testing.md)
  • PR gate fails the PR if score regresses below floor (path-scoped pull_request + break)
  • Score history published to a chart (gh-pages /dev/stryker)
  • Survivors tracked as a kind:mutation-survives issue (single rolling issue, not per-mutant)

Validation

  • actionlint + shellcheck + zizmor clean on stryker.yaml; stryker-config.json valid JSON.
  • This PR touches the config + workflow, so its own CI runs the gate (74.4% > floor 70 → passes). The publish/tracking steps run on schedule/dispatch only and were validated by the linters; they exercise fully on the next scheduled run.

Closes #205

Turns the existing (report-only) Stryker setup into an enforced release-gate
quality bar. stryker-config.json `break` goes 0 -> 70: dotnet stryker now exits
non-zero (failing the job) if the mutation score drops below the floor. The floor
sits a few points under the measured full-project baseline (74.4% on Stryker
4.16.0, 2026-07-22) so CI-runner timeout variance doesn't flake it, while a real
test-suite regression trips it.

stryker.yaml gains a path-scoped pull_request trigger (src/** changes) so a PR
that would drop the score below the floor is caught BEFORE merge — scoped to
source because a full run takes tens of minutes; docs/test-only PRs skip it. The
Stryker install is pinned to 4.16.0 so the gate is reproducible. (Note: this repo
is on BannedApi 4.14 / PublicApi 3.3.4, not the 5.6 analyzers, so it is unaffected
by the Stryker/CodeAnalysis-5.6 crash that blocks some fleet repos.)

docs/mutation-testing.md documents the baseline, the floor, the ratchet-up-only
policy, and how to run locally.

Partial for #205: the enforced floor + PR gate (the load-bearing "release-gate
quality bar") are done. The score-history chart and auto-filing of
kind:mutation-survives issues are deferred; reports upload as a workflow artifact
meanwhile.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 18:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Completes #205's remaining acceptance criteria on top of the enforced floor:

- Score history: non-PR (schedule/dispatch) runs parse the final mutation score
  from the Stryker log and publish it to gh-pages /dev/stryker via
  github-action-benchmark (customBiggerIsBetter — same action/pin as the BDN
  charts), one data point per run. Trend visibility only; fail-on-alert:false so
  it never double-fails the run (the `break` floor is the gate).
- Survivor tracking: non-PR runs write the survivor worklist (file:line + mutator,
  from mutation-report.json) to the job summary and keep ONE rolling
  kind:mutation-survives issue up to date — deliberately not one issue per
  survivor (dozens today = noise). Best-effort; never fails the run.

The Run step now tees Stryker output with `set -o pipefail` so the gate's
non-zero exit is preserved through the pipe. Publish/track steps run only on
non-PR events, so the PR gate path is unchanged.

Closes #205

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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