Skip to content

Commit 1af3c11

Browse files
authored
Merge pull request #7200 from bluetech/contributing-backporting
CONTRIBUTING: add section about backporting fixes to patch releases
2 parents 0a03217 + b337a9a commit 1af3c11

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

CONTRIBUTING.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,36 @@ should go into ``test_cacheprovider.py``, given that this option is implemented
329329
If in doubt, go ahead and open a PR with your best guess and we can discuss this over the code.
330330

331331

332+
Backporting bug fixes for the next patch release
333+
------------------------------------------------
334+
335+
Pytest makes feature release every few weeks or months. In between, patch releases
336+
are made to the previous feature release, containing bug fixes only. The bug fixes
337+
usually fix regressions, but may be any change that should reach users before the
338+
next feature release.
339+
340+
Suppose for example that the latest release was 1.2.3, and you want to include
341+
a bug fix in 1.2.4 (check https://github.com/pytest-dev/pytest/releases for the
342+
actual latest release). The procedure for this is:
343+
344+
#. First, make sure the bug is fixed the ``master`` branch, with a regular pull
345+
request, as described above. An exception to this is if the bug fix is not
346+
applicable to ``master`` anymore.
347+
348+
#. ``git checkout origin/1.2.x -b backport-XXXX`` # use the master PR number here
349+
350+
#. Locate the merge commit on the PR, in the *merged* message, for example:
351+
352+
nicoddemus merged commit 0f8b462 into pytest-dev:master
353+
354+
#. ``git cherry-pick -x -m1 REVISION`` # use the revision you found above (``0f8b462``).
355+
356+
#. Open a PR targeting ``1.2.x``:
357+
358+
* Prefix the message with ``[1.2.x]``.
359+
* Delete the PR body, it usually contains a duplicate commit message.
360+
361+
332362
Joining the Development Team
333363
----------------------------
334364

0 commit comments

Comments
 (0)