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

tap_auditor: use short names when checking exception lists #11895

Merged
merged 1 commit into from Aug 20, 2021

Conversation

Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Aug 20, 2021

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

For core formulae, Formula#full_name is the same as Formulae#name, but this is not true for other taps. The formula names that need to go in the exception lists are the short names (because this is what we compare them to during the audit and changing this adds backwards incompatibility). I think this makes sense because the lists are per-tap so short names are sufficient.

TapAuditor also checks to make sure that every formula listed in an exception list actually exists in that tap. This is done by comparing each entry to Tap#formula_names. There is a problem here because Tap#formula_names returns the full name of each formula in the tap. For core formulae, Formula#full_name is the same as Formulae#name, but this is not true for other taps. Therefore, adding an audit exception using the short name will fail the audit checking that it exists in the tap. For example, btb/open-watcom/open-watcom-v2 (from formula_names) is not the same as open-watcom-v2 (from the exception list).

See Homebrew/discussions#2005 (comment) or btb/homebrew-open-watcom#9

@Rylan12 Rylan12 added the critical Critical change which should be shipped as soon as possible. label Aug 20, 2021
@BrewTestBot
Copy link
Member

Review period skipped due to critical label.

Copy link
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

Do we want a tap.formula_short_names method, maybe?

@Rylan12
Copy link
Member Author

Rylan12 commented Aug 20, 2021

Do we want a tap.formula_short_names method, maybe?

I'm not opposed to it but I'm not sure it's really necessary. This is the only place we'd use it so it just seems a bit silly.

@Rylan12 Rylan12 merged commit 98eca95 into Homebrew:master Aug 20, 2021
@Rylan12 Rylan12 deleted the fix-tap-audit-exceptions branch August 20, 2021 14:46
@github-actions github-actions bot added the outdated PR was locked due to age label Sep 20, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants