Skip to content

Comments

bottle_specification: throw exception instead of panicking to be able to catch it#21595

Merged
botantony merged 3 commits intomainfrom
fix-21582
Feb 22, 2026
Merged

bottle_specification: throw exception instead of panicking to be able to catch it#21595
botantony merged 3 commits intomainfrom
fix-21582

Conversation

@botantony
Copy link
Member

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Copilot AI review requested due to automatic review settings February 19, 2026 10:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #21582 by detecting legacy bottle sha256 DSL usage and preventing it from aborting formula auditing when walking historical revisions.

Changes:

  • Add a new LegacyDSLError exception type to represent legacy DSL usage.
  • Detect the legacy bottle sha256 hash-rocket form in BottleSpecification#sha256 and raise LegacyDSLError.
  • Update FormulaAuditor#committed_version_info to rescue LegacyDSLError while traversing historical formula revisions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
Library/Homebrew/formula_auditor.rb Rescues LegacyDSLError during committed-version history traversal.
Library/Homebrew/exceptions.rb Introduces LegacyDSLError exception class.
Library/Homebrew/bottle_specification.rb Expands sha256 signature and raises LegacyDSLError on legacy DSL usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good once comment addressed, thanks @botantony!

Before merging: please improve both the commit message and PR title/body so it's more apparent what's being done and why.

botantony and others added 3 commits February 22, 2026 12:08
… to catch it

Signed-off-by: botantony <antonsm21@gmail.com>
Signed-off-by: botantony <antonsm21@gmail.com>
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@botantony botantony changed the title Fix #21582 bottle_specification: throw exception instead of panicking to be able to catch it Feb 22, 2026
@botantony botantony added this pull request to the merge queue Feb 22, 2026
Merged via the queue into main with commit 72855d8 Feb 22, 2026
37 checks passed
@botantony botantony deleted the fix-21582 branch February 22, 2026 14:07
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.

2 participants