|
| 1 | +# Backports |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Elastic Agent relies on backporting PRs to incorporate changes into the appropriate release branches after merging |
| 6 | +into `main`. Creating backport PRs is handled automatically using the appropriate [backport labels](https://github.com/elastic/elastic-agent/labels?q=backport). |
| 7 | + |
| 8 | +To target specific release branch(es), add one or more labels `backport-<release branch name>` (e.g. `backport-9.2`). PRs can be labeled |
| 9 | +before or after the PR is merged. If added before merging, the backports will be created after merging to `main`. Adding |
| 10 | +a backport label to an already merged PR will create backports shortly after adding the label(s). |
| 11 | + |
| 12 | +Mergify will automatically add a [reminder](https://github.com/elastic/elastic-agent/blob/main/.mergify.yml#L173) to any PR to `main` if missing at least one `backport-*` label. If your PR does _not_ need backporting, use the `backport-skip` label to avoid the automated comment. |
| 13 | + |
| 14 | +There are also three additional `backport-*` labels to simplify which branches to target backports: |
| 15 | + |
| 16 | +* `backport-active-all`: Backport to all currently active development branches (except `main`) |
| 17 | +* `backport-active-8`: Backport only to 8.x branches |
| 18 | +* `backport-active-9`: Backport only to 9.x branches |
| 19 | + |
| 20 | + |
| 21 | +These labels use the [`backport-active` GitHub action](https://github.com/elastic/elastic-agent/blob/main/.github/workflows/backport-active.yml#L14) to automate targeting relevant branches. More detail can be found at |
| 22 | +https://github.com/elastic/oblt-actions/blob/main/github/backport-active/README.md. |
| 23 | + |
| 24 | +## Process |
| 25 | + |
| 26 | +**For changes authored by an individual** - the original PR author is in charge of ensuring their original PR uses the |
| 27 | +correct labels, the backport PRs are created, pass CI, and are merged. |
| 28 | + |
| 29 | +**For changes authored by automation (GitHub actions, dependabot, etc.)** - these PRs should already be labeled with |
| 30 | +`backport-active-all`. After the initial PR to `main` merges, the code reviewers (assigned based on teams defined in |
| 31 | +`CODEOWNERS`) need to verify CI passes, approve, and merge the backport PRs. |
0 commit comments