Skip to content

infra: Port the Qt UI XML validator composite action to Python and clear its GEN-005 exception #2724

Closed

Description

@zackees

Unit

.github/actions/qt-xml-validator/action.yaml — the whole action's GEN-005 baseline.

Why it is one unit

ci-lint precheck reports one GEN-005 finding per multi-line shell run: block, and the [[exceptions]] entry is path-scoped, so the action's block in ci.toml only leaves the baseline when every block in the file is gone. The action is also only called from one place, so the whole unit is one PR.

Findings (on origin/master, ci-lint precheck at a1917ce)

Finding Block What it is
1 action.yaml:15-21 Windows runner guard: notice + exit 2
2 action.yaml:23-32 sudo apt-get update + install libxml2-utils on Linux
3 action.yaml:44-58 xmllint --schema … --noout over the changed *.ui files, honouring failCondition

Exception cleared with them: ci.toml:344-349 (rule = "GEN-005", path = ".github/actions/qt-xml-validator/action.yaml").

Coverage of the call sites

  • grep -rn qt-xml-validator --include='*.yaml' . → one caller, .github/workflows/check-format.yaml:58 (Qt XML Check 🖼️, checks job).
  • That job already runs astral-sh/setup-uv (check-format.yaml:39) and every later step is uv run --no-project …, so a Python module is reachable from the action's caller with no environment change.
  • The action is also referenced from its own notice string only; the korelstar/xmllint-problem-matcher and ./.github/actions/check-changes steps stay untouched (uses: steps are not GEN-005 findings).

Shape of the port (precedent: #2692, #2700)

ci/qt_xml_validate.py (#!/usr/bin/env -S uv run --script, standard library only) with two subcommands, each a single uv run --no-project --script line in the action:

  • guard --notice <text> — prints the notice and exits 2, exactly as the shell guard does.
  • validate --changed-files-json '<json>' --schema <path> --fail-condition <never|error> — parses the check-changes output the way the shell did (strip [ ] ' ", split on commas), installs xmllint through sudo apt-get only when shutil.which('xmllint') is empty, runs xmllint --schema … --noout <files>, and returns 0 for --fail-condition never (the action input's default) — the set +e the old block did.

RED / GREEN

  • RED: ci/test_qt_xml_validate.py — fails on master because the module is missing, the action still carries the three shell blocks, and ci.toml still has the GEN-005 block for this path.
  • GREEN: the module, the action's three one-line steps, and the deleted exception. Test also pins the behaviour on a stub xmllint on PATH: argv (--schema, --noout, one argument per file), the JSON-list parsing, the empty-list no-op, and never vs error exit codes.

Not in scope

The xmllint schema itself and frontend/forms/XML-Schema-Qt5.15.xsd — the port reproduces the check, it does not change what it accepts.

Activity

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

    @zackees
    MemberAuthor

    Claiming: investigation

    The issue body above is the recon: three run: blocks (action.yaml:15-21, 23-32, 44-58), one caller (check-format.yaml:58, in a job that already runs setup-uv), and the path-scoped ci.toml:344-349 exception that only clears when all three are gone. No environment change is needed, so it meets the definition of Ready.

  3. added
    needs-investigation
    on Oct 28, 2026
  4. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    /ready

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

    @zackees
    MemberAuthor

    Claiming: GEN-005 qt-xml-validator port

    1. RED: ci/test_qt_xml_validate.py — fails on master (module missing, three shell blocks in the action, ci.toml:344-349 block present).
    2. GREEN: ci/qt_xml_validate.py (guard / validate), the action's three steps as one-line uv run --no-project --script calls, and the GEN-005 exception deleted.
    3. PR against master, unmerged. First PR in this tick.
  7. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    PR #2726 implements this unit.

    • RED 8d482e487: ci/test_qt_xml_validate.py, 14 tests / 9 failures / 2 errors on master (module missing, three run: | blocks, exception present).
    • GREEN 5ad9360d1: ci/qt_xml_validate.py, the action's three one-line uv run --no-project --script steps, and the ci.toml exception deleted. precheck: 483 → 480 approved exceptions, violations unchanged at 11, no qt-xml-validator line left; ci/local_gate.py --only self-test is green (373 tests).

    The first GREEN attempt tripped LAYOUT-001 on a sys.platform check; the module now decides on shutil.which('apt-get') instead.

  8. zackees commented on Oct 28, 2026

    @zackees
    MemberAuthor

    Merged on master as fc0352611 (#2726). The action's three shell steps are now uv run --no-project --script ci/qt_xml_validate.py guard|validate, and its GEN-005 exception is gone: precheck 483 → 480 approved exceptions, violations unchanged at 11, no qt-xml-validator finding left.

    Nothing else is outstanding on this unit. The remaining GEN-005 baseline in this family is the other composite actions (run-swift-format, steam-upload, setup-macos-codesigning, windows-analysis, windows-signing, build-obs, package-obs) — each its own path-scoped unit.

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