Skip to content

Conversation

@ammallya
Copy link
Contributor

@ammallya ammallya commented Dec 3, 2025

Motivation

Automate bumping of rocm-libraries PR daily

Progress on #223

@ammallya ammallya marked this pull request as draft December 3, 2025 17:45
@ammallya ammallya marked this pull request as ready for review December 3, 2025 18:23
@mgehre-amd
Copy link
Contributor

We had some good results enabling auto merge (via the gh tool) on the bump PRs, so they would merge after CI checks are green.

@ScottTodd
Copy link
Member

We had some good results enabling auto merge (via the gh tool) on the bump PRs, so they would merge after CI checks are green.

In which repository? Here in TheRock the only required check right now is pre-commit, so auto-merge won't wait for non-required CI checks. I would certainly like for auto-merge to be something we can safely enable if we can get our build/test/etc. times down to 30-60 minutes.

@ammallya
Copy link
Contributor Author

ammallya commented Dec 5, 2025

#2448 Sample PR created by new changes

@ammallya ammallya requested a review from ScottTodd December 5, 2025 20:30
Comment on lines +41 to +44
run: |
python3 ./build_tools/bump_submodules.py --push-branch \
--branch-name ${{ steps.set-branch.outputs.branch-name }} \
--components rocm-libraries"
Copy link
Member

Choose a reason for hiding this comment

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

Trailing " on the last line here? Remove?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was waiting on the final go ahead to fix all the pre-commit issues.

Copy link
Member

Choose a reason for hiding this comment

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

The final go will be the approval but we cannot approve before this wasn't addressed thus not sure what you're looking for.

Copy link
Member

Choose a reason for hiding this comment

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

There is a syntax error here. Did you test the workflow (on your fork)?

pre-commit is for formatting issues. You should install the pre-commit git hook or otherwise run pre-commit manually yourself. We should never see pre-commit failures on PRs if you have that properly configured.

See https://github.com/ROCm/TheRock/blob/main/CONTRIBUTING.md#pre-commit-checks

@ammallya
Copy link
Contributor Author

ammallya commented Dec 8, 2025

ammallya#2 New sample PR with commit message fixed to match title

@ammallya ammallya requested a review from ScottTodd December 8, 2025 23:02
Comment on lines +41 to +44
run: |
python3 ./build_tools/bump_submodules.py --push-branch \
--branch-name ${{ steps.set-branch.outputs.branch-name }} \
--components rocm-libraries"
Copy link
Member

Choose a reason for hiding this comment

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

The final go will be the approval but we cannot approve before this wasn't addressed thus not sure what you're looking for.


if __name__ == "__main__":
main(sys.argv[1:])
main(sys.argv[1:])
Copy link
Member

Choose a reason for hiding this comment

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

Missing newline.

["git", "checkout", "-b", args.branch_name],
cwd=THEROCK_DIR,
)
component = args.components[0]
Copy link
Member

Choose a reason for hiding this comment

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

I am not confident this works. This only takes the first component but ignores if a user passes a list of components. While this is acceptable for the intended use case, it breaks the script when using it to bump more than one component as far as I see. Either this needs to be addressed properly or the changes for automation must go to it's own script.

Comment on lines +251 to +252
if not shutil.which("gh"):
raise SystemExit("ERROR: --create-pr requires the `gh` CLI.\n")
Copy link
Member

Choose a reason for hiding this comment

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

Eventually check earlier and before creating the commit and pushing the branch?

Copy link
Member

Choose a reason for hiding this comment

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

Yes move that to argument parsing, like here:

args = parser.parse_args()
# Check preconditions for provided arguments before proceeding.
if args.upload:
if not args.run_id:
parser.error("when --upload is true, --run_id must also be set")
if not shutil.which("aws"):
raise FileNotFoundError(
"AWS CLI 'aws' not found on PATH, uploading requires it"
)

We can add an example like that to the style guide if it would help: https://github.com/ROCm/TheRock/blob/main/docs/development/style_guide.md#use-argparse-for-cli-flags

Copy link
Member

@ScottTodd ScottTodd left a comment

Choose a reason for hiding this comment

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

Marking as "reviewed" while there are still open review threads (see the recent comments from Marius)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: TODO

Development

Successfully merging this pull request may close these issues.

5 participants