Repository navigation
[docs] How to cherry-pick to pre-monorepo branches #221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bstefanuk
merged 7 commits into
ROCm:develop
from
bstefanuk:how-to-cherry-pick-for-rocm-70
Jun 18, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
556d25d
docs: how to cherry-pick
bstefanuk 0dace60
docs: fix duplicated section
bstefanuk 4a7c07e
docs: swap cherry-pick location
bstefanuk c7b0dc9
docs: add DRAFT admonition
bstefanuk 0dcd86a
docs: add DRAFT admonition fix
bstefanuk de368b6
docs: fix line break in faq
bstefanuk 5d5f1b6
docs: fix line break in faq 2
bstefanuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
docs/how-to-cherry-pick-monorepo-changes-to-release-staging.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # How to cherry-pick monorepo changes into release-staging branches | ||
|
|
||
| > [!IMPORTANT] | ||
| > This document is currently in **draft** and may be subject to change. | ||
|
|
||
| When a project has been migrated into the ROCm monorepo, day-to-day work happens on the monorepo’s `develop` branch. | ||
| Down-stream teams, however, still consume the original (pre-monorepo) repositories, particularly their `release-staging/rocm-rel-x.y` branches, through a variety of mechanisms. | ||
|
bstefanuk marked this conversation as resolved.
Resolved
|
||
| This document explains how to move a change from the monorepo into those release-staging branches while guaranteeing that every commit on a release-staging branch also exists in the monorepo. | ||
|
|
||
| ## 1. Land the change in the monorepo's develop branch | ||
|
|
||
| 1. Create a pull request in `ROCm/rocm-libraries` that targets `develop`. | ||
| 2. When merging, choose **Squash & Merge** (if the change can be represented as a single logical commit). | ||
| Why? A single commit is easier to cherry-pick later. | ||
|
|
||
| Result: The commit is now on `ROCm/rocm-libraries:develop`. | ||
|
|
||
| ## 2. Cherry-pick into the monorepo's release-staging branch | ||
|
|
||
| 1. Create a local branch based on the release-staging branch: | ||
|
|
||
| ``` | ||
| $ git checkout -b cherry-pick-foo-rel-x.y origin/release-staging/rocm-rel-x.y | ||
| ``` | ||
|
|
||
| 2. Cherry-pick the commit: | ||
|
|
||
| ``` | ||
| $ git cherry-pick abcd1234 | ||
| ``` | ||
|
|
||
| 3. Resolve any merge conflicts (rare if the branch is close to develop). | ||
| 4. Push the branch and open a PR that targets `ROCm/rocm-libraries:release-staging/rocm-rel-x.y`. | ||
| 5. Request reviews, obtain approvals, and merge. | ||
|
|
||
| ## 3. Wait for the automatic “fan-out” sync | ||
|
|
||
| Every ~15 minutes, a CI job copies new commits from the monorepo back into the corresponding standalone repositories. | ||
|
|
||
| After merging your PR: | ||
|
|
||
| 1. Monitor the CI job or simply wait ~15 minutes. | ||
| 2. Go to the original (pre-monorepo) repository and verify the commits have been reflected onto the `develop` and `release-staging/rocm-rel-x.y` branches. | ||
|
|
||
| ## FAQ | ||
|
|
||
| Q : Can I cherry-pick multiple commits at once? | ||
| A : Yes, but prefer a squash merge in the monorepo so you only need to pick one. | ||
|
|
||
| Q : What if the auto-sync hasn’t copied the commit? | ||
| A : Verify the CI status in `rocm-libraries`. If failed, ask the infra team; the commit will re-sync after a successful run. | ||
|
|
||
|
bstefanuk marked this conversation as resolved.
Resolved
|
||
| Q : Can I push directly to the release-staging branch? | ||
| A : No. Always go through a PR so CI and reviewers can validate the cherry-pick. | ||
|
|
||
|
bstefanuk marked this conversation as resolved.
Resolved
|
||
| Q : What if commits have been pushed to develop that make a cherry-pick incompatible with release-staging? | ||
| A : It's likely that this fix/change will also be landed in develop at some point, else we risk divergent features/support. So, it's recommended to still land the change in develop first, and cherry-pick to release-staging, resolving any merge conflicts that arise. If for some reason the develop branch has diverged so far from the release-staging for your component that a cherry-pick is irreconcilable, land the changes in develop and release-staging using fully separate PRs, and add references to the other for traceability. | ||
|
|
||
| ## Summary | ||
|
|
||
| In short: | ||
|
|
||
| 1. Merge change to monorepo `develop`. | ||
| 2. Cherry-pick to monorepo `release-staging/rocm-rel-x.y`. | ||
| 3. Wait for the fan-out sync and verify the changes are reflected in the original repository. | ||
|
|
||
|
bstefanuk marked this conversation as resolved.
Resolved
|
||
| Following this process keeps release branches in sync with the monorepo while allowing critical fixes to flow to down-stream consumers. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.