Skip to content

ci: One Python call runs each Flatpak manifest validator step (GEN-005) - #2688

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

zackees merged 2 commits into
masterfrom
infra/flatpak-manifest-validator-python

Conversation

@zackees

@zackees zackees commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Closes #2687.

.github/actions/flatpak-manifest-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 3b08bf81 — the test only

ci/test_flatpak_manifest_validator.py, 16 tests: 13 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 formatter's status is the step's status, except under --fail-condition never (the old set +e), against real manifest fixtures — formatted, unformatted, missing, and the checked-in default;
  • the run is bracketed by ::group::Run 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;
  • no GEN-005 [[exceptions]] block left for the action.

GREEN 6c5dc66e — the port

ci/flatpak_manifest_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 "…"
manifest check ::group:: + if … set +e + uv run build-aux/format-manifest.py … validate --manifest … --fail-condition ${{ inputs.failCondition }}

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 : Validate Flatpak Manifest 🕵️ / : Check Runner … echo labels are dropped from the two run: bodies, since the step names already carry them.

Evidence

  • ci/test_flatpak_manifest_validator.py: 16 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 flatpak-manifest-validator finding left.
  • ci/test_ci_toml.py 41 tests OK, ci/test_uv_run.py 5 tests OK, ruff check clean.
  • Sole caller is .github/workflows/check-format.yaml (Format 🔍 / checks, failCondition: error), so PR CI exercises both scripts for real.
  • No docs/features.md line: build tooling only.

Noticed, left alone: the manifestFile input is declared but unused (the path is hard-coded), and the guard's notice text says "services-validation action" (copied from services-validator).

…refs #2687)

RED: the action's two steps are still multi-line `run: |` blocks, the
module does not exist, and ci.toml still carries the action's GEN-005
exception. 16 tests; 13 failures + 2 errors on this commit.
…5, refs #2687)

`ci/flatpak_manifest_validate.py` does what the action's two shell blocks
did: `guard` prints the notice and exits 2 for an unsupported runner, and
`validate` runs `build-aux/format-manifest.py --check`, returning its
status unless `failCondition` is `never` (the old `set +e`). Set Up uv
moves above the guard, since the guard now calls `uv`.

The action's GEN-005 exception is deleted: `ci-lint precheck`
489 -> 487 approved exceptions, same 11 violations, no finding left.
@zackees
zackees marked this pull request as ready for review October 27, 2026 20:45
@zackees
zackees added this pull request to the merge queue Oct 27, 2026
Merged via the queue into master with commit 7f35882 Oct 27, 2026
32 checks passed
@zackees
zackees deleted the infra/flatpak-manifest-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 Flatpak manifest validator's two shell steps to Python and clear its GEN-005 exception

1 participant