-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
formula_auditor: allow references to merged PRs #14580
Conversation
The `github_issue_comment` audit disallows references to closed or merged PRs in other repositories. We should allow those, since it is a common pattern to reference merged PRs in formulae when adding comments that explain changes that need to be made in future versions (e.g. `patch` blocks).
Review period will end on 2023-02-13 at 14:05:21 UTC. |
I don't think that's a great solution. It still allows things like the PHP formula where the pull request was declined but we still ship the patch forever. I think some keyword like |
We can't really prevent |
We should also find a way to allow comments like this: https://github.com/Homebrew/homebrew-core/blob/6adaa9491a02938ef8ce18c7139d662a1e949108/Formula/terraform.rb#L37-L39 |
For that one we could reference our internal PR. I understand the point though and I'm trying to come up with a solution for it. |
Seems kinda tedious to reference an internal PR that one would have to read through to get to the correct upstream PR which contains the context you're looking for. Not to mention that it would require modifying your PR after it's already been opened (since you don't know the PR number until you open it). This doesn't seem like a good solution at all, sadly. |
Can we allow referencing merged but not closed PRs, then? |
Review period ended. |
I like that suggestion. It'll cover the cases I'm most worried about. |
It's an improvement, but it doesn't allow references to issues upstream that either 1) were closed by being fixed in a formula, or 2) contain the context for why a formula is written a certain way. If you're concerned about PRs that were rejected upstream: why not disallow references to PRs that were closed but not merged? What are examples of closed issues (that are not PRs) that we don't want to be able to reference in a formula? |
I can see HDFGroup/hdf5#2422 becoming such a situation since we have an idea of a workaround and we have an upstream issue. Nothing else currently comes to mind. For the terraform example I think we should suggest this to the upstream build instructions though, since we wouldn't be the only build system affected by this. |
Alternative solution, do we have a way to make this into a warning only? |
Yea, think so. You can make it require |
Thanks @carlocab! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?The
github_issue_comment
audit disallows references to closed ormerged PRs in other repositories. We should allow those, since it is a
common pattern to reference merged PRs in formulae when adding comments
that explain changes that need to be made in future versions (e.g.
patch
blocks).