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

Add flags to backfill script #2146

Merged
merged 3 commits into from
Jun 13, 2024
Merged

Conversation

cmurphy
Copy link
Contributor

@cmurphy cmurphy commented Jun 11, 2024

Add retry options and make all configurable

Add options to the rekor client to set the minimum and maximum retry
time, and make all rekor client options configurable for the backfill
script.

Add ability to set custom headers in backfill

Add flags to the backfill script to allow passing custom headers to the
Rekor service. The Rekor infrastructure may be configured to respond
in certain ways to certain headers.

Summary

Release Note

Documentation

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Add options to the rekor client to set the minimum and maximum retry
time, and make all rekor client options configurable for the backfill
script.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Add flags to the backfill script to allow passing custom headers to the
Rekor service. The Rekor infrastructure may be configured to respond
in certain ways to certain headers.

Signed-off-by: Colleen Murphy <colleenmurphy@google.com>
Copy link

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.

Project coverage is 68.11%. Comparing base (488eb97) to head (701989e).
Report is 136 commits behind head on main.

Files Patch % Lines
pkg/client/options.go 12.50% 13 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2146      +/-   ##
==========================================
+ Coverage   66.46%   68.11%   +1.65%     
==========================================
  Files          92       92              
  Lines        9258     7308    -1950     
==========================================
- Hits         6153     4978    -1175     
+ Misses       2359     1591     -768     
+ Partials      746      739       -7     
Flag Coverage Δ
e2etests 50.28% <16.66%> (+2.72%) ⬆️
unittests 48.41% <22.22%> (+0.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -161,7 +188,12 @@ func main() {
log.Fatalf("creating index client: %v", err)
}

rekorClient, err := client.GetRekorClient(*rekorAddress, client.WithNoDisableKeepalive(true), client.WithRetryCount(10))
opts := []client.Option{client.WithNoDisableKeepalives(!*rekorDisableKeepalives)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bob had mentioned last time, but the double negatives are a bit confusing, especially since we negate the input. Do you think it would be cleaner to switch these to DisableKeepAlive?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that on the first iteration of this PR, the problem is in GetRekorClient, if we had this:

defaultTransport.DisableKeepAlives = o.DisableKeepalives

as opposed to conditioning on the negative, then if the option is unset it actually reverses the default behavior and several unit tests fail. The double negative helps distinguish whether the setting was unset or explicitly false.

@haydentherapper haydentherapper merged commit 332c7ca into sigstore:main Jun 13, 2024
15 checks passed
@github-actions github-actions bot added this to the v1.2.2 milestone Jun 13, 2024
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.

2 participants