Skip to content

Conversation

jameslamb
Copy link
Member

@jameslamb jameslamb commented May 23, 2025

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:

  • not running gh auth status in CI (see notes below)
  • increasing the wait between retries of failed gh commands from 30 to 120 seconds

Also proposes one minor refactoring:

  • invoking, instead of source-ing rapids-prompt-local-github-auth
    • not really related to this issue, but it'd reduce the risk of conflicts in variable names

Notes for Reviewers

How does avoiding gh auth status calls help?

I found in local testing that those do make network requests!

Try this:

# authenticate
gh auth login

# check status
gh auth status

You should see that succeed. Turn off your WiFi and do that again.

gh auth status

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 from gha-tools invoking the gh CLI (as of #172).

How I tested this

Tested on a cugraph PR.

See rapidsai/cugraph#5091 (comment)

@jameslamb jameslamb added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels May 23, 2025
@jameslamb jameslamb changed the title WIP: skip 'gh auth status' in CI runs skip 'gh auth status' in CI runs May 23, 2025
@jameslamb jameslamb requested a review from ajschmidt8 May 23, 2025 17:55
@jameslamb jameslamb marked this pull request as ready for review May 23, 2025 17:55
@jameslamb jameslamb requested a review from a team as a code owner May 23, 2025 17:55
@jameslamb jameslamb merged commit c83268e into main May 23, 2025
4 checks passed
@jameslamb jameslamb deleted the gha-artifacts/fewer-network-requests branch May 23, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improves an existing functionality non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants