From 6fe7842f7bddae88baa4a7c9af101840f51beab2 Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Sun, 9 Aug 2026 19:58:11 -0500 Subject: [PATCH] feat: config-based MSI threshold for mutation-test job Adds min-msi / min-covered-msi inputs (default "10") to the shared mutation-test job, passed as --min-msi/--min-covered-msi flags at invocation time (composer script itself stays plain 'infection'). Config-based per repo rather than hardcoded, since php-db repos are legacy codebases just adopting mutation testing and most don't have a baseline MSI yet. Default is deliberately low so the first real run doesn't fail outright; each repo raises it once it has a real score to ratchet up from. --- .github/workflows/continuous-integration.yml | 12 +++++++++++- docs/workflow-architecture.md | 12 ++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index aba7351..c6ada00 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -63,6 +63,16 @@ on: type: string required: false default: "" + min-msi: + description: "Minimum Mutation Score Indicator (%) required to pass the mutation-test job." + type: string + required: false + default: "10" + min-covered-msi: + description: "Minimum covered-code MSI (%) required to pass the mutation-test job." + type: string + required: false + default: "10" secrets: CODECOV_TOKEN: required: false @@ -255,4 +265,4 @@ jobs: - name: Mutation testing env: INFECTION_DASHBOARD_API_KEY: ${{ secrets.INFECTION_DASHBOARD_API_KEY }} - run: composer mutation-test + run: composer mutation-test -- --min-msi=${{ inputs.min-msi }} --min-covered-msi=${{ inputs.min-covered-msi }} --logger-github diff --git a/docs/workflow-architecture.md b/docs/workflow-architecture.md index 3bce6b1..c930f83 100644 --- a/docs/workflow-architecture.md +++ b/docs/workflow-architecture.md @@ -128,6 +128,16 @@ generated by registering the repo at dashboard.stryker-mutator.io). Either var name. **Must be passed as an `env:` block on the `run:` step, not as a `with:` input** — Infection reads it from the environment, not a CLI flag. +`min-msi` / `min-covered-msi` (both default `"10"`) control the MSI +threshold that fails the job — config-based per repo, not hardcoded. Default +is deliberately low: most php-db repos are legacy codebases just adopting +mutation testing, and a strict bar (e.g. message-bus's 90/90) would fail +immediately. Each consuming repo overrides these once it has a real +baseline MSI to ratchet up from. Passed as `composer mutation-test -- +--min-msi=... --min-covered-msi=... --logger-github` (the composer script +itself stays plain `infection`, flags are appended at invocation time, same +pattern as message-bus). + ## Secrets Because `CODECOV_TOKEN` is org-scoped and `INFECTION_DASHBOARD_API_KEY` is @@ -150,6 +160,8 @@ within the same GitHub org. | `enable-codecov` | Turns on the `codecov` job. | | `enable-infection` | Turns on the `mutation-test` job. | | `coverage-php-version` | Which matrix leg is canonical for coverage/mutation. | +| `min-msi` | Minimum MSI (%) required to pass `mutation-test` (default `"10"`, config-based per repo). | +| `min-covered-msi` | Minimum covered-code MSI (%) required to pass `mutation-test` (default `"10"`, config-based per repo). | Plus `secrets: CODECOV_TOKEN`, `INFECTION_DASHBOARD_API_KEY` on `workflow_call` (both `required: false`).