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
resource_auditor: add audit for HEAD default branch #11720
resource_auditor: add audit for HEAD default branch #11720
Conversation
Review period will end on 2021-07-15 at 18:00:14 UTC. |
I realised that for some formulae we want the specified branch to not be the default branch – like versioned formulae where different versions have different development branches. I don't think this would be the case for too many formulae, so I think I'll add an allowlist for the audit, along with the suggested changes. |
Review period ended. |
Yeah, this is definitely a good idea to have. I'd say go ahead and continue with this route and if it turns out there are a ton of formulae on the list, we can change the audit to just be "you need to specify a branch name" |
Could this be done for Also, I'm tempted to not make this a normal audit over |
Stable URLs always specify a revision and mostly have a tag, so I don't know if this would be necessary. Hope there isn't some case I'm forgetting about here.
I haven't yet checked the number of formulae that need to be updated, but I thought keeping this as a strict audit would be better because:
Seems like specifying the branch anyway (whether it's |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
d02ac00
to
f69f9be
Compare
Apologies for the late update, the latest commit makes specifying a branch mandatory for
The allowlist, located at {
"sdl_mixer": "SDL-1.2",
...
} Only one issue remains unsolved – head do
...
resource "example-resource" do
url "https://github.com/example-resource/example-resource.git", branch: "example"
end
end At the moment, the audit would raise an error if {
"sdl_mixer": "SDL-1.2",
"example-formula": {
"branch": "dev",
"resources": {
"example-resource": "example"
}
}
} |
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.
Nice work! One tiny suggested tweak.
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.
but such formulae should be very rare
I think it's fine to just figure that out if we encounter it, then.
Thanks, @nandahkrishna!
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@nandahkrishna Just for the record I still feel bad sending you down the rabbit hole. I really didn't mean to and I honestly wish I was able to help you. |
No problem at all @vladimyr, happy to have worked on this 😄. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This PR adds an audit to ensure that the correct default branch for a Git repository is specified for
head
when using--strict --online
. Formain
and other alternatives, we need to explicitly specify the default branch usingbranch:
, as the default ismaster
.Adding an audit will ensure this is checked in PRs to add new formulae.
I haven't written a test for this audit as it would require network access (and use a real repository URL), but I'd be happy to add one if that's preferable.
(CC @vladimyr)