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

formula_auditor: allow references to merged PRs #14580

Merged
merged 2 commits into from
Feb 15, 2023
Merged

formula_auditor: allow references to merged PRs #14580

merged 2 commits into from
Feb 15, 2023

Conversation

carlocab
Copy link
Member

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

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).

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).
@carlocab carlocab requested a review from SMillerDev February 10, 2023 14:05
@BrewTestBot
Copy link
Member

Review period will end on 2023-02-13 at 14:05:21 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 10, 2023
@SMillerDev
Copy link
Member

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 fixed in: url will make sure that we can document the rationale without losing track of the state of our references.

@carlocab
Copy link
Member Author

We can't really prevent fixed in: url pointing to a pull request that was declined either, though.

@carlocab
Copy link
Member Author

@SMillerDev
Copy link
Member

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.

@carlocab
Copy link
Member Author

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.

@MikeMcQuaid
Copy link
Member

It still allows things like the PHP formula where the pull request was declined but we still ship the patch forever.

Can we allow referencing merged but not closed PRs, then?

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Feb 13, 2023
@BrewTestBot
Copy link
Member

Review period ended.

@SMillerDev
Copy link
Member

I like that suggestion. It'll cover the cases I'm most worried about.

@carlocab
Copy link
Member Author

carlocab commented Feb 14, 2023

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?

@SMillerDev
Copy link
Member

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.

@SMillerDev
Copy link
Member

Alternative solution, do we have a way to make this into a warning only?

@carlocab
Copy link
Member Author

Yea, think so. You can make it require --strict and then add a --strict audit in test-bot that allows failures (they become warnings instead).

@carlocab carlocab changed the title formula_auditor: allow references to closed PRs formula_auditor: allow references to merged PRs Feb 15, 2023
@MikeMcQuaid
Copy link
Member

Thanks @carlocab!

@MikeMcQuaid MikeMcQuaid merged commit d87c7d7 into Homebrew:master Feb 15, 2023
@carlocab carlocab deleted the closed-prs branch February 15, 2023 12:10
@github-actions github-actions bot added the outdated PR was locked due to age label Mar 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2023
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.

4 participants