Skip to content

infra: Port the flatpak-builder-lint composite action to Python (GEN-005 burn-down) #2700

Closed

Description

@zackees

Summary

.github/actions/flatpak-builder-lint/action.yaml is one of the 56 paths still carrying a
GEN-005 approved exception ("CI logic must live in Python, not shell/batch/PowerShell"). The
action contains two inline run: blocks — an artifact-type guard and the lint invocation with
its jq-based annotation parser:

Step Lines Logic
Check artifact type 15-22 bash =~ guard over builddir|repo|manifest|appstream, ::error:: + exit 2
Run flatpak-builder-lint 27-75 runs flatpak-builder-lint --exceptions --user-exceptions … capturing exit code, then a two-stage jq pipeline turning the JSON warnings/errors arrays into ::warning::/::error:: annotations,with the appstream short-circuit and exit ${return}

Three call sites, all in build-project.yaml's flatpak-build job (manifest, appstream,
builddir, repo): lines 831, 949, 962 on master. That job sets up
astral-sh/setup-uv (line 816) before the action runs, on the host runner (a composite uses:
runs on the runner, not inside the flatpak container), so the action can call uv.

Evidence

uvx --from git+https://github.com/zackees/ci.yml@a1917ce76598904ce515cd7eec83450c317ea6f2 ci-lint precheck
on master 1369daf30:

ci-lint precheck: 11 violation(s), 485 approved exception(s), 10 needs_review
== GEN-005 (245) ==
[GEN-005] APPROVED EXCEPTION .github/actions/flatpak-builder-lint/action.yaml   (x2)

Plan (one PR)

  1. RED — ci/test_flatpak_builder_lint.py (stdlib only, #!/usr/bin/env -S uv run --script):
    • asserts the action has no inline run: block left and each remaining step is uv run --no-project ci/flatpak_builder_lint.py …;
    • drives the module on stubs: artifact-type validation accepts the four kinds and rejects others with exit 2, a stubbed flatpak-builder-lint returning warnings/errors yields the exact ::warning::/::error:: lines (including the found in the Flatpak <artifact> suffix), an empty body with a non-zero exit is the "Error while running" exit 2, and the appstream artifact prints the raw body and returns the tool's exit code.
  2. GREEN — ci/flatpak_builder_lint.py with guard and lint subcommands; action.yaml repointed at it with uv run --no-project; the [[exceptions]] block in ci.toml deleted.
  3. Verify: the new test fails on master and passes after the change; ci-lint precheck's GEN-005 count drops by 2 with no new finding; the flatpak job's step semantics preserved (same annotations, same exit codes).

Not in scope: the other four .github/actions/* run-block exceptions (package-obs, build-obs,
steam-upload, setup-macos-codesigning, windows-*) — separate units.

Refs #962 (closed tracker; this is one of the ~245 remaining GEN-005 exceptions).

Activity

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

    @zackees
    MemberAuthor

    Claiming: investigation

    Recon done while filing: both run: blocks are self-contained (a =~ guard and a flatpak-builder-lint call plus a two-stage jq annotation pipeline), the three call sites are flatpak-build steps in build-project.yaml (831, 949, 962) and that job has astral-sh/setup-uv before the action. Closing the two GEN-005 findings needs both blocks converted, since the exception is path-scoped.

  3. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    /ready

    Definition of Ready: scope is one composite action; the acceptance is mechanical (no inline run: in the action, same annotations and exit codes, GEN-005 count -2); no open design question; one PR.

  4. added
    needs-investigation
    on Oct 27, 2026
  5. added
    ready
    and removed
    needs-investigation
    on Oct 27, 2026
  6. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Claiming: port the flatpak-builder-lint action to Python

    1. RED: ci/test_flatpak_builder_lint.py — fails on master (inline run: blocks present, module missing).
    2. GREEN: ci/flatpak_builder_lint.py (guard, lint), action.yaml repointed at uv run --no-project, ci.toml GEN-005 block removed, precheck GEN-005 count 245 -> 243.
    3. First PR today; the flatpak lane cannot run from PR CI, so the RED/GREEN evidence is the module-level test plus the differential run of the old run: blocks against the new module on the same fixtures.
  7. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    PR: #2702 — ci/flatpak_builder_lint.py (guard, lint), the action repointed at uv run --no-project, the GEN-005 exception block removed.

    RED 9e34df047 (ci/test_flatpak_builder_lint.py, 10 failures on master), GREEN f433806e0. ci-lint precheck 485 -> 483 approved exceptions (GEN-005 245 -> 243), 11 violations unchanged.

    One behavioural finding from the differential run of the old block against the module: the old jq filter interpolated ${template} inside a single-quoted program, so every annotation ended with the literal text ${template}. The port emits the intended found in the Flatpak <artifact> suffix; that is pinned by the test.

  8. zackees commented on Oct 27, 2026

    @zackees
    MemberAuthor

    Landed as #2702 (squash c96cd57d0). What changed:

    • ci/flatpak_builder_lint.py (guard, lint; stdlib only) replaces both inline run: blocks;
    • .github/actions/flatpak-builder-lint/action.yaml calls it as uv run --no-project, no shell left;
    • the path's [[exceptions]] block is gone; ci-lint precheck 485 -> 483 approved exceptions, violations unchanged at 11;
    • PR CI CI Gate ✅ green, and the full local gate passed (./lint ok, ./unittest: rust-test ok, tier2-linux ok, 587/587 cmake tests).

    Latent bug fixed on the way: the old jq filter interpolated ${template} inside a single-quoted program, so every annotation ended with the literal text ${template} instead of found in the Flatpak <artifact>. Pinned by ci/test_flatpak_builder_lint.py.

    Left for other units: the remaining GEN-005 exception paths (package-obs, build-obs, steam-upload, setup-macos-codesigning, windows-*, the zsh .github/scripts/*, the lint/unittest shims).

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