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

Remove Github code search from brew search #15107

Closed
1 task done
apainintheneck opened this issue Mar 31, 2023 · 5 comments · Fixed by #15209
Closed
1 task done

Remove Github code search from brew search #15107

apainintheneck opened this issue Mar 31, 2023 · 5 comments · Fixed by #15209
Labels
features New features help wanted We want help addressing this outdated PR was locked due to age

Comments

@apainintheneck
Copy link
Contributor

apainintheneck commented Mar 31, 2023

Verification

Provide a detailed description of the proposed feature

Remove Github code search from our codebase and replace it with the Homebrew API. We only use this internally to search for formulas and casks with the brew search command and we already have that command set up to use the API right now for the core formula and cask repos.

The Search.search_taps and Github.search_code code should be removed. This will mean that we don't show casks that are not in the default cask repo in search results. This is less than ideal but can be handled in a few different ways. Either those repos can be merged together which is something we've already discussed in a few different places or we can add those to the API. The other option, of course, would be to just omit those from search results entirely unless you've tapped those repos.

What is the motivation for the feature?

The idea here is that this doesn't work consistently unless you're using your own token and even in that case it's still inconsistent. This results in an extra network request for users that frequently doesn't return anything of value and also causes some of our online tests to be flaky. We should remove it.

How will the feature be relevant to at least 90% of Homebrew users?

It will result in one less network request for most users and will help our CI be more consistent which will help everyone indirectly.

What alternatives to the feature have been considered?

Only using code search if the user has a Github token to increase the likelihood that it works correctly.

@apainintheneck apainintheneck added the features New features label Mar 31, 2023
@carlocab carlocab changed the title Remote Github code search from brew search Remove Github code search from brew search Mar 31, 2023
@MikeMcQuaid MikeMcQuaid added the help wanted We want help addressing this label Mar 31, 2023
@MikeMcQuaid
Copy link
Member

Agreed, this makes sense to me.

This will mean that we don't show casks that are not in the default cask repo in search results. This is less than ideal but can be handled in a few different ways. Either those repos can be merged together which is something we've already discussed in a few different places or we can add those to the API. The other option, of course, would be to just omit those from search results entirely unless you've tapped those repos.

Let's definitely just merge these repos. It will make things easier for everyone.

@issyl0
Copy link
Member

issyl0 commented Apr 8, 2023

Let's definitely just merge these repos.

Should we make a new issue for this? I imagine it might take a bit of wrangling and it's a prerequisite to this issue if we don't want to break things.

To clarify, "these repos" are which ones?

@reitermarkus
Copy link
Member

Will this not completely break searching third-party taps?

@reitermarkus
Copy link
Member

To clarify, "these repos" are which ones?

@issyl0, I think we somewhat agreed in Homebrew/formulae.brew.sh#772 on merging all cask taps except cask-fonts.

@apainintheneck
Copy link
Contributor Author

Will this not completely break searching third-party taps?

I believe that it only searches Homebrew repos on Github right now.

GitHub.search_code(
user: "Homebrew",
path: ["Formula", "Casks", "."],
filename: query,
extension: "rb",
)

@github-actions github-actions bot added the outdated PR was locked due to age label May 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
features New features help wanted We want help addressing this outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants