Skip to content

Commit 863406a

Browse files
committed
Update contributing guide to include info on backports
1 parent a3bc47a commit 863406a

2 files changed

Lines changed: 68 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 65 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [Pull request size](#pull-request-size)
1313
* [Definition of Done](#definition-of-done)
1414
* [A deliverable is to be considered “done” when](#a-deliverable-is-to-be-considered-done-when)
15+
* [Backports](#backports)
1516
* [AI assistants](#ai-assistants)
1617
* [“Mark” code with substantial AI-generated portions.](#mark-code-with-substantial-ai-generated-portions)
1718
* [Copyright and licence notices](#copyright-and-licence-notices)
@@ -110,7 +111,11 @@ Happy hacking!
110111

111112
## PR description
112113

113-
* Jira ticket needs to be added into PR title, for example: `LCORE-740: type hints for models unit tests`
114+
* PR titles must start with a JIRA issue key prefix or the target branch of a backport in brackets. CI enforces this via
115+
`pr-title-checker` (config: `.github/pr-title-checker-config.json`).
116+
Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`,
117+
`CWFHEALTH-`, `[release/`
118+
- for example: `LCORE-740: type hints for models unit tests`
114119
* Fill-in all relevant information in the PR template
115120
- unused parts of PR template (like information about testing etc.) can be deleted
116121
* Please note that CodeRabbitAI will create a summary of your pull request
@@ -160,6 +165,61 @@ Happy hacking!
160165

161166

162167

168+
## Backports
169+
170+
We use [cherry_picker](https://pypi.org/project/cherry-picker/) to backport
171+
merged pull requests to release branches. See the
172+
[cherry_picker documentation](https://cherry-picker.readthedocs.io/) for full
173+
details.
174+
175+
### Installation
176+
177+
```bash
178+
pip install --user cherry_picker
179+
```
180+
181+
### Usage
182+
183+
After a pull request has been merged to `main`, you can backport it to one or
184+
more release branches:
185+
186+
```bash
187+
# backport to a single release branch
188+
cherry_picker <commit-sha> release/0.6
189+
190+
# backport to multiple release branches
191+
cherry_picker <commit-sha> release/0.5 release/0.6
192+
```
193+
194+
`cherry_picker` will create a new branch, cherry-pick the commit, and open a
195+
pull request against the target release branch.
196+
197+
If the commit you want to backport is a **merge commit**, append `^-` to the
198+
hash so that `cherry_picker` applies the correct parent diff:
199+
200+
```bash
201+
cherry_picker <merge-commit-sha>^- release/0.6
202+
```
203+
204+
If there are conflicts, `cherry_picker` will pause and let you resolve them.
205+
After resolving:
206+
207+
```bash
208+
git add .
209+
cherry_picker --continue
210+
```
211+
212+
To abort a backport in progress:
213+
214+
```bash
215+
cherry_picker --abort
216+
```
217+
218+
See the [branching documentation](docs/branching.md) for more details on our
219+
branching strategy and release workflow.
220+
221+
222+
163223
## Definition of Done
164224

165225
### A deliverable is to be considered “done” when
@@ -182,7 +242,7 @@ Happy hacking!
182242
Nontrivial and substantial AI-generated or AI-assisted content should be
183243
“marked” in appropriate cases. In deciding how to approach this, consider
184244
adopting one or more of the following recommendations. (This assumes you have
185-
not concluded that a suggestion is a match to some existing third-party code.)
245+
not concluded that a suggestion is a match to some existing third-party code.)
186246

187247
In a commit message, or in a pull request/merge request description field,
188248
identify the code assistant that you used, perhaps elaborating on how it was
@@ -332,14 +392,14 @@ Here is simple example:
332392
```python
333393
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
334394
"""Example function with PEP 484 type annotations.
335-
395+
336396
Args:
337397
param1: The first parameter.
338398
param2: The second parameter.
339-
399+
340400
Returns:
341401
The return value. True for success, False otherwise.
342-
402+
343403
Raises:
344404
ValueError: If the first parameter does not contain proper model name
345405
"""

docs/branching.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ branch history. Key points:
267267
- Resolve any merge conflicts, then `git add` and `git cherry-pick --continue`.
268268
Test, review, and push the resulting commit into the release branch.
269269

270+
We use `cherry_picker` to automate this process. See the
271+
[contributing guide](../CONTRIBUTING.md#backports) for usage instructions.
272+
270273
NOTE: the cherry picking can be made in main -> release branch direction or
271274
vice versa. We prefer the first method when possible.
272275

0 commit comments

Comments
 (0)