From e460df0ba116c222e2b77b9a622ad6eeb1e04192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ti=C5=A1novsk=C3=BD?= Date: Sun, 19 Jul 2026 10:59:08 +0200 Subject: [PATCH] Add cherry_picker config and update valid prefixes (cherry picked from commit 4861ba6b821835d161d6f8caa2ea5b9dfcf154a0) --- .cherry_picker.toml | 5 ++ .github/pr-title-checker-config.json | 23 +++++++ AGENTS.md | 9 +++ CONTRIBUTING.md | 71 +++++++++++++++++++-- docs/contributing_guide.md | 14 ++-- docs/demos/lcore/contributing_guidelines.md | 5 +- 6 files changed, 116 insertions(+), 11 deletions(-) create mode 100644 .cherry_picker.toml create mode 100644 .github/pr-title-checker-config.json diff --git a/.cherry_picker.toml b/.cherry_picker.toml new file mode 100644 index 000000000..3d35a58a2 --- /dev/null +++ b/.cherry_picker.toml @@ -0,0 +1,5 @@ +team = "lightspeed-core" +repo = "lightspeed-stack" +check_sha = "ea5de69d94e33aa2a75a622fec455bc4b0fa6c6b" +fix_commit_msg = false +default_branch = "main" diff --git a/.github/pr-title-checker-config.json b/.github/pr-title-checker-config.json new file mode 100644 index 000000000..e0ff11136 --- /dev/null +++ b/.github/pr-title-checker-config.json @@ -0,0 +1,23 @@ +{ + "LABEL": { + "name": "title needs formatting", + "color": "EEEEEE" + }, + "CHECKS": { + "prefixes": [ + "LCORE-", + "RSPEED-", + "MGTM-", + "OLS-", + "RHIDP-", + "LEADS-", + "CWFHEALTH-", + "[release/" + ] + }, + "MESSAGES": { + "success": "All OK", + "failure": "Failing CI test", + "notice": "" + } +} diff --git a/AGENTS.md b/AGENTS.md index 88d6f5680..394b71723 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -191,6 +191,15 @@ uv run make test-e2e # End-to-end tests - **SQLAlchemy**: Database ORM - **Kubernetes**: K8s auth integration +## Pull Request Requirements + +**PR titles MUST start with a JIRA issue key prefix.** CI enforces this via `pr-title-checker` (config: `.github/pr-title-checker-config.json`). + +Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`, `CWFHEALTH-`, `[release/` + +- ✅ `RSPEED-2849: add user_agent to ResponsesEventData` +- ❌ `feat(observability): add user_agent to ResponsesEventData` + ## Development Workflow 1. Use `uv sync --group dev --group llslibdev` for dependencies 2. Always use `uv run` prefix for commands diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eacfc308d..5f352c6e7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,6 +10,7 @@ * [PR description](#pr-description) * [Definition of Done](#definition-of-done) * [A deliverable is to be considered “done” when](#a-deliverable-is-to-be-considered-done-when) +* [Backports](#backports) * [AI assistants](#ai-assistants) * [“Mark” code with substantial AI-generated portions.](#mark-code-with-substantial-ai-generated-portions) * [Copyright and licence notices](#copyright-and-licence-notices) @@ -97,12 +98,72 @@ Happy hacking! ## PR description -* Jira ticket needs to be added into PR title, for example: `LCORE-740: type hints for models unit tests` +* PR titles must start with a JIRA issue key prefix or the target branch of a backport in brackets. CI enforces this via + `pr-title-checker` (config: `.github/pr-title-checker-config.json`). + Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`, + `CWFHEALTH-`, `[release/` + - for example: `LCORE-740: type hints for models unit tests` * Fill-in all relevant information in the PR template - unused parts of PR template (like information about testing etc.) can be deleted * Please note that CodeRabbitAI will create a summary of your pull request + +## Backports + +We use [cherry_picker](https://pypi.org/project/cherry-picker/) to backport +merged pull requests to release branches. See the +[cherry_picker documentation](https://cherry-picker.readthedocs.io/) for full +details. + +### Installation + +```bash +pip install --user cherry_picker +``` + +### Usage + +After a pull request has been merged to `main`, you can backport it to one or +more release branches: + +```bash +# backport to a single release branch +cherry_picker release/0.6 + +# backport to multiple release branches +cherry_picker release/0.5 release/0.6 +``` + +`cherry_picker` will create a new branch, cherry-pick the commit, and open a +pull request against the target release branch. + +If the commit you want to backport is a **merge commit**, append `^-` to the +hash so that `cherry_picker` applies the correct parent diff: + +```bash +cherry_picker ^- release/0.6 +``` + +If there are conflicts, `cherry_picker` will pause and let you resolve them. +After resolving: + +```bash +git add . +cherry_picker --continue +``` + +To abort a backport in progress: + +```bash +cherry_picker --abort +``` + +See the [branching documentation](docs/branching.md) for more details on our +branching strategy and release workflow. + + + ## Definition of Done ### A deliverable is to be considered “done” when @@ -125,7 +186,7 @@ Happy hacking! Nontrivial and substantial AI-generated or AI-assisted content should be “marked” in appropriate cases. In deciding how to approach this, consider adopting one or more of the following recommendations. (This assumes you have -not concluded that a suggestion is a match to some existing third-party code.) +not concluded that a suggestion is a match to some existing third-party code.) In a commit message, or in a pull request/merge request description field, identify the code assistant that you used, perhaps elaborating on how it was @@ -271,14 +332,14 @@ Here is simple example: ```python def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: """Example function with PEP 484 type annotations. - + Args: param1: The first parameter. param2: The second parameter. - + Returns: The return value. True for success, False otherwise. - + Raises: ValueError: If the first parameter does not contain proper model name """ diff --git a/docs/contributing_guide.md b/docs/contributing_guide.md index eacfc308d..5497bd698 100644 --- a/docs/contributing_guide.md +++ b/docs/contributing_guide.md @@ -97,7 +97,11 @@ Happy hacking! ## PR description -* Jira ticket needs to be added into PR title, for example: `LCORE-740: type hints for models unit tests` +* PR titles must start with a JIRA issue key prefix or the target branch of a backport. CI enforces this via + `pr-title-checker` (config: `.github/pr-title-checker-config.json`). + Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`, + `CWFHEALTH-`, `[release/` + - for example: `LCORE-740: type hints for models unit tests` * Fill-in all relevant information in the PR template - unused parts of PR template (like information about testing etc.) can be deleted * Please note that CodeRabbitAI will create a summary of your pull request @@ -125,7 +129,7 @@ Happy hacking! Nontrivial and substantial AI-generated or AI-assisted content should be “marked” in appropriate cases. In deciding how to approach this, consider adopting one or more of the following recommendations. (This assumes you have -not concluded that a suggestion is a match to some existing third-party code.) +not concluded that a suggestion is a match to some existing third-party code.) In a commit message, or in a pull request/merge request description field, identify the code assistant that you used, perhaps elaborating on how it was @@ -271,14 +275,14 @@ Here is simple example: ```python def function_with_pep484_type_annotations(param1: int, param2: str) -> bool: """Example function with PEP 484 type annotations. - + Args: param1: The first parameter. param2: The second parameter. - + Returns: The return value. True for success, False otherwise. - + Raises: ValueError: If the first parameter does not contain proper model name """ diff --git a/docs/demos/lcore/contributing_guidelines.md b/docs/demos/lcore/contributing_guidelines.md index 103c80e78..f9bb68650 100644 --- a/docs/demos/lcore/contributing_guidelines.md +++ b/docs/demos/lcore/contributing_guidelines.md @@ -74,7 +74,10 @@ ptisnovs@redhat.com ## PR description -* Jira ticket needs to be added into PR title +* PR titles must start with a JIRA issue key prefix. CI enforces this via + `pr-title-checker` (config: `.github/pr-title-checker-config.json`). + Allowed prefixes: `LCORE-`, `RSPEED-`, `MGTM-`, `OLS-`, `RHIDP-`, `LEADS-`, + `CWFHEALTH-`, `[release/` - for example: `LCORE-740: type hints for models unit tests` * Fill-in all relevant information in the PR template - unused parts of PR template (like information about testing etc.) can be deleted