Repository navigation
Split backporting policy from the practical guide #1930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
aryanbarde80
wants to merge
5
commits into
python:main
Choose a base branch
from
aryanbarde80:docs/1831-backport-policy-guide
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+104
−98
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
57108f0
Clarify CPython backport policy
aryanbarde80 6339c9b
Add dedicated backporting guide
aryanbarde80 dff1e45
List backporting guide in contents
aryanbarde80 336b75e
Move backport procedure to dedicated guide
aryanbarde80 c232a2d
Remove unrelated whitespace in getting started index
aryanbarde80 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| .. _backporting: | ||
| .. _branch-merge: | ||
|
|
||
| Backporting merged changes | ||
| ========================== | ||
|
|
||
| After a pull request has been merged into ``main``, it may need to be backported | ||
| to one or more :ref:`maintenance <maintbranch>` or :ref:`security <secbranch>` | ||
| branches. The project's backport policy is described in the | ||
| :ref:`development cycle guide <maintbranch>`. | ||
|
|
||
| The :samp:`needs backport to {X.Y}` labels on a pull request indicate which | ||
| versions should receive a backport. ``miss-islington`` will automatically | ||
| attempt to create backport pull requests for the versions indicated by these | ||
| labels. If it cannot create a backport pull request because of conflicts, use | ||
| the :pypi:`cherry-picker` tool to create the backport and resolve the conflicts | ||
| manually. | ||
|
|
||
| You need the commit hash of the squashed commit that was merged into ``main``. | ||
| ``miss-islington`` should post a comment when it is unable to create the | ||
| backport automatically, including the full command and commit hash. If that | ||
| comment is not posted, look for an event on the merged pull request similar to: | ||
|
|
||
| .. code-block:: text | ||
|
|
||
| <core_developer> merged commit <commit_sha1> into python:main <sometime> ago. | ||
|
|
||
| By following the link to ``<commit_sha1>``, you can get the full commit hash. | ||
|
|
||
| Alternatively, you can obtain the commit hash with these Git commands:: | ||
|
|
||
| $ git fetch upstream | ||
| $ git rev-parse ":/gh-<PR number>" | ||
|
|
||
| These commands print the hash of the commit whose message contains | ||
| ``gh-<PR number>``. | ||
|
|
||
| Use the commit hash and the :pypi:`cherry-picker` tool to create the backport. | ||
| In the following command, ``<branch>`` is the target maintenance branch (for | ||
| example, ``3.12``): | ||
|
|
||
| .. code-block:: text | ||
|
|
||
| $ cherry_picker <commit_sha1> <branch> | ||
|
|
||
| Follow the instructions provided. You may need to identify files with | ||
| conflicts, fix them, and build and run applicable tests. When you are finished, | ||
| stage all modified files and run ``cherry_picker --continue`` to push the | ||
| backport. | ||
|
|
||
| The tool usually generates the commit message automatically. If it does not, | ||
| keep the original commit message unchanged, except for removing the backport | ||
| pull request number (``(#XXXXX)``), and append a | ||
| ``(cherry picked from commit <commit_sha1>)`` line. | ||
|
|
||
| The format of a correct backport commit message is: | ||
|
|
||
| .. code-block:: text | ||
| :class: good | ||
|
|
||
| [<branch>] gh-XXXXX: <original commit title> (GH-XXXXX) | ||
|
|
||
| <original commit body> | ||
|
|
||
| (cherry picked from commit <commit_sha1>) | ||
|
|
||
| Here ``gh-XXXXX`` is the GitHub *issue* number, and ``(GH-XXXXX)`` is the | ||
| original *pull request* number. | ||
|
|
||
| An example of a bad backport commit message: | ||
|
|
||
| .. code-block:: text | ||
| :class: bad | ||
|
|
||
| gh-XXXXX: Custom title (GH-XXXXX) (#XXXXX) | ||
|
|
||
| * Custom message | ||
|
|
||
| When opening the backport pull request, its title must follow the same format | ||
| as the commit title, beginning with the ``[<branch>]`` prefix and referencing | ||
| the original pull request with a ``(GH-XXXXX)`` suffix. For example: | ||
|
|
||
| .. code-block:: text | ||
| :class: good | ||
|
|
||
| [3.15] gh-12345: Fix the spam module (GH-24680) | ||
|
|
||
| After the backport pull request is opened, ``miss-islington`` will link it to | ||
| the original pull request and remove the corresponding backport label. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a new file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue asks for the backport policy and the practical guide to be separate. This page holds the moved step-by-step procedure so it can be found independently in Getting Started; the Git boot camp now points readers here. I also removed the incidental blank-line changes from the index.