fix: release verify step fails on headless CI #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/release-verify-headless"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix: release verify step fails on headless CI
The release pipeline's verify step ran
zai-tray-checker --version, which importsmain.py→from PySide6.QtCore import ...at module level. On the headless Debian runner (nolibGL), this crashes withModuleNotFoundError: No module named 'PySide6'because--no-depsskipped installing PySide6.Fix
Changed the verify step to read version from wheel metadata via
importlib.metadata.version()instead of running the CLI entry point. This doesn't importmain.pyat all, so no PySide6 or system GL libs are needed.Also added
@pyside6_requiredskipif guard to the two subprocess-based version tests intest_version.pyso CI doesn't fail there either.70 tests passing.
🤖 Hermes automated review: changes requested
Reviewed the full diff (39 additions, 3 deletions, 2 files) for the headless-CI release verify fix. The direction (read version from wheel metadata via
importlib.metadata.version()instead of importingmain.py) is correct, and the@pyside6_requiredskipif guards are a good addition. However, the verify step as written will fail on every release run due to a cross-step variable scoping bug.🔴 Major (blocking)
1.
$TAGis step-scoped and will be empty in the verify step — assertion always fails —.forgejo/workflows/release.yml:60env:declared under a step makes$TAGavailable only within that step's shell. It is not persisted to subsequent steps (therun:blocks run in separate shell processes, and nothing is written to$GITHUB_ENV). So in the verify step${TAG#v}expands to the empty string'', and the assertion becomesassert v == ''— which fails for any non-empty version, e.g.AssertionError: Version mismatch: wheel=1.0.0, expected=. This swaps the original PySide6 import crash for a guaranteed assertion failure on every release.Suggested fix — either persist
VERSIONto$GITHUB_ENVin the extract step, or pass the tag down via the verify step's ownenv:. The cleanest is to repeat the source-of-truthenv:on the verify step (same pattern the extract step already uses):(Alternatively, add
echo "TAG=$TAG" >> "$GITHUB_ENV"in the extract step so it's available to all later steps as$TAG.)⚠️ Note: the
release.ymlworkflow only triggers onrelease: published, so CI (theci.ymlworkflow that runspyteston PRs) will not exercise this path. The bug won't be caught before the next release unless the release workflow is run manually or the line is fixed directly.What looks good
importlib.metadata.version()avoids importingmain.py→ no PySide6 / libGL dependency for the verify step. Correct and minimal fix for the original problem.--no-depsinstall is appropriate here since you only need the metadata, not the runtime deps._can_import_pyside6()helper intest_version.pycorrectly probes the C++ extensions (QtCore+QtGui), not just the Python package presence.test_version_in_wheel_metadatais a good new test that mirrors the CI verify logic and runs without PySide6.Verification
ci.ymlrunspyteston PRs to main, but no CI result comment exists yet for headf0267ecb(PR just opened, 0 comments). Per CI-absent policy, ran tests locally.python3 -m pytest tests/ -q→ 70 passed in 1.93s (including the 2 PySide6-guarded subprocess version tests, which ran here since PySide6 is importable in this sandbox).Automated daily review. I never merge PRs.
The $TAG variable was only available in the 'Extract version from tag' step. The verify step referenced ${TAG#v} but TAG was empty there, making the assertion always fail with 'expected='. Now the verify step has its own env: TAG declaration.Good catch — that's a real blocking bug.
$TAGwas step-scoped to the "Extract version from tag" step, so${TAG#v}in the verify step would expand to an empty string, making the assertion always fail.Fixed in
5289cb1: addedenv: TAG: ${{ github.event.release.tag_name }}to the verify step directly, so it has its own copy of the tag name.70 tests still passing.
🤖 Hermes automated review: no blocking issues found
Follow-up review of fix commit
5289cb1(head changedf0267ecb→5289cb1, force-push after priorchanges_requested).The one blocking finding from the previous review is resolved, and no new issues were introduced.
✅ Prior major finding — resolved
$TAGstep-scoped →${TAG#v}empty in verify step —.forgejo/workflows/release.ymlPreviously the verify step had no
env:of its own, so${TAG#v}expanded to''and the assertionassert v == ''failed on every release. The fix adds the same source-of-truth env directly to the verify step:Verified at head:
TAGnow appears on both the extract step (line 24) and the verify step (line 53).${TAG#v}in the verify step will now correctly strip the leadingv. ✅What still looks good (unchanged from prior review)
importlib.metadata.version()avoids importingmain.py→ no PySide6 / libGL dependency for the verify step. Correct minimal fix for the original headless-CI crash.--no-depsinstall is appropriate (only metadata needed)._can_import_pyside6()helper probes the C++ extensions (QtCore+QtGui), not just package presence.test_version_in_wheel_metadatamirrors the CI verify logic and runs without PySide6.Verification
ci.ymlrunspyteston PRs to main, but no CI result comment exists yet for head5289cb1. Therelease.ymlworkflow (where this fix lives) only triggers onrelease: published, so CI does not exercise this path. Per CI-absent policy, ran tests locally.python3 -m pytest tests/ -qat head5289cb1→ 70 passed in 0.77s (all 4 version tests, including the 2 PySide6-guarded ones which ran since PySide6 is importable in this sandbox).Automated daily review. I never merge PRs.