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

dev-cmd/bump-formula-pr: replace partial version in URL #16904

Merged
merged 1 commit into from Mar 18, 2024

Conversation

cho-m
Copy link
Member

@cho-m cho-m commented Mar 17, 2024

For now, restrict to partial version excluding the last part, i.e. version with major.minor.patch will result in attempting to replace any occurrences of "/#{major}.#{minor}/" or "/v#{major}.#{minor}/".

This should take care of common situations like GNOME, KDE, and SourceForge URLs. It should also help with URLs like util-linux.

It may result in incorrect replacements if URL has partial version based on another versioning scheme like the API version or if there are some equivalent numbers in URL that happen to match

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

Could go stricter or looser in restrictions. Not sure if any incorrect replacements yet.

This won't handle formulae like:

If we do hit incorrect replacements, we could test out multiple options for url. In case of mirror, we would still need to guess as these don't always exist at time of bump.

@cho-m
Copy link
Member Author

cho-m commented Mar 17, 2024

cc @Bo98 as related to Homebrew/homebrew-core#166305 (comment)

@cho-m cho-m force-pushed the bump-formula-pr-partial-versions branch 2 times, most recently from b969bfd to b38a82a Compare March 17, 2024 16:56
For now, restrict to partial version excluding the last part, i.e.
version with major.minor.patch will result in attempting to replace any
occurrences of "/#{major}.#{minor}/" or "/v#{major}.#{minor}/".

This should take care of common situations like GNOME, KDE, and
SourceForge URLs. It should also help with URLs like `util-linux`.

It may result in incorrect replacements if URL has partial version based
on another versioning scheme like the API version or if there are some
equivalent numbers in URL that happen to match

Signed-off-by: Michael Cho <michael@michaelcho.dev>
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 again @cho-m, makes sense!

@MikeMcQuaid MikeMcQuaid merged commit fbc2b7d into Homebrew:master Mar 18, 2024
26 checks passed
@cho-m cho-m deleted the bump-formula-pr-partial-versions branch March 18, 2024 12:58
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants