Skip to content

Add --run-github-repo to artifact_manager.py#4444

Merged
ScottTodd merged 1 commit intoROCm:mainfrom
ScottTodd:artifact-manager-github-repo
Apr 10, 2026
Merged

Add --run-github-repo to artifact_manager.py#4444
ScottTodd merged 1 commit intoROCm:mainfrom
ScottTodd:artifact-manager-github-repo

Conversation

@ScottTodd
Copy link
Copy Markdown
Member

@ScottTodd ScottTodd commented Apr 9, 2026

Motivation

As I'm working on #4441, I want a way to fetch artifacts from workflow runs from ROCm/TheRock, even when running workflows from a fork like ScottTodd/TheRock. See also the docs at https://github.com/ROCm/TheRock/blob/main/docs/development/github_actions_debugging.md#working-effectively-from-forks

Technical Details

The bucket selection code used by this script has been treating workflow run ids as being associated with a default value of GITHUB_REPOSITORY (the environment variable).

This new code matches the existing pattern used for fetch_artifacts.py:

parser.add_argument(
"--run-github-repo",
type=str,
help="GitHub repository for --run-id in 'owner/repo' format (e.g. 'ROCm/TheRock'). Defaults to GITHUB_REPOSITORY env var or 'ROCm/TheRock'",
)
parser.add_argument(
"--run-id",
type=str,
required=True,
help="GitHub run ID to retrieve artifacts from",
)

Test Plan

Try running a workflow in my fork with and without the new option, check that runs are now able to find artifacts.

Test Result

Before: https://github.com/ScottTodd/TheRock/actions/runs/24205465226/job/70660041372
After: https://github.com/ScottTodd/TheRock/actions/runs/24205988455/job/70661826987

  python build_tools/build_tarballs.py \
    --run-id="24164769563" \
+   --run-github-repo="ROCm/TheRock" \
    --dist-amdgpu-families="gfx1151;gfx110X-all" \
    --platform="linux" \
    --package-version="7.13.0.dev0+83ae8235312791cd7302e3f50c9935887d62b5a3" \
    --output-dir="/home/runner/work/TheRock/TheRock/tarballs"

 Retrieving bucket info for workflow run...
-  github_repository: ScottTodd/TheRock
+  github_repository: ROCm/TheRock
   is_pr_from_fork: False
-  bucket: therock-ci-artifacts-external
+  bucket: therock-ci-artifacts
 Using backend: s3://therock-ci-artifacts-external/ScottTodd-TheRock/24164769563-linux
-Found 0 artifacts in backend
+Found 400 artifacts in backend

Submission Checklist

Thread github_repository through create_backend_from_env so callers
can specify which repo's artifacts to fetch. Without this, scripts
running on forks look for artifacts in the fork's bucket instead of
ROCm/TheRock's.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown
Contributor

@erman-gurses erman-gurses left a comment

Choose a reason for hiding this comment

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

LGTM. The new --run-github-repo option is correctly wired through artifact_manager.py, and the workflows (Linux, Windows, and test_artifacts_structure) now pass artifact_github_repo explicitly. This resolves the fork vs main repo artifact lookup issue.

@ScottTodd ScottTodd merged commit e699758 into ROCm:main Apr 10, 2026
140 of 147 checks passed
@ScottTodd ScottTodd deleted the artifact-manager-github-repo branch April 10, 2026 15:01
@github-project-automation github-project-automation bot moved this from TODO to Done in TheRock Triage Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants