|
| 1 | +# Nominate regressions for backport |
| 2 | + |
| 3 | +When a [regression][regression-beta] for the compiler or library or any other component is going to be fixed, we evaluate whether to backport the patch to the release channel where it originated (beta or stable, see [backports][backports]). The decision to backport a patch is quickly skimmed by the relevant team and either accepted or declined. |
| 4 | + |
| 5 | +In order to give more visibility to patches fixing important regressions and facilitate the team taking a decision, a discussion topic on our [Zulip chat][zulip-chat] can be automatically opened ([example][zulip-backport-poll]). |
| 6 | + |
| 7 | +This configuration item, when enabled in the file `triagebot.toml`, will make the triagebot scan every new patch in the git repository by looking for the supported text markers in the opening comment (see [GitHub documentation][gh-assoc-issue-patched]). If such text is found and the issue being fixed was classified as a `P-high` or `P-critical` and a `regression-from-*` label, the triagebot will open a new Zulip discussion topic. |
| 8 | + |
| 9 | +[regression-beta]: https://github.com/rust-lang/rust/issues?q=is%3Aissue%20label%3Aregression-from-stable-to-beta |
| 10 | +[backports]: https://forge.rust-lang.org/compiler/backports.html#backports |
| 11 | +[zulip-chat]: https://forge.rust-lang.org/platforms/zulip.html |
| 12 | +[zulip-backport-poll]: https://rust-lang.zulipchat.com/#narrow/channel/474880-t-compiler.2Fbackports/topic/.23143509.3A.20beta-nominated/with/527517416 |
| 13 | +[gh-assoc-issue-patched]: https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-issues/linking-a-pull-request-to-an-issue |
| 14 | + |
| 15 | +## Configuration |
| 16 | + |
| 17 | +The automatic backport scanning is enabled on a repository by the existence of at least one `[backport.foo]` table in `triagebot.toml`: |
| 18 | + |
| 19 | +```toml |
| 20 | +[backport.foo] |
| 21 | +required-pr-labels = ["T-compiler"] |
| 22 | +required-issue-labels = "regression-from-stable-to-beta" |
| 23 | +add-labels= ["beta-nominated"] |
| 24 | + |
| 25 | +[backport.bar] |
| 26 | +required-pr-labels = ["T-compiler"] |
| 27 | +required-issue-labels = "regression-from-stable-to-stable" |
| 28 | +add-labels= ["beta-nominated", "stable-nominated"] |
| 29 | + |
| 30 | +[backport.baz] |
| 31 | +required-pr-labels = ["T-libs", "T-libs-api"] |
| 32 | +required-issue-labels = "regression-from-stable-to-stable" |
| 33 | +add-labels= ["stable-nominated"] |
| 34 | +``` |
| 35 | + |
| 36 | +There can be multiple occurrence of this configuration to handle different cases. `foo`, `bar`, `baz` are just examples of unique identifiers to disambiguate them. |
| 37 | + |
| 38 | +Explaination: |
| 39 | +- `required-pr-labels`: a list of labels that the pull request must have when opened (tipically could be a team label `T-*`) |
| 40 | +- `required-issue-label`: a label that the regression must have in order to be identified as such. It can be one of: `regression-from-stable-to-nightly`, `regression-from-stable-to-beta` or `regression-from-stable-to-stable`. |
| 41 | +- `add-labels`: a list of labels that the pull request will be given, if all conditions apply. |
| 42 | + |
| 43 | +## Implementation |
| 44 | + |
| 45 | +See [`src/handlers/backport.rs`](https://github.com/rust-lang/triagebot/blob/HEAD/src/handlers/backport.rs). |
0 commit comments