promotion-gate: use plistlib for CFBundleShortVersionString - #150
Merged
Conversation
…binary plist) 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.
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.
Second false-negative from promotion-gate.yml. First run 127'd on missing 7zz (#149 fixed that). Second run — this one — extracted the DMG fine but reported empty version:
Info.plistin a real DMG is a BINARY plist, not XMLplistutilwas supposed to convert but silently failed (its2>/dev/nullswallowed the error)cpput the binary blob at/tmp/plist.xmlgrepmatched (binary file matches) butsedyielded empty'' != '150.0.6'→ gate quarantined a good releaseFix
Python's
plistlib— handles binary AND XML formats natively, zero extra deps. Removes libplist-utils entirely.Meta-lesson
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/nullfallbacks in this gate have now bitten us. Follow-up will smoke-test the gate against a fixture DMG on PR time (already documented in #149's commit).