fix(ci): keep appcast history when a previous release has no assets - #492
Merged
Conversation
The appcast merged items from whichever release was most recent, which is empty when that release's build failed. The download then failed silently and the new appcast shipped with only its own item, dropping the history the Homebrew update popover reads. This happened for 0.1.78, whose appcast lost 76 items. Walks back through recent releases until one actually yields an appcast, and warns rather than truncating quietly if none does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HzGnpFC9q8ydDPD8ygabKv
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.
Problem
The appcast step merges items from a previous release so the Homebrew update
popover keeps its history. It picked the most recent release other than the one
being built:
If that release has no assets, the download fails,
|| trueswallows it, andgenerate_appcast.pyguards onos.path.exists, so the build happily publishesan appcast containing only its own item.
That is not hypothetical: it happened on 0.1.78. Its build ran after 0.1.77,
whose build had failed and left the release empty, so the published 0.1.78
appcast has exactly 1 item where it should have had 77.
Sparkle updates still work, since only the newest item matters for updating.
What breaks is the version history.
Fix
Walk back through recent releases until one actually yields an appcast, and emit
a warning instead of truncating silently if none does.
Verification
Ran the new loop against this repository with
TAG_NAME=v0.1.78:It skips the empty v0.1.77 and recovers the history. The old code stopped at
v0.1.77 and carried nothing.
Note this does not retroactively repair the 0.1.78 appcast. The next release
picks up the history again, because v0.1.78 does have an
appcast.xmlasset, soit self-heals from here.