Repository navigation
ci(qt-xml): Port the UI XML validator action to Python (GEN-005, #2724) - #2726
Merged
Merged
Conversation
The three multi-line shell steps of .github/actions/qt-xml-validator/action.yaml (Windows guard, libxml2-utils install, xmllint schema check) become one `uv run --no-project --script` call each into ci/qt_xml_validate.py, so the action's path-scoped GEN-005 exception in ci.toml can go. Same behaviour: the guard prints the notice and exits 2; validate parses the check-changes output, installs libxml2-utils through sudo apt-get only when xmllint is absent, runs `xmllint --schema ... --noout <files>`, and honours --fail-condition never (the action input's default) as the old `set +e` did. Refs #2724
zackees
commented
Oct 28, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
Reviewed. The port matches the deleted shell block and the exception removal is correct.
- Behaviour preserved:
guard --noticestill prints::notice::and exits 2 (the Windows-only step),validateparses thecheck-changesJSON with the old[ ] ' "strip as a fallback, installslibxml2-utilsonly whenxmllintis absent, and--fail-condition neverreturns 0 like the oldset +e. - Command shape you care about here: the three
run:blocks are now single-lineuv run --no-project --script …calls, and the action gained its ownsetup-uvstep (with thesave-cacheexpression and the CACHE-013pr-<N>suffix) above the guard, since the guard now needs uv — the ordering is right, the guard would otherwise run before an interpreter exists. - Path form is safe in this caller:
${{ github.workspace }}is interpolated in aruns-on: ubuntu-latestjob (check-format.yamlchecks), not a container, so the module path resolves. (That form is only wrong inside a container job, as #2702/#2705 found for the Flatpak lane.) - Capability check instead of platform check:
shutil.which('apt-get')keeps LAYOUT-001 out; the module does not referencesys.platform. - Tests:
ci/test_qt_xml_validate.pydrives the module through a stubxmllint/sudo/apt-get(no network, no libxml2), and the RED → GREEN pair is real: 9 failures + 2 errors on master, 14 OK with the port.
Checks: uv run -m workflow.coordinator checks obs-studio 2726 → 32 passed, 0 failed. Queuing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Qt UI XML validator composite action ran three multi-line shell steps, so
ci-lint precheckreported threeGEN-005findings for it and the path-scoped exception inci.tomlcould not leave the baseline until all three were gone. Each step is now oneuv run --no-project --scriptcall intoci/qt_xml_validate.py, and the exception block is deleted.RED → GREEN
8d482e487—ci/test_qt_xml_validate.py,14 tests, 9 failures, 2 errorson master:ci/qt_xml_validate.pyis missing, the action still carriesrun: |blocks, andci.toml:344-349still names the path.5ad9360d1— the module, the action's three one-line steps, and the exception deleted:14 tests … OK.ci-lint precheckon the change (pinneda1917ce)qt-xml-validatorlinesThe first attempt at the GREEN added a
sys.platformcheck andprecheckreportedLAYOUT-001 … references 'sys.platform' outside the platform facade(12 violations, 480 exceptions). The module now asksshutil.which('apt-get')before attempting the install, so the platform decision is capability-based and the violation is gone.Behaviour preserved
guard --notice <text>— the action'sif: runner.os == 'Windows'step: prints::notice::…and exits 2, so an unsupported runner fails before the check.validate --changed-files-json … --schema … --fail-condition …— parses thecheck-changesoutput (a JSON list, with the old shell's[ ] ' "strip as a fallback), installslibxml2-utilsthroughsudo apt-getonly whenxmllintis not onPATH(the deleted install step), and runsxmllint --schema <xsd> --noout <files>.--fail-condition never(the action input's default) returns 0 whateverxmllintsaid — the old block'sset +e. Anything else returns the check's status.korelstar/xmllint-problem-matcherand./.github/actions/check-changessteps are untouched;uses:steps are notGEN-005findings.astral-sh/setup-uvstep with thesave-cacheandpr-<N>cache-suffixexpressions (the shape#2692/#2700used), because the guard now callsuvand a Windows runner has none. The one caller,check-format.yaml:58, is thechecksjob, which already runssetup-uvonubuntu-latest, so no caller changes are needed.Evidence run locally
uv run --no-project ci/local_gate.py --only self-test→== self-test: ok(all 373ci/tests), anduv run ruff checkis clean on both new files.Not verified here
xmllintis not installed on this host and the agent shell has no passwordlesssudo, so thelibxml2-utilsinstall branch is exercised only against a stubapt-get(it must not run whenxmllintis present — pinned bytest_installs_nothing_when_xmllint_is_present). The PR'scheck-formatlane will not run the check either, because nofrontend/forms/**/*.uifile changed; the command it would run is verified above. The schema check itself is byte-for-byte the samexmllintinvocation as before.Fixes #2724