|
| 1 | +# Pull request guide |
| 2 | + |
| 3 | +This repo enforces PR title format in CI and provides a body template on GitHub. Use this guide when opening a pull request. |
| 4 | + |
| 5 | +## PR title (required — CI enforced) |
| 6 | + |
| 7 | +Every PR title is validated by the [PR Hygiene workflow](.github/workflows/pr-hygiene.yml) using [Conventional Commits](https://www.conventionalcommits.org/) and, for some types, a Jira ticket. |
| 8 | + |
| 9 | +### Format |
| 10 | + |
| 11 | +```text |
| 12 | +type(scope): [JIRA-123] short description |
| 13 | +``` |
| 14 | + |
| 15 | +| Part | Required | Rules | |
| 16 | +|------|----------|-------| |
| 17 | +| `type` | Yes | Lowercase conventional commit type (see table below) | |
| 18 | +| `(scope)` | No | Lowercase; letters, digits, `-`, `_` (e.g. `cookbooks`, `checkpoint`, `ci`) | |
| 19 | +| `[JIRA-123]` | Sometimes | Uppercase project key + hyphen + number; required for `feat` and `fix` | |
| 20 | +| `description` | Yes | Imperative, concise summary (no trailing period) | |
| 21 | + |
| 22 | +### Valid `type` values |
| 23 | + |
| 24 | +These are validated by `@commitlint/config-conventional`: |
| 25 | + |
| 26 | +| Type | When to use | |
| 27 | +|------|-------------| |
| 28 | +| `feat` | New feature or user-facing capability | |
| 29 | +| `fix` | Bug fix | |
| 30 | +| `docs` | Documentation only | |
| 31 | +| `refactor` | Code change that neither fixes a bug nor adds a feature | |
| 32 | +| `perf` | Performance improvement | |
| 33 | +| `test` | Adding or updating tests | |
| 34 | +| `build` | Build system or external dependencies | |
| 35 | +| `ci` | CI configuration or scripts | |
| 36 | +| `chore` | Maintenance (deps, tooling) that doesn't fit other types | |
| 37 | +| `revert` | Reverts a previous commit | |
| 38 | + |
| 39 | +### Jira ticket rules |
| 40 | + |
| 41 | +- **Required** when `type` is `feat` or `fix` |
| 42 | +- **Optional** for all other types (`docs`, `chore`, `ci`, etc.) |
| 43 | +- Ticket must appear immediately after the colon, in square brackets, before the description |
| 44 | +- Pattern: `[A-Z]{2,10}-[0-9]+` (e.g. `[LANG-42]`, `[INFRA-370]`) |
| 45 | + |
| 46 | +### Title examples |
| 47 | + |
| 48 | +```text |
| 49 | +docs(cookbooks): add fork-from-checkpoint cookbook |
| 50 | +fix(checkpoint): [LANG-99] handle missing parent checkpoint on fork |
| 51 | +docs: document PR title conventions |
| 52 | +chore(deps): refresh uv.lock via weekly upgrade |
| 53 | +ci: run deptry on both packages |
| 54 | +refactor(store): simplify namespace key encoding |
| 55 | +test(checkpoint): cover TTL expiration edge case |
| 56 | +``` |
| 57 | + |
| 58 | +Invalid examples: |
| 59 | + |
| 60 | +```text |
| 61 | +Add fork cookbook # not conventional commit format |
| 62 | +feat: add fork cookbook # feat requires [JIRA-123] |
| 63 | +feat(cookbooks): add fork cookbook # feat requires [JIRA-123] |
| 64 | +Feat(cookbooks): [LANG-42] add fork # type must be lowercase |
| 65 | +feat(Cookbooks): [LANG-42] add fork # scope must be lowercase |
| 66 | +feat(cookbooks): LANG-42 add fork # ticket must be in [brackets] |
| 67 | +``` |
| 68 | + |
| 69 | +## PR body |
| 70 | + |
| 71 | +GitHub pre-fills the description from [`.github/PULL_REQUEST_TEMPLATE.md`](.github/PULL_REQUEST_TEMPLATE.md). Fill in each section: |
| 72 | + |
| 73 | +| Section | What to include | |
| 74 | +|---------|-----------------| |
| 75 | +| **Description** | Brief overview of the problem and approach | |
| 76 | +| **Changes Made** | Bullet list of main code/doc changes | |
| 77 | +| **Testing** | Commands run, scenarios verified (e.g. `uv run pytest`, manual steps) | |
| 78 | +| **Screenshots** | UI or output captures, if relevant | |
| 79 | +| **Additional Notes** | Breaking changes, follow-ups, reviewer callouts | |
| 80 | + |
| 81 | +Link related GitHub issues when applicable. |
0 commit comments