You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: work/backports.rst
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,11 @@ What next?
32
32
33
33
Now treat ``v23.0.x`` same as you would the default branch (``main``).
34
34
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
+
35
40
4) Create a copy of your ticket branch called ``tickets/DM-XXXXX-v23``.
36
41
37
42
.. code-block:: bash
@@ -75,3 +80,51 @@ What next?
75
80
but please *do not* put your ticket status back into ``In Review`` on Jira.
76
81
77
82
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)
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