Skip to content

rapids-get-pr-artifact: stricter, fewer API calls, less expensive#249

Open
jameslamb wants to merge 1 commit intomainfrom
no-empty-run-id
Open

rapids-get-pr-artifact: stricter, fewer API calls, less expensive#249
jameslamb wants to merge 1 commit intomainfrom
no-empty-run-id

Conversation

@jameslamb
Copy link
Member

@jameslamb jameslamb commented Mar 10, 2026

I've been using rapids-get-pr-artifact a lot recently, for rapidsai/build-planning#257

Today, one of my PRs for that briefly caused cudf to briefly exceed its GitHub API limits: rapidsai/cudf#21671 (comment)

This proposes some fixes to rapids-get-pr-artifact in the future:

  • error out of a unique GitHub Actions run ID can't be determined from the inputs
    • (instead of passing an empty string to gh run download, which causes it to page over all CI runs GitHub's history retains)
  • limit initial search for runs to just pr.yaml workflow
    • (optionally overridable by env variable RAPIDS_BUILD_WORKFLOW_NAME)

These should make rapids-get-pr-artifact faster and, more importantly, use many fewer GitHub API calls.

Notes for Reviewers

Haven't I seen this before?

Yep! Similar changes were made in rapids-github-run-id:

rapids-get-pr-artifact doesn't use rapids-github-run-id because its behavior of "use environment variable GITHUB_RUN_ID if it's available" is undesirable when you're trying to workflow runs in a repo other than the one rapids-get-pr-artifact is currently running in.

How I tested this

Tested on rapidsai/cudf#21671, with rapidsai/cudf@c058c43

@jameslamb jameslamb added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Mar 10, 2026
@jameslamb jameslamb changed the title WIP: rapids-get-pr-artifact: stricter, fewer API calls, less expensive rapids-get-pr-artifact: stricter, fewer API calls, less expensive Mar 10, 2026
--repo "${repo}" \
--branch "pull-request/${pr}" \
--commit "${commit}" \
--workflow "${workflow_that_produced_artifacts}" \
Copy link
Member Author

Choose a reason for hiding this comment

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

Adding --workflow limits the search space.

@jameslamb jameslamb requested a review from gforsyth March 10, 2026 02:29
@jameslamb jameslamb marked this pull request as ready for review March 10, 2026 02:29
@jameslamb jameslamb requested a review from a team as a code owner March 10, 2026 02:29
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.

1 participant