Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass original tap to formula when loaded from the API via TapLoader #16216

Merged
merged 4 commits into from Nov 13, 2023

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Nov 13, 2023

  • 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 style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Fixes #16213

Follow-up to #16207

Supercedes #16215

This PR fixes the TapLoader refactoring to properly pass the old tap to the newly created formula, even though it is referencing the new formula file. This is consistent with the old behavior. This also fixes the newly-created issue where migrating to a different non-core tap but with the same name as a core tap incorrectly chooses the core formula.

Finally, this PR adds some more tests.

CC @MikeMcQuaid, @Bo98, and @amancevice

@Rylan12 Rylan12 added critical Critical change which should be shipped as soon as possible. install from api Relates to API installs labels Nov 13, 2023
@Rylan12 Rylan12 mentioned this pull request Nov 13, 2023
7 tasks
@Bo98
Copy link
Member

Bo98 commented Nov 13, 2023

This PR fixes the TapLoader refactoring to properly pass the old tap to the newly created formula, even though it is referencing the new formula file. This is consistent with the old behavior.

Makes sense to fix as it was before, but why does it behave this way? Seems really odd to have a formula in homebrew/core have a .tap point to something not-core.

@Bo98
Copy link
Member

Bo98 commented Nov 13, 2023

formula_name_path not returning the updated tap is very likely an error I made in 44f058e

Co-authored-by: Alexander Mancevice <alexander.mancevice@hey.com>
@Rylan12
Copy link
Member Author

Rylan12 commented Nov 13, 2023

Yeah, agreed it seems odd to intentionally use an old tap. I've pushed a fix. @amancevice this means your original fix was good. I've included it here for simplicity sake but have added you as a co-author. Thank you for submitting the original fix!

@amancevice
Copy link
Contributor

very sporting of you @Rylan12 — cheers 🍻

Library/Homebrew/formulary.rb Outdated Show resolved Hide resolved
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.

Thanks @Rylan12!

@MikeMcQuaid MikeMcQuaid merged commit 8f49b3a into Homebrew:master Nov 13, 2023
27 checks passed
@Rylan12 Rylan12 deleted the api-tap-loader-fix branch November 14, 2023 00:09
@github-actions github-actions bot added the outdated PR was locked due to age label Dec 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. install from api Relates to API installs outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

brew install not respecting tap when formula name collides with core
5 participants