Skip to content

promotion-gate: detect available 7z binary instead of hardcoding 7zz - #149

Merged
mdheller merged 1 commit into
mainfrom
fix/promotion-gate-7z-binary-detect
Aug 4, 2026
Merged

promotion-gate: detect available 7z binary instead of hardcoding 7zz#149
mdheller merged 1 commit into
mainfrom
fix/promotion-gate-7z-binary-detect

Conversation

@mdheller

@mdheller mdheller commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

First real production run of promotion-gate.yml (on v150.0.6 release-publish) 127'd on the Info.plist step: 7zz: command not found. The 7zip apt package (binary 7zz) only exists on Ubuntu 24+; ubuntu-latest is currently 22.04 where the correct package is p7zip-full (binary 7z).

Result: gate rejected a good v150.0.6 artifact for the wrong reason (my local pre-verify confirmed CFBundleShortVersionString: 150.0.6 correctly). /latest correctly reverted to v150.0.5 — the quarantine-on-failure path itself worked.

Fix

Install p7zip-full (stable across all runner versions) and detect whichever 7z-family binary is available (7z, 7zz, 7za). Adds set -eo pipefail and better error output on the plist-not-found path so a future failure surfaces the DMG structure instead of a mystery exit.

Meta-lesson

Gates that catch bug classes must themselves be exercised — my local pre-verify caught plist=150.0.6 correctly, but this CI-side check had never actually run against a real DMG. First real run is when you find the bug. Follow-up: smoke-test promotion-gate.yml against a fixture DMG in a PR-time job so future edits don't wait for a release to prove themselves.

v150.0.6's first promotion-gate run 127'd on the Info.plist step because
'7zz: command not found' — the '7zip' apt package (binary 7zz) only exists
on Ubuntu 24+; ubuntu-latest is currently 22.04 where the correct package
is p7zip-full (binary 7z). Gate rejected a good artifact for the wrong
reason.

Fix: install p7zip-full (stable across runner versions) and detect
whichever 7z-family binary is available. Also propagates 'set -eo pipefail'
+ better error output on plist-not-found so a future failure surfaces the
DMG structure instead of a mystery 1.

Meta-lesson (encoding in the diff comment): gates that catch bug classes
must themselves be exercised — my local pre-verify caught the plist=150.0.6
correctly, but this CI-side check had never actually run against a real
DMG. First real run is when you find the bug. Add promotion-gate to
packaging-and-update-tests.yml's stanza so future edits smoke it against
a fixture DMG. Follow-up.
@mdheller
mdheller merged commit 940fcf2 into main Aug 4, 2026
17 checks passed
@mdheller
mdheller deleted the fix/promotion-gate-7z-binary-detect branch August 4, 2026 07:02
mdheller added a commit that referenced this pull request Aug 4, 2026
…binary plist) (#150)

Second false-negative from promotion-gate.yml: first run 127'd on missing
7zz (#149 fixed that), second run extracted the DMG fine but reported
empty version because:

  - Info.plist in a real DMG is a BINARY plist, not XML
  - plistutil (libplist-utils) was supposed to convert it to XML but
    silently failed (its '2>/dev/null' swallowed the error)
  - The fallback 'cp' put the binary blob at /tmp/plist.xml
  - grep matched (binary file matches) but sed on binary yielded ''
  - Version comparison: '' != '150.0.6' → gate quarantined a good release

Use Python's plistlib instead. Handles binary AND XML formats natively,
zero extra deps (Python 3 is on every ubuntu-latest runner).

Meta-lesson (again): a two-step tool chain where the first step's failure
is silenced becomes a two-step tool chain where you cannot tell which
step failed. Both '2>/dev/null' fallbacks in this gate have now bitten
us. Removing libplist-utils entirely closes the class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant