skip 'gh auth status' in CI runs #186
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've recently observed some issues across RAPIDS CI that look like we're hitting the GitHub REST API's rate limits: https://github.com/rapidsai/build-infra/issues/241
This proposes some changes to hopefully reduce the incidence of that:
gh auth status
in CI (see notes below)gh
commands from 30 to 120 secondsAlso proposes one minor refactoring:
source
-ingrapids-prompt-local-github-auth
Notes for Reviewers
How does avoiding
gh auth status
calls help?I found in local testing that those do make network requests!
Try this:
You should see that succeed. Turn off your WiFi and do that again.
You'll see it fail!
I think the request it's making is to get the scopes for the current token:
https://github.com/cli/cli/blob/1e6a2b1affb7d6a7850f4bc0e7a43cf14b80caf5/pkg/cmd/auth/status/status.go#L214
https://github.com/cli/cli/blob/1e6a2b1affb7d6a7850f4bc0e7a43cf14b80caf5/pkg/cmd/auth/status/status.go#L305
https://github.com/cli/cli/blob/1e6a2b1affb7d6a7850f4bc0e7a43cf14b80caf5/pkg/cmd/auth/shared/oauth_scopes.go#L38
I can't quite tell what endpoint it's hitting so not sure whether that's actually counting towards our rate limit. But avoiding those requests in CI would be valuable even if they don't count against our rate limit... every network request is an opportunity for a build-breaking transient failure 😬
If these do count against our rate limits, then this PR would cut the number of requests to the GItHub API per run roughly in half, because
rapids-prompt-local-github-auth
is called on every code path fromgha-tools
invoking thegh
CLI (as of #172).How I tested this
Tested on a
cugraph
PR.See rapidsai/cugraph#5091 (comment)