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

Load formulae from their aliases using the API #13871

Merged
merged 1 commit into from Sep 15, 2022

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Sep 15, 2022

Closes #13856

This PR modifies Formulary to handle loading formulae from their alias names via the API. Like the non-api method, I've added a separate AliasAPILoader to handle the additional steps that are necessary when loading from an alias.

In order for this to work best, I've added an all_aliases method to API::Formula. Since retrieving this information requires going through the entire collection of API formulae (including all of their data) I've linked this to all_formulae. So calling one of these methods will load both typical formulae and aliases into their respective instance variables, allowing us to cache both at the same time and eliminate the need to go through a second time.

Finally, this also fixes the issue @MikeMcQuaid reported in Slack where non-core formulae weren't allowed to build from source when trying to use the API.

@Rylan12 Rylan12 added the critical Critical change which should be shipped as soon as possible. label Sep 15, 2022
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

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.

Great work, thanks @Rylan12!

@MikeMcQuaid MikeMcQuaid merged commit c8e1a65 into Homebrew:master Sep 15, 2022
@Rylan12 Rylan12 deleted the alias-api branch September 15, 2022 09:49
@github-actions github-actions bot added the outdated PR was locked due to age label Oct 16, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
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. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aliases are not respected by HOMEBREW_INSTALL_FROM_API?
3 participants