-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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 when gh
is old
#17926
Conversation
See Homebrew/homebrew-core#177384 (comment). Signed-off-by: William Woodruff <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mostly seems fine but the reason I created the version-based check earlier was because some older versions of gh
, weirdly, seem to not output an unknown command error even though they don't support attestations.
See for example:
$ oras pull ghcr.io/homebrew/core/gh:2.48.0
$ HOMEBREW_NO_VERIFY_ATTESTATIONS=1 brew install ./gh--2.48.0.arm64_sonoma.bottle.tar.gz
$ gh --version
gh version 2.48.0 (2024-04-17)
$ gh attestation
Download and verify artifact attestations.
USAGE
gh attestation [subcommand] [flags]
ALIASES
at
AVAILABLE COMMANDS
download: Download an artifact's Sigstore bundle(s) for offline use
verify: Verify an artifact's integrity using attestations
INHERITED FLAGS
--help Show help for command
LEARN MORE
Use `gh <command> <subcommand> --help` for more information about a command.
Read the manual at https://cli.github.com/manual
However, the minimum gh
version that supports attestations is 2.49.0
, so I have no idea why this is happening.
Honestly, it might just be easier to only check brewed gh version in gh_version = Formula["gh"].any_installed_version
return false if gh_version.nil? || gh_version < "2.49" Especially given we hope to phase out For Homebrew/core CI, where we don't use brewed gh, we already explicitly opt-in via the env which would override this check anyway. The number of non-CI end users using non-brewed gh is likely sufficiently small that it's probably not worth trying to extend the beta to cover them. |
Yeah, seems right. I remember we had some bootstrap cycle issue with accessing |
This might make it easier to parse the |
Agreed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with @Bo98's comment.
Signed-off-by: William Woodruff <[email protected]>
I've updated this so that we now only enable attestations if |
Signed-off-by: William Woodruff <[email protected]>
Hey! This looks like it might be the cause of #18028 |
Looks like it, thanks. Reverting. |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This isn't really ideal (I'll look further into the bootstrap cycle issues that led us to try version sniffing in the first place), but it'll help more users in the current beta resolve issues they're seeing.
See Homebrew/homebrew-core#177384 (comment).