Skip to content

Commit d48286f

Browse files
authored
docs: tell how to do and request patch releases/backports (bazel-contrib#3185)
We've had several backport requests of late. It's tenable for users to do the more time consuming working of backporting the code, so give steps on how to do so.
1 parent cda5877 commit d48286f

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: "🏗️ Patch release or backport"
3+
about: Request a patch release or backport of a fix to a release.
4+
title: 'Patch release: MAJOR.MINOR.PATCH'
5+
labels: 'type: process'
6+
---
7+
8+
<!--
9+
Thank you for requesting a backport. Before submitting, please read:
10+
11+
* Backport policy: https://rules-python.readthedocs.io/en/latest/support.html#backports-and-patch-releases
12+
-->
13+
14+
**What version of `rules_python` do you want to patch?**
15+
16+
17+
**What pull requests do you want to backport?**
18+
19+
Please provide a list of pull request numbers.
20+
21+
- #
22+
- #

docs/devguide.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,35 @@ to have everything self-documented, we have a special target,
116116
`//private:requirements.update`, which uses `rules_multirun` to run all
117117
of the requirement-updating scripts in sequence in one go. This can be done once per release as
118118
we prepare for releases.
119+
120+
## Creating Backport PRs
121+
122+
The steps to create a backport PR are:
123+
124+
1. Create an issue for the patch release; use the [patch relase
125+
template][patch-release-issue].
126+
2. Create a fork of `rules_python`.
127+
3. Checkout the `release/X.Y` branch.
128+
4. Use `git cherry-pick -x` to cherry pick the desired fixes.
129+
5. Update the release's `CHANGELOG.md` file:
130+
* Add a Major.Minor.Patch section if one doesn't exist
131+
* Copy the changelog text from `main` to the release's changelog.
132+
6. Send a PR with the backport's changes.
133+
* The title should be `backport: PR#N to Major.Minor`
134+
* The body must preserve the original PR's number, commit hash, description,
135+
and authorship.
136+
Use the following format (`git cherry-pick` will use this format):
137+
```
138+
<original PR title>
139+
140+
<original PR body>
141+
(cherry picked from commit <commit hash>)
142+
-----
143+
Co-authored-by: <original PR author; separate lines for each>
144+
```
145+
* If the PR contains multiple backport commits, separate each's description
146+
with `-----`.
147+
7. Send a PR to update the `main` branch's `CHANGELOG.md` to reflect the
148+
changes done in the patched release.
149+
150+
[patch-release-issue]: https://github.com/bazelbuild/rules_python/issues/new?template=patch_release.md

docs/support.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ the willingness of volunteers.
1414
If you want or need particular functionality backported, then the best way
1515
is to open a PR to demonstrate the feasibility of the backport.
1616

17+
### Backports and Patch Releases
18+
19+
Backports and patch releases are provided on a best-effort basis. Only fixes are
20+
backported. Features are not backported.
21+
22+
Backports can be done to older releases, but only if newer releases also have
23+
the fix backported. For example, if the current release is 1.5, in order to
24+
patch 1.4, version 1.5 must be patched first.
25+
26+
Backports can be requested by [creating an issue with the patch release
27+
template][patch-release-issue] or by sending a pull request performing the backport.
28+
See the dev guide for [how to create a backport PR][backport-pr].
29+
30+
[patch-release-issue]: https://github.com/bazelbuild/rules_python/issues/new?template=patch_release_request.md
31+
[backport-pr]: devguide.html#creating-backport-prs
32+
1733
## Supported Bazel Versions
1834

1935
The supported Bazel versions are:

0 commit comments

Comments
 (0)