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

attestion: make InvalidAttestationError non-fatal in CI #18485

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

carlocab
Copy link
Member

@carlocab carlocab commented Oct 3, 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?

I don't think I've seen an InvalidAttestationError that wasn't some
sort of network problem (e.g., rate limit, connection timeout, 503).
Let's emit a warning instead of erroring out.

Note that MissingAttestationError is still fatal, and that will still
produce errors in CI.

@carlocab
Copy link
Member Author

carlocab commented Oct 3, 2024

attestation.rb:135: Method `system_command!` does not exist on `T.class_of(Homebrew::Attestation)` https://srb.help/7003
     135 |        result = system_command!(gh_executable, args: cmd,
                           ^^^^^^^^^^^^^^^
Errors: 1

Huh, interesting. Not even code I touched though. Would love a suggestion here. CC @dduugg ?

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.

I appreciate the intent here but 👎🏻 as-is.

If we're going to make this non-fatal it feels like it defeats the entire point of having attestation.

I'd like to have us try a couple of retries with an exponential backoff before we do this.

@dduugg
Copy link
Member

dduugg commented Oct 3, 2024

attestation.rb:135: Method `system_command!` does not exist on `T.class_of(Homebrew::Attestation)` https://srb.help/7003
     135 |        result = system_command!(gh_executable, args: cmd,
                           ^^^^^^^^^^^^^^^
Errors: 1

Huh, interesting. Not even code I touched though. Would love a suggestion here. CC @dduugg ?

Try pairing your change with an explicit begin, since i don't think the way code aligns matches the control flow. (Then, I think you should be getting a different type error, since you've made the return type nilable)

I don't think I've seen an `InvalidAttestationError` that wasn't some
sort of network problem (e.g., rate limit, connection timeout, 503).
Let's emit a warning instead of erroring out.

Note that `MissingAttestationError` is still fatal, and that will still
produce errors in CI.
@carlocab carlocab force-pushed the non-fatal-invalid-attestations branch 2 times, most recently from 24b3045 to ba98b0a Compare October 4, 2024 04:43
@carlocab
Copy link
Member Author

carlocab commented Oct 4, 2024

Implemented retry logic instead.

@carlocab carlocab force-pushed the non-fatal-invalid-attestations branch from ba98b0a to 6b63660 Compare October 4, 2024 04:47
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.

Thanks @carlocab! Have suggested speeding up failure time so we can evaluate if this is something we should back out entirely for now. Feel free to merge as-is if preferred.

Library/Homebrew/attestation.rb Show resolved Hide resolved
Library/Homebrew/attestation.rb Show resolved Hide resolved
@carlocab
Copy link
Member Author

carlocab commented Oct 4, 2024

Let's keep the retry timing as is. The case for backing this out if we need to will be stronger if we were more patient about retries.

@carlocab carlocab enabled auto-merge October 4, 2024 08:02
@carlocab carlocab merged commit 4671af4 into master Oct 4, 2024
27 checks passed
@carlocab carlocab deleted the non-fatal-invalid-attestations branch October 4, 2024 08:09
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