Skip to content

ci(workflow): run the sanitizers steps from Python (#962) - #2781

Merged
zackees merged 2 commits into
masterfrom
infra/962-gen-005-sanitizers-steps
Oct 28, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/962-gen-005-sanitizers-steps

Conversation

@zackees

@zackees zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member

Fixes #2780 — refs #962

GEN-005 burn-down: the sanitizers workflow kept its [[exceptions]] block for two inline run: steps. Both are now one call to ci/sanitizers_step.py, and the block is gone.

step was now
jobs.matrix.steps[0] (id: pick) if [ "$TOOLS" = all ] … echoing into $GITHUB_OUTPUT uv run --no-project ci/sanitizers_step.py select --tools "$TOOLS"
jobs.sanitize.steps[6] (Triage 🩺) [ -d ] guard + triage.py … | tee -a "$GITHUB_STEP_SUMMARY" uv run --no-project ci/sanitizers_step.py triage "$SAN_OUT/${{ matrix.tool }}"

RED 278519bb4 (local evidence — a focused CI/configuration change, so RED and GREEN are pushed together, coordination.md §4):

uv run python -m unittest ci/test_sanitizers_step.py → 12 tests, 13 failures + 1 error with the module absent and master's workflow in place (ci/sanitizers_step.py missing; both steps still run: |; the ci.toml block still present).

GREEN 6c8a9b5c1:

  • ci/sanitizers_step.py — select (the pass matrix, same literal JSON: all is ["asan","tsan","valgrind"], anything else is that one pass) and triage (a missing results directory is the build failure, one line in $GITHUB_STEP_SUMMARY and status 1 with nothing on stdout; otherwise triage.py runs over the pass directory, its report goes to the log and the summary, and its status is returned — what bash -e -o pipefail propagated through tee). fail_on_findings arrives as FAIL_ON_FINDINGS instead of a pre-assembled flag string.
  • .github/workflows/sanitizers.yaml — both steps are one line. The matrix job installed nothing before, so it gains its own pinned astral-sh/setup-uv step (the same save-cache: ${{ github.ref == 'refs/heads/master' }} expression the sanitize job already carries). No trigger, job name, timeout, runner or cache key changes.
  • ci.toml — the GEN-005 block for the path removed.
  • ci/test_sanitizers_step.py — the stdlib pin: both subcommands over real fixtures, the workflow's two one-line steps, the matrix job's uv setup, and no GEN-005 exception left for the path.

Nothing changed, proven off-line. I extracted master's two run: blocks and ran them verbatim under bash -e -o pipefail on the same fixtures as the new subcommands, with a uv shim on PATH that strips run --no-project and execs the real triage.py so both arms produce a real report:

SAME  select --tools all       exit=(0,0)  'tools=["asan","tsan","valgrind"]\n'
SAME  select --tools tsan      exit=(0,0)  'tools=["tsan"]\n'
SAME  select --tools valgrind  exit=(0,0)  'tools=["valgrind"]\n'
SAME  triage summary=clean    fail=False  exit=(0,0)  stdout=275/275B  summary=275/275B
SAME  triage summary=clean    fail=True   exit=(0,0)  stdout=275/275B  summary=275/275B
SAME  triage summary=failing  fail=False  exit=(0,0)  stdout=297/297B  summary=298/298B
SAME  triage summary=failing  fail=True   exit=(1,1)  stdout=297/297B  summary=298/298B
SAME  triage no-results      fail=False  exit=(1,1)  stdout=0/0B      summary=27/27B
SAME  triage no-results      fail=True   exit=(1,1)  stdout=0/0B      summary=27/27B
9 cases, 0 differ

Local checks. uv run ci/local_gate.py --only self-test → == self-test: ok (every ci/test_*.py). uvx ruff check on both new files → clean. ci-lint precheck on the branch: 5 violation(s), 416 approved exception(s), 10 needs_review (master: 5, 418, 10) — the two approved exceptions are this path's, no other rule moved, and the file has no GEN-005 finding left (its CACHE-002, RUN-001 and WF-004 entries are untouched).

No docs/features.md line: nothing a user can observe — the workflow's output, summary and status are byte-identical.

The Triage step's exit status is now the child's, so a --fail-on-findings finding still fails the job exactly as before; the matrix job's new uv step is master-only for cache saves, which is what CACHE-013 asks for in a workflow with no PR trigger.

RED: ci/sanitizers_step.py does not exist, so `select` and `triage` error
(FileNotFoundError), and both workflow steps are still `run: |` blocks with
their GEN-005 exceptions in ci.toml.

13 failures and 1 error on this tree.
Both remaining GEN-005 findings in `.github/workflows/sanitizers.yaml` are
inline shell blocks; each is now one call to `ci/sanitizers_step.py`.

- `select` (jobs.matrix `id: pick`) writes the same literal JSON to
  `$GITHUB_OUTPUT` for `all` and for a single pass. The matrix job installed
  nothing before, so it gets its own pinned `astral-sh/setup-uv` step with the
  same master-only `save-cache` expression the sanitize job uses.
- `triage` (jobs.sanitize `Triage 🩺`) keeps the missing-results failure and
  its one-line step summary, and otherwise runs `triage.py` over the pass
  directory, echoing the report to the log and the summary and returning the
  child's status. `fail_on_findings` now arrives as `FAIL_ON_FINDINGS` instead
  of a pre-assembled `--fail-on-findings` flag.

The ci.toml GEN-005 block for the path is removed: precheck's header goes
`5 violation(s), 418 approved exception(s), 10 needs_review` ->
`5 violation(s), 416 approved exception(s), 10 needs_review`, with no other
rule moving and no GEN-005 finding left for the file.

Differential against master's blocks, verbatim under `bash -e -o pipefail`,
with a `uv` shim so both arms run the real `triage.py`: 9/9 cases identical
(3 `select` values byte-for-byte in `$GITHUB_OUTPUT`; clean/failing report x
`fail_on_findings` on/off, plus the no-results path, matching stdout, summary
bytes and exit status).

Refs #962
@zackees

zackees commented Oct 28, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator.

State: ready (not draft), PR CI green — Format 🔍 / checks ✅, Build 🧱 / Fast Gate ⚡ ✅, every other lane skipping exactly as this path-only change expects; 33 checks, 0 failing, mergeStateStatus: CLEAN. Queued on master at position 2 behind #2779.

Local evidence is the RED/GREEN in the body plus ci/local_gate.py --only self-test (== self-test: ok), ruff check on both new files, the 9/9 differential, and precheck's 418 -> 416 header. I did not run the full local gate or stamp HEAD — this PR changes no Rust, C, CMake or build input, and the merge queue re-runs CI on the merge result anyway — so the coordinator does not need to protect a stamp here. Nothing is blocked on a device or a decision.

Merged via the queue into master with commit 3f29f24 Oct 28, 2026
34 checks passed
@zackees
zackees deleted the infra/962-gen-005-sanitizers-steps branch October 28, 2026 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

infra: port the sanitizers workflow's two remaining shell steps to Python (GEN-005, #962)

1 participant