diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-15 07:26:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-15 07:26:23 +0300 |
| commit | bec48f50a8d518b5f3fe68c2f4b6f23657e10ff5 (patch) | |
| tree | 0430bc95b6817ec739d86e8cb3e2296452ce3057 | |
| parent | 51b5b1e083b9a15d34349186bee20b3d34609018 (diff) | |
| parent | 83adbe360377f338eafef38d593b785f8ae1e698 (diff) | |
| download | mergify-bec48f50a8d518b5f3fe68c2f4b6f23657e10ff5.tar.gz mergify-bec48f50a8d518b5f3fe68c2f4b6f23657e10ff5.zip | |
Merge pull request #8 from vyos/yuriy/auto-update-on-stale-base
T8782: Add opt-in auto-update rule for stale PRs (label=auto-update)
| -rw-r--r-- | .mergify.yml | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/.mergify.yml b/.mergify.yml index 14d4520..2aadb61 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -129,6 +129,50 @@ pull_request_rules: toggle: - invalid-title + # ------------------------------------------------------------------ + # Opt-in auto-update — refresh PR with base when it falls behind. + # + # Uses the `update` action (merges base into PR via merge commit), NOT + # `rebase`. Three reasons for the choice in this environment: + # + # 1. `update` works on fork PRs indefinitely; `rebase` loses fork + # support after 2026-07-01 per Mergify docs. We get fork PRs on + # vyos/vyos-1x, vyos/vyos-documentation, and a few others. + # + # 2. `update` does NOT rewrite commit SHAs. The gen-1 cross-org + # mirror pipeline (vyos/* → VyOS-Networks/*) copies refs by SHA; + # a force-pushed rebase would create mirror noise at best and + # break consumer PRs at worst. `update` preserves SHAs. + # + # 3. `update` is cheaper for CI — one new merge commit triggers one + # re-run; rebase changes every SHA and re-runs the entire PR. + # + # Opt-in via the `auto-update` label so this is per-PR (or per-repo + # via default-label automation) rather than a fleet-wide behavior + # change. Repos that want it apply the label; repos that don't, + # ignore the rule. + # + # Skipped on `backport-conflict` — we don't want to auto-update a PR + # whose conflict workspace is mid-resolution. Skipped on draft PRs + # and PRs already in merge-conflict with base (the existing + # `conflicts` label rule above flags those for human attention). + # ------------------------------------------------------------------ + - name: Auto-update PR when behind base (opt-in via label) + description: > + Merge base branch into PR via `update` action when the PR carries + the `auto-update` label and has at least one commit behind base. + Preserves SHAs (fork-safe, mirror-safe, CI-cache-friendly). + conditions: + - label=auto-update + - '#commits-behind>0' + - '-draft' + - '-closed' + - '-merged' + - '-conflict' + - '-label=backport-conflict' + actions: + update: {} + commands_restrictions: # Both Maintainers teams are listed for defense-in-depth. # |
