Skip to content

ci: add Stryker mutation-score enforcement + trend (#124) - #223

Merged
Chris-Wolfgang merged 4 commits into
vNextfrom
ci/stryker-gate
Jul 24, 2026
Merged

ci: add Stryker mutation-score enforcement + trend (#124)#223
Chris-Wolfgang merged 4 commits into
vNextfrom
ci/stryker-gate

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Builds the deferred enforcement layer on top of the existing scheduled Stryker run (which was a no-op — TestKit had no stryker-config.json).

Baseline established

Ran Stryker locally on the core project: 72.28% mutation score (215 killed, 81 survived, 4 timeout). Floor set at 70 (small margin for CI variance / timeout flakiness); ratchet up as coverage improves.

What this adds

  • stryker-config.json (core test project) — enables mutation testing, pinned to net10.0 (so gate + scheduled score consistently), break: 70.
  • Per-PR gatestryker.yaml now triggers on pull_request (path-filtered to src/**, tests/**). The break threshold fails a PR whose score drops below floor. Single-TFM pin keeps the run to ~minutes, not the full matrix.
  • Opt-in loop — the per-project loop now only runs test projects that ship a stryker-config.json, so the un-configured Xunit project isn't run ungated/all-TFM on every PR.
  • Trend publishing — a separate publish-trend job (push-to-main / schedule only; the only job with contents: write, so the gate job stays least-privilege) extracts the score via scripts/stryker-score.py and charts it on gh-pages dev/stryker via github-action-benchmark (customBiggerIsBetter). Score formula verified locally to reproduce Stryker's 72.28%.

AC follow-ups (not blocking)

  • A stryker-config.json + floor for the Xunit project (needs its own baseline run).
  • Track surviving mutants as kind:mutation-survives issues (81 survivors today).

Closes #124 when the vNext cycle merges to main.

🤖 Generated with Claude Code

Turns the existing scheduled Stryker run into the deferred enforcement layer:

- tests/Wolfgang.Etl.TestKit.Tests.Unit/stryker-config.json: enables mutation
  testing for the core project, pinned to net10.0, with break:70 floor
  (measured baseline 72.28% locally; small margin for CI variance).
- stryker.yaml: adds a pull_request gate (path-filtered to src/**, tests/**);
  the config break threshold fails the PR if the score regresses below floor.
  The per-project loop now only runs projects that ship a stryker-config.json
  (opt-in gating) so the un-configured Xunit project is not run ungated.
- publish-trend job (push to main / schedule only, separate contents:write
  job so the gate stays least-privilege): extracts the score via
  scripts/stryker-score.py and charts it on gh-pages dev/stryker via
  github-action-benchmark (customBiggerIsBetter).

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

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.

Chris-Wolfgang and others added 3 commits July 22, 2026 15:00
The actions-audit (#143) was failing every open PR on findings that aren't
actionable:

- actionlint tripped on info-level shellcheck nits (SC2012 'use find not ls',
  SC2035 'use ./*glob*') in the canonical pr.yaml. Set SHELLCHECK_OPTS to
  --severity=warning so it gates on warning+ (real issues), not style nits.
- zizmor flagged error[dangerous-triggers] on pr.yaml's pull_request_target.
  That is the intentional *gated* pattern (runs from trusted main, checks out PR
  refs, re-fetches config from main). Added a documented dangerous-triggers
  ignore for pr.yaml to .zizmor.yml and wired --config .zizmor.yml into the
  zizmor step (it is not auto-discovered).
- Enabling the config also activates the existing unpinned-uses:hash-pin policy,
  which then flagged pr.yaml's three remaining tag-pinned actions
  (checkout@v7, setup-dotnet@v5, upload-sarif@v4). SHA-pinned them to the repo
  canonical commits (also fixing a real SHA-pin-convention gap).

Verified locally: zizmor --config at high severity reports no findings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses the zizmor 'mismatched version comment' finding on #234: the pin
e0647621 is a real codeql-action commit (v4.37.2) but not the one the v4 tag
points to, so the hash-pin comment-match check flags it. Re-pin every
codeql-action reference (init / analyze / upload-sarif across pr, codeql,
actions-audit, scorecard, semgrep) to e4fba868 — the actual commit v4 resolves
to (verified via the GitHub tags API) — so each # v4 comment now matches.

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