Fix spurious test-bot missing :all bottle warning#23019
Merged
Conversation
Signed-off-by: Patrick Linnane <patrick@linnane.io>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts test-bot’s annotate_missing_all_bottle warning logic to avoid false positives on per-platform CI jobs by aligning the predictor’s gating conditions with the ones used when brew bottle --merge determines whether an :all bottle can be (re)created.
Changes:
- Update
annotate_missing_all_bottleto short-circuit when analltag is already present locally, when there’s only a single local bottle JSON, or when local tag hashes share the same(cellar, sha256)pair (indicating an:allbottle can be formed). - Add
local_bottle_tag_hashesto aggregate local bottle JSONs and normalize top-level"cellar"into per-tag hashes. - Expand unit tests to cover the new gating behavior (local
allpresent, single-platform JSON, differing cellars, and convergent platform bottles).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Library/Homebrew/test_bot/formulae.rb | Refines the “missing :all bottle” annotation predictor to use merge-equivalent gates and adds a helper to aggregate/normalize local bottle JSON tag data. |
| Library/Homebrew/test/test_bot/formulae_spec.rb | Refactors test setup and adds coverage for the new annotation gating scenarios to prevent per-runner false positives. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 test-bot "missing
:allbottle" warning misfired on every per-platform job of Homebrew/homebrew-core#291991 (webfont 12.5.0): each job saw only its own platform's bottle JSON and warned, even though the finalbrew bottle --mergethen created a new:allbottle because the generated checksums and cellars matched.annotate_missing_all_bottlenow mirrors the gatesbrew bottle --mergeactually uses to decideall_bottle, so it only warns when the final merge genuinely cannot recreate one. It stays quiet when the formula already has anall:stanza, when a localallbottle JSON is present, when only one platform JSON exists (a single runner cannot know what the multi-platform merge will produce), and when every local tag hash shares one cellar and checksum. A newlocal_bottle_tag_hasheshelper collects the local JSONs and normalizes the top-level"cellar"into each per-tag hash to match the shape the merge builds.The annotation is informational and never blocks merge, and the authoritative "should have had an
:allbottle" check still runs in the finalbrew bottle --merge, so this only trims false positives from the per-runner heads-up.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Opus 4.8) developed the fix and tests; I reviewed the diff and verified with
brew lgtmplus targetedtest_bot/formulaespecs.