Skip to content

ci: One Python call runs each compatibility validator step (GEN-005, #2692) - #2694

Merged
zackees merged 2 commits into
masterfrom
infra/2692-compatibility-validator-python
Oct 27, 2026
Merged

zackees merged 2 commits into
masterfrom
infra/2692-compatibility-validator-python

Conversation

@zackees

@zackees zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member

Closes #2692.

.github/actions/compatibility-validator/action.yaml carried two multi-line run: blocks, so it produced two GEN-005 findings (the exception is path-scoped: the block leaves ci.toml only when both are gone).

RED dea36b6ba — the test only

ci/test_compatibility_validator.py, 15 tests: 11 failures + 2 errors on this commit (the module does not exist, both steps are still run: | blocks, and the GEN-005 exception is still in ci.toml).

It pins:

  • guard: prints ::notice::<reason> and exits 2, and --notice is required;
  • validate: the checker's status for a valid file (0), a property-level schema violation (1, plus validation_errors.json written for the annotations step) and a missing file (2), against real fixtures with a local schema;
  • the checked-in plugins/win-capture/data/compatibility.json and package.json both pass;
  • the run is bracketed by ::group::Schema Validation / ::endgroup::;
  • the action: one line per run:, no shell control syntax, astral-sh/setup-uv installed before both calls, the module path absolute so a custom workingDirectory still resolves it, and the schema step keeps its working-directory;
  • no GEN-005 [[exceptions]] block left for the action.

GREEN a38b4c73b — the port

ci/compatibility_validate.py (#!/usr/bin/env -S uv run --no-project --script, standard library only):

step before after
Windows guard echo + exit 2 shell block … guard --notice "…"
schema check ::group:: + shopt -s extglob + uv run --no-project --with jsonschema --with json_source_map .github/scripts/utils.py/check-jsonschema.py … '@(compatibility|package).json' … validate plugins/win-capture/data/compatibility.json plugins/win-capture/data/package.json

Two deliberate differences, both visible in the diff:

  1. Set Up uv moves above the guard. The guard used to run first as plain shell; it now calls uv, which a Windows runner does not have on its own. It still fails an unsupported runner (exit 2 + notice) before the check runs.
  2. The @(compatibility|package) extglob becomes two explicit paths (and shopt -s extglob goes with it). The checker, its two --with dependencies, --loglevel INFO, PYTHONUNBUFFERED=1 and the ::group:: brackets are all unchanged.

Evidence

  • ci/test_compatibility_validator.py: 15 OK on GREEN.
  • ci-lint precheck (uvx --from git+…ci.yml@a1917ce7 ci-lint precheck) before: 11 violation(s), 489 approved exception(s), 10 needs_review → after: 11 violation(s), 487 approved exception(s), 10 needs_review, no compatibility-validator finding left.
  • ci/test_ci_toml.py 41 tests OK, ci/test_uv_run.py 5 tests OK, ruff check clean.
  • Callers are .github/workflows/ci.yml (Validate Data 🕵️) and .github/workflows/push.yaml (Validate Data 🕵️), both on a Linux runner with the action's own setup-uv, so PR CI exercises the check path for real.
  • No docs/features.md line: build tooling only.

Noticed, left alone: the guard's notice text says "services-validation action requires a macOS-based or Linux-based runner." (copied from services-validator), and the checker logs a root-level violation (a missing required key) without exiting non-zero — it only records violations whose absolute_path is non-empty. Both are pre-existing.

…-005, #2692)

RED: the module does not exist, both `run:` steps in
`.github/actions/compatibility-validator/action.yaml` are still shell blocks,
and the GEN-005 [[exceptions]] block is still in ci.toml. 11 failures + 2
errors on master.
…2692)

`compatibility-validator/action.yaml` carried two multi-line `run:` blocks --
the Windows runner guard and the schema check -- so it produced two GEN-005
findings, and the exception is path-scoped: the block leaves ci.toml only when
both are gone.

`ci/compatibility_validate.py` (stdlib only, `uv run --no-project --script`)
now serves both steps: `guard --notice` prints the notice and exits 2 (the
action's own `if: runner.os == 'Windows'` selects it), and `validate <files>`
runs `.github/scripts/utils.py/check-jsonschema.py` through
`uv run --no-project --with jsonschema --with json_source_map`, returning its
status inside `::group::Schema Validation`/`::endgroup::`.

Two visible changes: `Set Up uv` moves above the guard (the guard now calls
uv, which a Windows runner has not installed on its own), and the two files
are named explicitly in place of the `@(compatibility|package)` extglob --
`shopt -s extglob` was the step's only shell dependency.

GREEN: ci/test_compatibility_validator.py 15 OK (RED was 11 failures + 2
errors on the test-only commit), ci/test_ci_toml.py 41 OK,
ci/test_uv_run.py 5 OK, ruff clean, `ci-lint precheck` 489 -> 487 approved
exceptions with no compatibility-validator finding left.
@zackees

zackees commented Oct 27, 2026

Copy link
Copy Markdown
Member Author

Handed off to the coordinator. All checks green, queued to merge (gh pr merge --auto). Local evidence: ./lint ok, ci/test_compatibility_validator.py 15 OK, ci/test_ci_toml.py 41 OK, ci/test_uv_run.py 5 OK, ruff clean, ci-lint precheck 489 -> 487 approved exceptions.

Merged via the queue into master with commit b56bc8d Oct 27, 2026
32 checks passed
@zackees
zackees deleted the infra/2692-compatibility-validator-python branch October 27, 2026 21:10
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 compatibility-validator's two shell steps to Python and clear its GEN-005 exception

1 participant