Skip to content

infra: Port the Flatpak manifest validator's two shell steps to Python and clear its GEN-005 exception #2687

Closed

Description

@zackees

Gap

ci-lint precheck reports two GEN-005 findings on
.github/actions/flatpak-manifest-validator/action.yaml:

[GEN-005] APPROVED EXCEPTION .github/actions/flatpak-manifest-validator/action.yaml
    what:  runs.steps[0]: run: step violates the shell budget (more than one line)
[GEN-005] APPROVED EXCEPTION .github/actions/flatpak-manifest-validator/action.yaml
    what:  runs.steps[2]: run: step violates the shell budget (more than one line; control syntax (;); leading if/for/while)
  • steps[0] is the Windows runner guard: echo the reason, exit 2.
  • steps[2] is the manifest order check: ::group::, an if [[ ... == never ]] that
    turns set +e on, PYTHONUNBUFFERED=1 uv run --no-project build-aux/format-manifest.py build-aux/io.github.obs_rust.OBSStudioRust.json --check --loglevel INFO, ::endgroup::.

The exception is path-scoped, so the action's block leaves the baseline only when
both steps are one call each.

Call sites

Caller Inputs used
.github/workflows/check-format.yaml (Format 🔍 / checks) failCondition: error

The action installs its own pinned astral-sh/setup-uv (with the CACHE-013 pr-<N>
cache-suffix), so the port needs nothing from the caller. The guard step used to run
before that install, which is why it could be plain shell; a port that calls uv has
to install the toolchain first, so Set Up uv moves above the guard and the guard still
fails an unsupported runner before the check runs.

Work

  • ci/flatpak_manifest_validate.py (uv run --no-project --script, standard library only)
    with two subcommands: guard --notice … (print the notice, exit 2 — the action's own
    if: runner.os == 'Windows' still selects it) and validate --manifest … --fail-condition …
    (run build-aux/format-manifest.py --check, return its status unless the condition is
    never, bracketing the output in ::group::/::endgroup::).
  • Both run: steps become one line each; --manifest and --fail-condition carry the
    values the step hard-coded and the failCondition input.
  • ci/test_flatpak_manifest_validator.py pins the guard's notice and exit code, the four
    fail-condition outcomes against real manifest fixtures (formatted, unformatted, missing,
    default), the group annotations, the action's one-line steps with uv installed before
    both calls, and the absence of the GEN-005 [[exceptions]] block.
  • The GEN-005 exception for the action is deleted with the port.

Noticed while porting, left alone: the action's manifestFile input is declared but unused
(the path is hard-coded), and the guard's notice text says "services-validation action"
because the block was copied from services-validator. Both are pre-existing.

Evidence

  • ci/test_flatpak_manifest_validator.py: 16 tests — RED 13 failures + 2 errors on
    origin/master, GREEN 16 OK.
  • 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 (the block carries two findings).
  • ci/test_ci_toml.py 41 tests OK, ci/test_uv_run.py 5 tests OK, ruff check clean.
  • No docs/features.md line: build tooling only.

Activity

  1. added
    infra
    ready
    on Oct 27, 2026
  2. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: the Flatpak manifest validator shell-budget port.

    Plan (one PR, two commits, local RED evidence):

    1. RED 3b08bf817: ci/test_flatpak_manifest_validator.py pins both steps — 16 tests, 13 failures + 2 errors on origin/master (module absent, both run: | blocks still there, GEN-005 block still in ci.toml).
    2. GREEN 6c5dc66eb: ci/flatpak_manifest_validate.py (guard / validate subcommands) makes each step one uv run --no-project --script line, Set Up uv moves above the guard, and the ci.toml GEN-005 block is deleted. ci-lint precheck 489 -> 487 approved exceptions, same 11 violations, no finding left; ci/test_ci_toml.py 41 OK, ci/test_uv_run.py 5 OK, ruff check clean.

    One behaviour note for review: the guard step now runs after Set Up uv (it calls uv, which a Windows runner does not have on its own). It still exits 2 before the check. PR opens now.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Opened #2688 (branch infra/flatpak-manifest-validator-python, base master, 2 commits): RED 3b08bf81 (16 tests, 13 failures + 2 errors), GREEN 6c5dc66e (16 OK, ci-lint precheck 489 -> 487 approved exceptions, no finding left). Watching Format 🔍 / checks through PR CI — it is the job that runs both scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

infraready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions