|
| 1 | +--- |
| 2 | +id: fork.upstream-sync |
| 3 | +summary: Classify local fixes from a version-sync branch before forwarding them to main. |
| 4 | +kind: procedure |
| 5 | +status: active |
| 6 | +load_when: Reviewing a large upstream version merge or deciding which release fixes to forward-port to main |
| 7 | +sources: |
| 8 | + - docsite/docs/releases/minor-release.md |
| 9 | + - https://github.com/microsoft/react-native-macos/pull/3022#discussion_r3719817893 |
| 10 | + - https://github.com/microsoft/react-native-macos/pull/3022#discussion_r3722730469 |
| 11 | + - https://github.com/microsoft/react-native-macos/pull/3099 |
| 12 | +verified: 2026-10-29 |
| 13 | +rules: [classify-each-fix, verify-target-branch, preserve-branch-config] |
| 14 | +related: [fork.diff-tags, fork.ownership, process.pull-requests] |
| 15 | +--- |
| 16 | + |
| 17 | +<!-- @format --> |
| 18 | + |
| 19 | +# Forward-porting release fixes |
| 20 | + |
| 21 | +Use when: you review local fixes on a version-sync branch and decide what belongs on `main`. Not for: merging upstream itself; follow the [minor-release procedure](../../../docsite/docs/releases/minor-release.md). |
| 22 | + |
| 23 | +## Rules |
| 24 | + |
| 25 | +- **fork.upstream-sync.classify-each-fix:** Classify every locally authored fix against the exact target branch; don't forward-port a whole release branch or infer applicability from a commit subject. |
| 26 | +- **fork.upstream-sync.verify-target-branch:** Inspect the target branch's implementation and later merge branches before proposing a forward-port; cite the commit, file, or call site that supports the classification. |
| 27 | +- **fork.upstream-sync.preserve-branch-config:** Keep release-specific configuration on its release branch and verify target-branch settings before copying config changes. |
| 28 | + |
| 29 | +## Procedure |
| 30 | + |
| 31 | +1. Identify the locally authored commits in the sync PR, separately from imported upstream history. Use the merge base and inspect the PR's local commits. |
| 32 | +2. Classify each local fix as one of: |
| 33 | + - Already present on `main`: cite the matching commit or implementation. |
| 34 | + - Already fixed in a later merge branch: cite that branch and fix; don't duplicate it. |
| 35 | + - Applicable to `main`: propose a separate forward-port PR, and note its dependencies or stack. |
| 36 | + - Release-only: keep version bumps and branch-specific release configuration on the stable branch. |
| 37 | + - Not applicable: the target has no corresponding file, implementation, or call site; don't invent one just to carry the patch. |
| 38 | +3. Split commits that mix categories when needed. For each decision, inspect the target branch itself and any relevant later merge branch; don't treat an open PR as already merged. |
| 39 | +4. Verify configuration against the target. For example, Changesets `baseBranch` is `origin/0.83-stable` on that stable branch and `origin/main` on `main`. |
| 40 | +5. Run the relevant checks on each forward-port target. Report the classification, evidence, validation, and any unmerged follow-up. |
| 41 | + |
| 42 | +## Facts |
| 43 | + |
| 44 | +- The 0.83 sync review in [#3022](https://github.com/microsoft/react-native-macos/pull/3022) separated changes already in `main`, fixes to forward-port, stable-only changes, fixes already present in later merge branches, and changes with no matching implementation. The review also kept the stable Changesets base branch distinct from `main`. |
| 45 | +- In [#3099](https://github.com/microsoft/react-native-macos/pull/3099), shared fixes were submitted separately to `main`; the review tracked that they were not yet merged rather than calling them landed. |
| 46 | + |
| 47 | +## Pitfalls |
| 48 | + |
| 49 | +- A fix present in a later `*-merge` branch may not belong on `main` yet; trace where the behavior first applies and whether it is already guarded. |
| 50 | +- An open forward-port PR is not evidence that the fix has landed. Track its status and stack explicitly. |
| 51 | +- A stable-only setting such as Changesets `baseBranch` can break `main` if copied without checking its branch-specific value. |
0 commit comments