Skip to content

Commit 4861ba6

Browse files
authored
Merge pull request #2164 from samdoran/prefixes
Add cherry_picker config and update valid prefixes
2 parents 58cc513 + 863406a commit 4861ba6

7 files changed

Lines changed: 97 additions & 13 deletions

File tree

.cherry_picker.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
team = "lightspeed-core"
2+
repo = "lightspeed-stack"
3+
check_sha = "ea5de69d94e33aa2a75a622fec455bc4b0fa6c6b"
4+
fix_commit_msg = false
5+
default_branch = "main"

.github/pr-title-checker-config.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44
"color": "EEEEEE"
55
},
66
"CHECKS": {
7-
"prefixes": ["LCORE-", "RSPEED-", "MGTM-", "OLS-", "RHIDP-", "LEADS-", "CWFHEALTH-"]
7+
"prefixes": [
8+
"LCORE-",
9+
"RSPEED-",
10+
"MGTM-",
11+
"OLS-",
12+
"RHIDP-",
13+
"LEADS-",
14+
"CWFHEALTH-",
15+
"[release/"
16+
]
817
},
918
"MESSAGES": {
1019
"success": "All OK",

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ uv run make test-e2e # End-to-end tests
385385

386386
**PR titles MUST start with a JIRA issue key prefix.** CI enforces this via `pr-title-checker` (config: `.github/pr-title-checker-config.json`).
387387

388-
Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHDHPAI-`, `LEADS-`
388+
Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`, `CWFHEALTH-`, `[release/`
389389

390390
-`RSPEED-2849: add user_agent to ResponsesEventData`
391391
-`feat(observability): add user_agent to ResponsesEventData`

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

docs/demos/lcore/contributing_guidelines.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ ptisnovs@redhat.com
7474

7575
## PR description
7676

77-
* Jira ticket needs to be added into PR title
77+
* PR titles must start with a JIRA issue key prefix. CI enforces this via
78+
`pr-title-checker` (config: `.github/pr-title-checker-config.json`).
79+
Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`,
80+
`CWFHEALTH-`, `[release/`
7881
- for example: `LCORE-740: type hints for models unit tests`
7982
* Fill-in all relevant information in the PR template
8083
- unused parts of PR template (like information about testing etc.) can be deleted

docs/devel_doc/contributing_guide.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ Happy hacking!
9898

9999
## PR description
100100

101-
* Jira ticket needs to be added into PR title, for example: `LCORE-740: type hints for models unit tests`
101+
* PR titles must start with a JIRA issue key prefix or the target branch of a backport. CI enforces this via
102+
`pr-title-checker` (config: `.github/pr-title-checker-config.json`).
103+
Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`,
104+
`CWFHEALTH-`, `[release/`
105+
- for example: `LCORE-740: type hints for models unit tests`
102106
* Fill-in all relevant information in the PR template
103107
- unused parts of PR template (like information about testing etc.) can be deleted
104108
* Please note that CodeRabbitAI will create a summary of your pull request
@@ -183,7 +187,7 @@ at the start of each session and announce which files were loaded.
183187
Nontrivial and substantial AI-generated or AI-assisted content should be
184188
“marked” in appropriate cases. In deciding how to approach this, consider
185189
adopting one or more of the following recommendations. (This assumes you have
186-
not concluded that a suggestion is a match to some existing third-party code.)
190+
not concluded that a suggestion is a match to some existing third-party code.)
187191

188192
In a commit message, or in a pull request/merge request description field,
189193
identify the code assistant that you used, perhaps elaborating on how it was
@@ -329,14 +333,14 @@ Here is simple example:
329333
```python
330334
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
331335
"""Example function with PEP 484 type annotations.
332-
336+
333337
Args:
334338
param1: The first parameter.
335339
param2: The second parameter.
336-
340+
337341
Returns:
338342
The return value. True for success, False otherwise.
339-
343+
340344
Raises:
341345
ValueError: If the first parameter does not contain proper model name
342346
"""

0 commit comments

Comments
 (0)