Skip to content

Commit 536d992

Browse files
committed
Add some instructions for fast forward backporting
1 parent 4197822 commit 536d992

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

work/backports.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ What next?
3232
3333
Now treat ``v23.0.x`` same as you would the default branch (``main``).
3434

35+
.. note::
36+
37+
If the release branch (or if it doesn't exist, the release tags) is on a commit that is also on the main branch and your ticket is the first one after that commit, you do not need cherry pick commits onto the release branch and can instead fast forward the release branch.
38+
If this is the case, at this point in the process jump to the :ref:`instructions below <backports-fast-forward>`.
39+
3540
4) Create a copy of your ticket branch called ``tickets/DM-XXXXX-v23``.
3641

3742
.. code-block:: bash
@@ -75,3 +80,51 @@ What next?
7580
but please *do not* put your ticket status back into ``In Review`` on Jira.
7681

7782
7) When a ticket has been backported to all requested releases, label your Jira ticket ``backport-done``.
83+
84+
.. _backports-fast-forward:
85+
86+
What If The Backport Can Be Fast Forwarded?
87+
===========================================
88+
89+
If the parent commit of your backport coincides with the release branch (or release candidate tag) you do not need to cherry pick and instead should fast forward.
90+
For example, in this git example from ``daf_butler`` we would like to backport the fix for DM-52738 to v30:
91+
92+
.. code-block:: bash
93+
94+
* 25fb39d38 - (tag: w.2026.04) Merge pull request #1322 from lsst/tickets/DM-52738 (13 days ago)
95+
|\
96+
| * 10f3bb0b0 - Fix bug in expandDataId with kwargs. (2 weeks ago)
97+
| * c5e14e5e7 - Add convenience iteration method to DatasetRefURIs. (2 weeks ago)
98+
| * f7b71d1fc - Expand data IDs when making predicted paths. (2 weeks ago)
99+
|/
100+
* f58e329d0 - (origin/v30.0.x, v30.0.x, tag: v30.0.0.rc3, tag: 30.0.0) Merge pull request #1321 from lsst/tickets/DM-53844 (2 weeks ago)
101+
102+
We can see that there are no other commits between what we would like to backport and the v30.0.x release branch, making this an ideal candidate for a fast forward merge to the branch.
103+
104+
.. warning::
105+
106+
If you are unsure whether your backport should be done as a fast forward, please ask on Slack in channel ``#dm-build-support``.
107+
108+
Following on from step (3) above having created the release branch and pushed it.
109+
110+
4) At the merge commit on ``main`` of the code you are backporting, create a temporary ticket branch.
111+
112+
.. code-block:: bash
113+
114+
git checkout -b tickets/DM-XXXXX-v23
115+
116+
This branch exists solely to allow Jenkins to be tested as a convenience without having to find a commit ref for the merge to ``main``.
117+
118+
5) Run Jenkins as described above in step (5) using this temporary ticket branch.
119+
120+
6) When Jenkins passes you can now merge your ticket branch directly to the release branch.
121+
122+
.. code-block:: bash
123+
124+
git checkout v23.0.x
125+
git merge --ff-only tickets/DM-XXXXX-v23
126+
git push
127+
git branch -d tickets/DM-XXXXX-v23
128+
129+
We ensure that the merge is a fast forward and this command will fail if it is not.
130+
The ticket branch is not needed and can be deleted.

0 commit comments

Comments
 (0)