Conversation
|
@copilot review this |
There was a problem hiding this comment.
Pull request overview
Adds automation to bump rocm-systems / rocm-libraries submodules in ROCm/TheRock, and to propagate TheRock ref: updates back into those upstream repos via PRs, driven by a scheduled + push-triggered GitHub Actions workflow.
Changes:
- Add a new Python automation script to create/close PRs and rewrite workflow
ref:pins. - Add a new GitHub Actions workflow to run the automation on a 12-hour schedule and on pushes to
main.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 16 comments.
| File | Description |
|---|---|
| build_tools/github_actions/bump_automation.py | Implements submodule bump PR creation, stale PR cleanup, and workflow ref: rewriting. |
| .github/workflows/bump_submodules.yml | Adds schedule/push workflow to run the bump automation with GitHub App tokens. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
| if: github.event_name == 'schedule' | ||
| run: | | ||
| python3 build_tools/github_actions/bump_automation.py \ | ||
| --event_type schedule \ |
There was a problem hiding this comment.
args value should be in double quotes
| run(["git", "commit", "-m", f"Update TheRock ref to {after[:7]}"]) | ||
| run(["git", "push", "origin", branch]) | ||
| gh_api( | ||
| token, |
There was a problem hiding this comment.
This token is short-lived only but in case the push fails it be exposed as runtime error -- would want to run it by joseph on this as well.
There was a problem hiding this comment.
https://github.com/actions/create-github-app-token?tab=readme-ov-file#how-it-works
GitHub App tokens created using the create-github-app-token action get revoked as a post-job step, as documented in the link shared.
rahulc-gh
left a comment
There was a problem hiding this comment.
LGTM , we can merge after discussing the token aspect with joseph
| push: | ||
| branches: | ||
| - main |
There was a problem hiding this comment.
This has been failing on all pushes, fyi: https://github.com/ROCm/TheRock/actions/workflows/bump_submodules.yml?query=event%3Apush
https://github.com/ROCm/TheRock/actions/runs/23265484057/job/67645053372
Run actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf
Inputs 'owner' and 'repositories' are set. Creating token for the following repositories:
- ROCm/TheRock
Error: [@octokit/auth-app] appId option is required
## Motivation Adding an automated workflow to manage submodule bumps for `rocm-systems` and `rocm-libraries` and to propagate corresponding reference updates back into those repositories. - Submodules are periodically updated to the latest upstream commits. - Workflow files in `rocm-systems` and `rocm-libraries` always reference the latest `ROCm/TheRock` commit. - Stale PRs created during the bump process are automatically cleaned up. --- ## Technical Details This change introduces a Python automation script and a GitHub Actions workflow. ### Python Automation Script A new script: build_tools/github_actions/bump_automation.py #### Scheduled (`schedule`) Runs every 12 hours and performs the following: 1. Retrieves the latest commit from: - `ROCm/rocm-systems` - `ROCm/rocm-libraries` 2. Creates a new branch in `ROCm/TheRock`. 3. Updates the corresponding submodule pointer. 4. Opens a PR in `ROCm/TheRock` with the updated submodule reference. #### Push Triggered when `ROCm/TheRock` receives a push to the `main` branch. The script: 1. Detects whether either monitored submodule changed. 2. Closes stale bump PRs related to the previous SHA. 3. Updates `ROCm/TheRock` references in workflow YAML files in: - `rocm-systems` - `rocm-libraries` 4. Creates a PR in the affected repository updating the `ref:` field. ## Test Plan Scheduled Run: https://github.com/ammallya/TheRock/pull/2 Push Event : Stale PR close: https://github.com/ammallya/TheRock/pull/1 Update ref: https://github.com/ammallya/rocm-systems/pull/7 (Note date is also present added in the future) --- ## Test Result Results observed: - Submodule bump PRs were successfully created. - Stale PRs were automatically detected and closed. - Workflow files in `rocm-systems` and `rocm-libraries` were updated with the correct `ROCm/TheRock` commit reference. - Generated PRs included correct commit comparison links. --- ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Marius Brehler <marius.brehler@gmail.com>
Motivation
Adding an automated workflow to manage submodule bumps for
rocm-systemsandrocm-librariesand to propagate corresponding reference updates back into those repositories.rocm-systemsandrocm-librariesalways reference the latestROCm/TheRockcommit.Technical Details
This change introduces a Python automation script and a GitHub Actions workflow.
Python Automation Script
A new script:
build_tools/github_actions/bump_automation.py
Scheduled (
schedule)Runs every 12 hours and performs the following:
ROCm/rocm-systemsROCm/rocm-librariesROCm/TheRock.ROCm/TheRockwith the updated submodule reference.Push
Triggered when
ROCm/TheRockreceives a push to themainbranch.The script:
ROCm/TheRockreferences in workflow YAML files in:rocm-systemsrocm-librariesref:field.Test Plan
Scheduled Run: https://github.com/ammallya/TheRock/pull/2
Push Event :
Stale PR close: https://github.com/ammallya/TheRock/pull/1
Update ref: https://github.com/ammallya/rocm-systems/pull/7 (Note date is also present added in the future)
Test Result
Results observed:
rocm-systemsandrocm-librarieswere updated with the correctROCm/TheRockcommit reference.Submission Checklist