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

attestation: specialize error on incompatible gh #18543

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

woodruffw
Copy link
Member

@woodruffw woodruffw commented Oct 10, 2024

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

This is another attempt to iteratively improve the UX around operational attestation failures: it checks whether the failure is caused by a missing attestation subcommand, and directs the user to update gh as a resolution. This should be sound, since brew upgrade gh is exempt from the bootstrap cycle.

Example output:

$ brew install cowsay
==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
###################################################### 100.0%
Warning: cowsay has been deprecated because it has an archived upstream repository! It will be disabled on 2024-11-22.
==> Downloading https://ghcr.io/v2/homebrew/core/cowsay/manif
###################################################### 100.0%
==> Fetching cowsay
==> Downloading https://ghcr.io/v2/homebrew/core/cowsay/blobs
###################################################### 100.0%
==> Verifying attestation for cowsay
Error: The bottle for cowsay could not be verified.

This typically indicates an outdated or incompatible `gh` CLI.

Please confirm that you're running the latest version of `gh`
by performing an upgrade before retrying:

  brew update
  brew upgrade gh

Signed-off-by: William Woodruff <william@yossarian.net>
@woodruffw woodruffw requested a review from Bo98 October 10, 2024 11:10
@woodruffw woodruffw self-assigned this Oct 10, 2024
@woodruffw woodruffw requested a review from carlocab October 10, 2024 11:11
Copy link
Member

@Bo98 Bo98 left a comment

Choose a reason for hiding this comment

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

Honestly would like to just see us not opt-in users with old gh but this is ok

@Bo98 Bo98 merged commit 587949b into master Oct 10, 2024
27 checks passed
@Bo98 Bo98 deleted the ww/gh-incompatible branch October 10, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants