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
audit(github): prefer /archive/refs/tags
urls over /archive
#16126
Conversation
Good idea. As is, this won't work with commit URLs like with LuaJIT, but you should be able to adjust the regex to exclude those types of URLs. |
yeah, I will update all the urls later :) |
Added a big PR to fix all the url formats, Homebrew/homebrew-core#152092 passed my style check in my local |
should be good to go |
audit_urls(urls, archive_ref_tags_gh_pattern) do |_, url| | ||
next if url.end_with?(".git") | ||
|
||
problem "Use /archive/refs/tags URLs for GitHub tarballs (url is #{url})." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to write an autocorrect for this if possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any example of doing autocorrect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrector.replace(homepage_parameter_node.source_range, "\"#{homepage}/\"") |
Can wait till a follow-up PR but, if it's not too hard: autocorrects are always nice to have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Signed-off-by: Rui Chen <rui@chenrui.dev>
121fc59
to
53dadc2
Compare
rebased to latest master after Homebrew/homebrew-core#152092 merge |
The current audit failures are due to the repo removal issues for
|
You will need to change them still. Can do it in separate PRs to make it obvious it's not tested (though the orginal URL is broken anyway so it doesn't matter much). |
I see, let me update those two then. |
Signed-off-by: Rui Chen <rui@chenrui.dev>
53dadc2
to
b954e20
Compare
Should be good now. |
I'm happy to merge when @Bo98 is ✅ |
…tifact urls relates to Homebrew/brew#16126 Signed-off-by: Rui Chen <rui@chenrui.dev>
This PR broke using a branch archive for head builds. What I mean is that this: head do
url "https://github.com/Macaulay2/M2/archive/refs/heads/master.tar.gz"
end Now gives an error: (see for instance this build) Formula/macaulay2.rb:24:5: C: FormulaAudit/Urls: Use /archive/refs/tags URLs for GitHub tarballs (url is https://github.com/Macaulay2/M2/archive/refs/heads/master.tar.gz).
url "https://github.com/Macaulay2/M2/archive/refs/heads/master.tar.gz"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This is only relevant for I think the original rationale for preferring |
Yeah we should update the regex to exclude |
@chenrui333 can you do this? Thanks! |
I opened #16155 to address this for now. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?followup mislav/bump-homebrew-formula-action#53
seeing couple of issues recently in homebrew-core for the artifact urls