Skip to content

Add release tag and GitHub release automation script for TheRock and ROCm submodules#51

Open
amd-chiranjeevi wants to merge 4 commits into
mainfrom
users/amd-chiranjeevi/rel_tagging_script
Open

Add release tag and GitHub release automation script for TheRock and ROCm submodules#51
amd-chiranjeevi wants to merge 4 commits into
mainfrom
users/amd-chiranjeevi/rel_tagging_script

Conversation

@amd-chiranjeevi

Copy link
Copy Markdown
Contributor

Motivation

After release branches are cut, annotated tags and GitHub releases need to be created across TheRock and all its tracked ROCm submodules. Doing this manually for every submodule is tedious and error-prone. This script automates tagging, tarball generation for mono-repos, and GitHub release creation in a single run.>

Technical Details

  1. Implemented as RockTagging class with two phases: plan building [build_plan_from_rock_submodules] and plan execution [execute_plan]
  2. Plan building clones/caches TheRock, hard-resets to the target commit, populates submodules via fetch_sources.py (fallback: git submodule update), and parses .gitmodules+ git submodule status to produce a per-repo plan. Non-ROCm repos and --exclude-listentries are filtered out.
  3. Execution iterates each repo in a single loop: sets up a rocm-github remote, creates an annotated tag (therock-) at the recorded commit (skips if tag exists), and pushes + creates a GitHub release via gh release create (unless dry-run).
  4. For mono-repos (rocm-libraries, rocm-systems), generates per-directory .tar.gz tarballs from projects and [hared and attaches them as release assets. Tarballs are created even in dry-run mode.
  5. SupportsSSH authentication.
  6. Dry-run enabled by default --no-dry-run enables pushes and release creation).

Test Plan

  1. Syntax validation: python3 -c "import py_compile; py_compile.compile('rock-tagging.py', doraise=True)"
  2. Dry-run against a known TheRock commit — verify plan generation, tag creation logic, tarball generation for mono-repos, and pre-existing tag detection.
  3. Verify --exclude-list, --cache-dir, and --force-clone options behave as expected.
  4. End-to-end with --no-dry-run on a test fork to confirm tags are pushed and GitHub releases are created with tarball assets attached.

Test Result

  1. Script compiles without errors.
  2. Dry-run produces correct plan; tarballs are generated for mono-repo projects and shared directories; pre-existing tags are detected and skipped.
  3. Excluded and non-ROCm repos are filtered from the plan.
  4. Cached clone reuse works across repeated runs. --force-clone and --cache-dir work as expected.

@amd-chiranjeevi

Copy link
Copy Markdown
Contributor Author

Hi @araravik-psd
I've moved code from the PR #37 to this new PR. @srayasam-amd not available in this project anymore.
please review and let me know the changes needed.

@amd-chiranjeevi amd-chiranjeevi changed the title add release tagging script Add release tag and GitHub release automation script for TheRock and ROCm submodules Jun 8, 2026

@araravik-psd araravik-psd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @amd-chiranjeevi, I left a few review comments. Since the current test plan is fully manual, it would be worth adding unit tests with mocked subprocess calls for build_plan, execute_plan, convert_to_ssh, and get_submodule_url_map. Could we open a follow-up issue to track these tests?

Comment thread scripts/rock_tagging.py
)
parser.add_argument(
"-B",
"--branch-name",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see branch-name is collected in the script, but dont see it getting used in the script?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Comment thread scripts/rock_tagging.py Outdated
],
cwd=info.path,
)
successful_components[comp] = info

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

comp is added to successful_components here, before gh release create is attempted. If release creation fails below, it gets added to failed_components too, so it appears in both — and the final summary counts it as succeeded. Move this line to after the release creation block, or remove it from successful_components in the release creation except handler.

Comment thread scripts/rock_tagging.py
f"Cloning TheRock repo from {self.rock_url} into {clone_dir}"
)
self.run_command(
["git", "clone", str(self.rock_url), str(clone_dir)],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No subprocess timeouts, a hung git clone or git fetch will block indefinitely, which is risky in CI if we have it in a workflow, can we add timeouts for clone or fetch throughout the file?

@amd-chiranjeevi

Copy link
Copy Markdown
Contributor Author

Hi @amd-chiranjeevi, I left a few review comments. Since the current test plan is fully manual, it would be worth adding unit tests with mocked subprocess calls for build_plan, execute_plan, convert_to_ssh, and get_submodule_url_map. Could we open a follow-up issue to track these tests?

yeah, I opened a followup Issue #66 , will add changes in followup PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants