Repository navigation
[ci] Centralize CI constants via ci-env composite action - #7262
Merged
Merged
Conversation
KKyang
force-pushed
the
users/kkyang/ci-env-centralize
branch
from
May 14, 2026 13:55
f411278 to
84b7f8e
Compare
KKyang
commented
May 14, 2026
geomin12
reviewed
May 14, 2026
geomin12
left a comment
Collaborator
There was a problem hiding this comment.
thanks for cleanup! i see merge conflicts and also added two comments
Add .github/actions/ci-env/ as single source of truth for TheRock commit ref, Docker image, and runner labels. All workflows and composite actions now read from ci-env instead of hardcoding these values, reducing update points from 10+ to 1.
KKyang
force-pushed
the
users/kkyang/ci-env-centralize
branch
from
May 15, 2026 03:55
84b7f8e to
24fdc63
Compare
KKyang
enabled auto-merge (squash)
May 15, 2026 13:09
geomin12
approved these changes
May 19, 2026
geomin12
left a comment
Collaborator
There was a problem hiding this comment.
lgtm thanks! the bot that creates PR will need to be updated as well, and soon we will migrate over to multi-arch CI, meaning these workflows will be obsolete
aledudek
pushed a commit
that referenced
this pull request
May 20, 2026
## Summary - Add `.github/actions/ci-env/` as a single source of truth for shared CI constants: TheRock commit ref, Docker image, and runner labels - All workflows (`therock-ci`, `therock-ci-linux`, `therock-ci-windows`, `therock-ci-nightly`, `stinkytofu-ci`, `rocisa-ci`) and composite actions (`setup-rocm-linux`, `setup-rocm-windows`) now read from `ci-env` instead of hardcoding these values - Reduces update points from 10+ locations to 1 file when bumping TheRock hash or changing Docker image/runners - Also updates TheRock ref from `70a6335b` (2026-05-03) to `1372b254` (2026-05-08) for therock-ci workflows ## Test plan - [x] Verify stinkytofu-ci workflow runs successfully on both Linux and Windows - [x] Verify rocisa-ci workflow runs successfully on both Linux and Windows - [ ] Verify therock-ci workflow passes setup, build, and test stages 🤖 Generated with [Claude Code](https://claude.com/claude-code)
ScottTodd
reviewed
May 27, 2026
ScottTodd
left a comment
Member
There was a problem hiding this comment.
This missed a few workflows like
rocm-libraries/.github/workflows/therock-test-component.yml
Lines 69 to 73 in 6a2e2cc
This was referenced May 27, 2026
amd-justchen
added a commit
that referenced
this pull request
May 28, 2026
This restores the single-source-of-truth model from #7262 that was partially reverted by #7626. It also closes the remaining gap from #7262 by routing the reusable test workflows through the centralized `therock_ref` path, while preserving the intended TheRock ref at `e44b42bbcc7452328ccf12bcac319bda5ede4a6a` (2026-05-20). - **Centralize the current TheRock ref** - Update `.github/actions/ci-env/action.yml` to hold the current TheRock commit. - Make `ci-env` the only literal TheRock SHA under `.github/`. - **Remove hardcoded refs from top-level TheRock workflows** - Restore `therock-ci.yml` and `therock-ci-nightly.yml` to read the ref from `steps.ci-env.outputs.therock-ref`. - Restore `therock-ci-linux.yml` and `therock-ci-windows.yml` to use their existing `inputs.therock_ref` instead of hardcoded SHAs. - **Close the missed reusable-workflow gap** - Add required `therock_ref` inputs to: - `.github/workflows/therock-test-packages.yml` - `.github/workflows/therock-test-component.yml` - Replace their hardcoded TheRock checkout refs with `${{ inputs.therock_ref }}`. - **Thread `therock_ref` through the reusable workflow chain** - Pass `therock_ref` from `therock-ci-linux.yml` / `therock-ci-windows.yml` into `therock-test-packages.yml`. - Pass `therock_ref` from `therock-test-packages.yml` into `therock-test-component.yml`. Example of the restored pattern: ```yaml - name: Load CI environment id: ci-env uses: ./.github/actions/ci-env - name: Checkout TheRock repository uses: actions/checkout@... with: repository: "ROCm/TheRock" ref: ${{ steps.ci-env.outputs.therock-ref }} ``` <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> ## Background PR [#7262](#7262) introduced `.github/actions/ci-env/action.yml` as the single source of truth for shared CI constants (TheRock commit ref, Docker image, runner labels). All TheRock workflows were supposed to read the TheRock ref from `ci-env` instead of hardcoding it. Two follow-up bumps highlighted gaps: - PR [#7582](#7582) correctly bumped the ref by editing only `.github/actions/ci-env/action.yml` (one file). This is the intended workflow. - PR [#7626](#7626) ("Update TheRock reference to e44b42b") regressed this. It hardcoded `e44b42bbcc7452328ccf12bcac319bda5ede4a6a # 2026-05-20 commit` directly into six workflow files, effectively reverting the centralization for those files. Scott Todd called this out on #7626: > "Why was this merged? This reverted the changes from #7262 by @KKyang (cc @geomin12)" ([review comment](#7626 (comment))) Additionally, two workflow files were **never** centralized as part of #7262 — they still contained a hardcoded TheRock ref even before #7626: - `.github/workflows/therock-test-component.yml` - `.github/workflows/therock-test-packages.yml` These are reusable workflows invoked transitively from `therock-ci-linux.yml` / `therock-ci-windows.yml`, so the `therock_ref` input needs to be threaded through them. ## Goal Fully implement the intent of #7262 by: 1. Updating `.github/actions/ci-env/action.yml` so it holds the current ref (`e44b42bbcc7452328ccf12bcac319bda5ede4a6a` from 2026-05-20). This preserves the actual ref that #7626 wanted to land. 2. Removing all the hardcoded TheRock refs reintroduced by #7626 and routing them back through `ci-env`. 3. Closing the gaps left over from #7262 by also routing `therock-test-component.yml` and `therock-test-packages.yml` through `ci-env`. After this PR, there should be **exactly one** literal occurrence of a TheRock commit SHA under `.github/`, and it should live in `.github/actions/ci-env/action.yml`. ## Required changes Base this PR on the current `develop` branch. ### 1. `.github/actions/ci-env/action.yml` Set the `therock-ref` output value to the 2026-05-20 commit: ```yaml outputs: therock-ref: description: "TheRock commit hash to use" value: "e44b42bbcc7452328ccf12bcac319bda5ede4a6a" # 2026-05-20 ``` (Leave `docker-image`, `linux-runner`, `windows-runner` untouched.) ### 2. `.github/workflows/therock-ci.yml` The `setup` job's "Checkout TheRock repository" step currently has: ```yaml ref: e44b42bbcc7452328ccf12bcac319bda5ede4a6a # 2026-05-20 commit ``` Restore it to: ```yaml ref: ${{ steps.ci-env.outputs.therock-ref }} ``` (This was the form merged in #7262 and reverted by #7626.) ### 3. `.github/workflows/therock-ci-nightly.yml` Same fix as `therock-ci.yml` — the `setup` job's "Checkout TheRock repository" step must use `${{ steps.ci-env.outputs.therock-ref }}` instead of the hardcoded `e44b42b...` SHA. ### 4. `.github/workflows/therock-ci-linux.yml` The build job's "Checkout TheRock repository" step currently has: ```yaml ref: e44b42bbcc7452328ccf12bcac319bda5ede4a6a # 2026-05-20 commit ``` Restore it to: ```yaml ref: ${{ inputs.therock_ref }} ``` The `therock_ref` workflow input is already declared at the top of this file — just use it. ### 5. `.github/workflows/therock-ci-windows.yml` Same fix as `therock-ci-linux.yml`: change the hardcoded `ref:` in the "Checkout TheRock repository" step to `${{ inputs.therock_ref }}`. The input is already declared. ### 6. `.github/workflows/therock-test-packages.yml` (gap from #7262) This reusable workflow has a hardcoded ref on the "Checking out repository" step: ```yaml ref: e44b42bbcc7452328ccf12bcac319bda5ede4a6a # 2026-05-20 commit ``` Changes: - Add a new required `therock_ref` string input to `on.workflow_call.inputs` (alongside the existing `projects_to_test`, `amdgpu_families`, `test_runs_on`, `platform`, `test_type`). - Replace the hardcoded `ref:` with `${{ inputs.therock_ref }}`. - When this workflow calls `./.github/workflows/therock-test-component.yml`, pass `therock_ref: ${{ inputs.therock_ref }}` through in the `with:` block. ### 7. `.github/workflows/therock-test-component.yml` (gap from #7262) This reusable workflow has a hardcoded ref on its "Checkout Repository" step: ```yaml ref: e44b42bbcc7452328ccf12bcac319bda5ede4a6a # 2026-05-20 commit ``` Changes: - Add a new required `therock_ref` string input to `on.workflow_call.inputs`. - Replace the hardcoded `ref:` with `${{ inputs.therock_ref }}`. ### 8. Wire `therock_ref` through the call chain `therock-ci-linux.yml` and `therock-ci-windows.yml` both call `./.github/workflows/therock-test-packages.yml` via `uses:` in their `therock-test-linux` / `therock-test-windows` jobs. Update those `with:` blocks to also pass: ```yaml therock_ref: ${{... </details> <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created from Copilot chat.* > --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JC <justchen@amd.com>
This was referenced Jun 4, 2026
tony-davis
added a commit
that referenced
this pull request
Jun 9, 2026
The TheRock ref is centralized in .github/actions/ci-env/action.yml (the single source of truth from #7262), but therock_configure_ci.py only treated .github/workflows/ and .github/scripts/ changes as CI-relevant. As a result, a ref bump that edits only ci-env/action.yml did not trigger the full build/test matrix that validates it. Add .github/actions/ci-env/ as a CI-relevant path so centralized ref bumps exercise CI.
1 of 2 tasks
archana-ramalingam
added a commit
to ROCm/TheRock
that referenced
this pull request
Jun 19, 2026
…es (#5620) ## Summary Fix the bump automation bot to update the centralized CI environment action instead of modifying individual workflow files for rocm-libraries. ## Technical Details ROCm/rocm-libraries#7262 centralized TheRock ref pin into `.github/actions/ci-env/action.yml` The bump automation bot was still hardcoded to update 6 workflow files that no longer contain direct `ref:` fields, causing PRs like ROCm/rocm-libraries#8014 The ci-env action file uses a different YAML structure (`therock-ref:` → `value: "<sha>"`) than workflow files (`repository: "ROCm/TheRock"` → `ref: <sha>`), so a new updater function is needed. Changes: - `ROCM_LIBRARIES_FILES`: replaced 6 workflow paths with single `".github/actions/ci-env/action.yml"` - `SUBMODULE_CONFIG`: added `"updater"` key (`"ref"` for rocm-systems, `"ci-env"` for rocm-libraries) - `update_ci_env_file()`: new function that finds `therock-ref:` block and updates the `value:` line - `handle_push()`: selects updater function based on config instead of always calling `update_ref_in_file()` - Fix blank-line edge case in `update_ci_env_file()` where empty lines between `description:` and `value:` caused a silent skip - Replace deprecated `datetime.utcnow()` with `datetime.now(timezone.utc)` (both updater functions) ## Test Plan - [ ] Merge and verify the next bot-generated rocm-libraries bump PR touches only `ci-env/action.yml` - [ ] Verify the next rocm-systems bump PR still works (unchanged code path) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
tony-davis
added a commit
that referenced
this pull request
Jun 25, 2026
## Summary The TheRock commit pin is centralized in `.github/actions/ci-env/action.yml` (the single source of truth introduced by #7262). But `therock_configure_ci.py` only treated `.github/workflows/` and `.github/scripts/` changes as CI-relevant, so a ref bump that edits **only** `ci-env/action.yml` wasn't detected as CI-relevant — meaning it didn't trigger the full build/test matrix that validates the new ref (only the basic checks ran). This teaches `is_path_workflow_file_related_to_ci` to also treat `.github/actions/ci-env/action.yml` as CI-relevant, so centralized TheRock ref bumps exercise the full project matrix again. ## Changes - `.github/scripts/therock_configure_ci.py`: add `GITHUB_ACTIONS_CI_PATTERNS = ["ci-env/action.yml"]` and a `.github/actions/` clause to `is_path_workflow_file_related_to_ci`. (The `.github/workflows/` + `.github/scripts/` checks are refactored into a single prefix loop — behaviorally identical.) - `.github/scripts/tests/therock_configure_ci_test.py`: extend `test_is_path_workflow_file_related_to_ci` to assert `ci-env/action.yml` is CI-relevant and that an unrelated action path (`setup-rocm-linux/action.yml`) is not. ## Background This is the one still-needed piece carved out of the now-closed #8014 (a TheRock ref bump that was overcome by events once #8196 bumped `develop` directly). The bump portion of #8014 is obsolete, but this trigger fix is not yet on `develop`. ## Test plan - [x] `is_path_workflow_file_related_to_ci` unit test updated (syntax-checked locally; full suite runs in CI). - [ ] Confirm a subsequent ci-env-only ref bump triggers the full matrix. --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/actions/ci-env/as a single source of truth for shared CI constants: TheRock commit ref, Docker image, and runner labelstherock-ci,therock-ci-linux,therock-ci-windows,therock-ci-nightly,stinkytofu-ci,rocisa-ci) and composite actions (setup-rocm-linux,setup-rocm-windows) now read fromci-envinstead of hardcoding these values70a6335b(2026-05-03) to1372b254(2026-05-08) for therock-ci workflowsTest plan
🤖 Generated with Claude Code