Skip to content

Commit e2e9754

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

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

work/backports.rst

Lines changed: 35 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 and the parent commit for this backport request are at the same 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 `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,33 @@ 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+
Following on from step (3) above having created the release branch and pushed it.
91+
92+
4) At the merge commit on ``main`` of the code you are backporting, create a temporary ticket branch.
93+
94+
.. code-block:: bash
95+
96+
git checkout -b tickets/DM-XXXXX-v23
97+
98+
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``.
99+
100+
5) Run Jenkins as described above in step (5) using this temporary ticket branch.
101+
102+
6) When Jenkins passes you can now merge your ticket branch directly to the release branch.
103+
104+
.. code-block:: bash
105+
106+
git checkout v23.0.x
107+
git merge --ff-only tickets/DM-XXXXX-v23
108+
git push
109+
git branch -d tickets/DM-XXXXX-v23
110+
111+
We ensure that the merge is a fast forward and this command will fail if it is not.
112+
The ticket branch is not needed and can be deleted.

0 commit comments

Comments
 (0)