Automation: auto-label needs-rebase on MRs that cannot fast-forward
## Summary If an MR cannot fast-forward / has merge conflicts with its target branch, set the `needs-rebase` label on the linked issue (and the MR). ## Work Track Cross-track (AI Core / coordination) ## Context / Background Maintainers waste time discovering rebase needs at review time. Detect the rebase requirement automatically and surface it via a label on the issue and the MR. Parent / related: #3586474. This issue is blocked by the three exploration issues (#3586475, #3586476, #3586477) — the platform choice and the available `gitlab_api` primitives must land first. ## Tasks * [ ] Subscribe to GitLab `Merge Request Hook` events and to target-branch pushes. * [ ] When a target-branch push occurs, recompute mergeability for open MRs against that target. * [ ] If an MR has `merge_status` of `cannot_be_merged` (or equivalent), add `needs-rebase` to both the MR and the linked issue. * [ ] When the MR becomes mergeable again, remove the label. * [ ] Optional: post a short comment on the MR linking to Drupal's rebase docs the first time the label is added. ## Acceptance Criteria * [ ] Conflicting MRs reliably end up with `needs-rebase`. * [ ] Resolved conflicts clear the label without manual intervention. * [ ] Label changes are applied to both MR and linked issue. ## Related issues ## AI Usage - [x] AI Assisted Issue — This issue was generated with AI assistance, but was reviewed and refined by the creator.
issue