mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 05:25:14 +09:00
Forgetting the `backport` label costs a release-branch fix; removing a label during review costs a click. So invert the default: a PR whose Conventional Commits type is `fix` gets `backport` on arrival, and a maintainer who decides it must not reach a release line removes it. The removal has to stick, which is what shapes the condition. This workflow also runs on `reopened` and `synchronize`, so re-applying the label the way `kind/*` and `area/*` are re-applied would bring it back with the next push and make removal fiction — worse than no default, because it would look like it works. `kind/*` and `area/*` are derivations from the title and a human removing one is removing a fact; `backport` is a human decision with a default. It is therefore seeded only on `opened`, which fires exactly once per PR, and never again. `reopened` is excluded on the same grounds: a reopen follows a close, by which point the label has usually been considered. Three exclusions. A backport PR itself, reusing the `[Backport ...]` detector already in the file rather than adding a second one — auto labeling those is what caused recursive backports. A breaking change, which must never default into a patch release line. And nine scopes whose code is main-only or where a cherry-pick is meaningless: ci, e2e, tests, build, deps, agents, release, backport, migrations. `migrations` is preventive rather than observed — it is in no recent PR title — but a migration backported without diffing the version slot across branches makes the newer branch silently skip its own migration at that slot. On a composite scope any excluded part suppresses the label, rather than requiring all of them to be excluded: `fix(platform,ci)` is exactly the shape that drags main-only content into a release branch. What the default does not buy is stated in the file. backport.yaml's `conflict_resolution: draft_commit_conflicts` covers a conflict; it cannot cover a backport that applies cleanly and wrongly, because the action imports whole files the target branch lacks. The reviewer still owns whether the change belongs on the release line. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>