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: always use full git repo as tap remote #18538

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dawidd6
Copy link
Member

@dawidd6 dawidd6 commented Oct 9, 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?

Hi there folks!

I'm currently taking care of my GitHub Action action-homebrew-bump-formula and wanted to move my test formulae from separate repository to the same repository where the action is stored.
I've run into an issue, because the repository is not named properly (i.e. $USER/homebrew-$TAP), brew bump-formula-pr would try to access non-existent repository named for example dawidd6/tap, it depends how I cloned the tap of course. I've tracked it down to this changed line. Didn't test it on homebrew-core, but I think it should work the same as for my repository.

Steps to reproduce:

  1. brew tap dawidd6/tap https://github.com/dawidd6/action-homebrew-bump-formula.git
  2. brew bump-formula-pr --no-audit --no-browse --no-fork --version=0.1.12 --force dawidd6/tap/test-formula-url
  3. Observe error "Not found".

@dawidd6
Copy link
Member Author

dawidd6 commented Oct 9, 2024

So, I've blamed this line and found this PR #15082 😄.
Converting to draft for now, will find a solution working for both cases.

@dawidd6 dawidd6 marked this pull request as draft October 9, 2024 09:29
@dawidd6 dawidd6 marked this pull request as ready for review October 9, 2024 10:30
@dawidd6 dawidd6 marked this pull request as draft October 9, 2024 10:34
@dawidd6 dawidd6 marked this pull request as ready for review October 9, 2024 10:49
.delete_suffix(".git")
.split(%r{[:\/]})[-2..].join("/")
Copy link
Member

Choose a reason for hiding this comment

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

Can you clarify a bit more what this is doing? It's pretty hard to follow.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's taking last two bits of the url, returning owner/repo.
I see we can't create a repository with a colon or a slash in a name, so it should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants