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

diagnostic: add check for broken taps #11473

Merged
merged 2 commits into from Jun 2, 2021

Conversation

gromgit
Copy link
Member

@gromgit gromgit commented May 31, 2021

Detect half-baked core taps that show up on a fairly regular basis (e.g. #11465, #11243).

A half-baked tap wouldn't have a complete Git config, and is always somewhere below HOMEBREW_REPOSITORY, so any Git operation would refer to the Brew repo instead. We simply need to test for any of:

  1. Empty tap origin
  2. Empty tap HEAD
  3. Tap HEAD == Brew HEAD
  • 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?

@BrewTestBot
Copy link
Member

Review period will end on 2021-06-01 at 17:12:08 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label May 31, 2021
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

love this idea, nice work so far @gromgit!

Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Library/Homebrew/diagnostic.rb Outdated Show resolved Hide resolved
Detect half-baked core taps that show up on a fairly regular basis (e.g. Homebrew#11465).

The logic is simple enough: Since an improper tap wouldn't have a complete Git config, and is always somewhere below `HOMEBREW_REPOSITORY`, any Git operation would look at the Brew repo instead. We simply need to test for any of:

1. Empty tap origin
2. Empty tap HEAD
3. Tap HEAD == Brew HEAD
@gromgit
Copy link
Member Author

gromgit commented Jun 1, 2021

@MikeMcQuaid, thanks much for the comprehensive review! I've refactored my changes based on your last comment:

which also makes me wonder if broken_tap? (without the ?) could return this message itself?

It's certainly more streamlined now. 😁

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Jun 1, 2021
@BrewTestBot
Copy link
Member

Review period ended.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Great work here as usual @gromgit!

@MikeMcQuaid MikeMcQuaid merged commit 9ea4c55 into Homebrew:master Jun 2, 2021
@gromgit gromgit deleted the diagnose-broken-tap branch June 2, 2021 14:13
@github-actions github-actions bot added the outdated PR was locked due to age label Jul 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2021
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.

None yet

3 participants