Skip to content

Fix tap constants. #16728

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

Merged
merged 1 commit into from
Feb 22, 2024
Merged

Conversation

reitermarkus
Copy link
Member

@reitermarkus reitermarkus commented Feb 22, 2024

  • 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?

Accept any tap name, as long as it is a valid directory name, i.e. doesn't contain slashes in user or repo.

Fixes #16727.

@reitermarkus reitermarkus added the critical Critical change which should be shipped as soon as possible. label Feb 22, 2024
@reitermarkus reitermarkus merged commit 94e987e into Homebrew:master Feb 22, 2024
@reitermarkus reitermarkus deleted the tap-from-path-regex branch February 22, 2024 21:13
%r{\A(?<user>[\w-]+)/(?<repo>[\w-]+)/#{HOMEBREW_TAP_FORMULA_NAME_REGEX.source}\Z},
%r{\A(?<user>[^/]+)/(?<repo>[^/]+)/#{HOMEBREW_TAP_FORMULA_NAME_REGEX.source}\Z},
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the quick fix but: why do we need to permanently widen the range of acceptable tap names to fix this regression?

Copy link
Member Author

@reitermarkus reitermarkus Feb 23, 2024

Choose a reason for hiding this comment

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

@MikeMcQuaid, for example, brew tap <user>/<repo> doesn't validate the name at all, except for the check for slashes in Tap.fetch. So this was always broken in these regexes (and in Tap::from_path which uses them), we just weren't using them consistently for every loader in Formulary before, and we weren't using Tap::from_path in Tap::each before.

Copy link
Member

Choose a reason for hiding this comment

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

@reitermarkus Ok. I'd like in future changes like this that are not strictly a fix but an actual functionality change to have some discussion before a critical self-merge, thanks.

Copy link
Member Author

@reitermarkus reitermarkus Feb 29, 2024

Choose a reason for hiding this comment

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

It doesn't change functionality though, except for making Tap::from_path consistent with what we actually allow in other places (e.g. Tap::fetch). Note that e.g. brew install some/tap.with.dots/myformula always worked, we just didn't use these regexes consistently in Formulary before.

@github-actions github-actions bot added the outdated PR was locked due to age label Apr 3, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2024
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.

Error: undefined method `name' for nil:NilClass
4 participants