Skip to content

A Squash-Merged Promotion Passes Main's Merge-Only Ruleset Through the Admin Bypass #2510

Done

Description

@ptr727

Problem

The release model makes develop -> main promotions merge-commit-only, and main's ruleset says so with allowed_merge_methods: ["merge"]. The same ruleset also gives the repository admin role a bypass with bypass_mode: always, and the repository itself must allow squash merges, since develop is squash-only. An admin merge, whether from the web UI or from gh pr merge --squash under the maintainer's token, can therefore squash a promotion into main, and nothing refuses it.

A squashed promotion leaves main holding develop's content without its history. The merge base between the two branches stays at the last real merge commit. The next promotion then conflicts wherever a later develop change edits lines the squashed promotion already carried, because git sees the same change made twice, once on each side. Every such conflict resolves to develop's side, but nothing says so, and the conflict surfaces only at the next promotion, possibly many changes later.

Observed shape

On a fleet repository, two consecutive promotions landed on main as single-parent commits. The following promotion conflicted in five files, one of them an add/add, although main's tree was identical to develop's tree before the newest change. The fix was a branch from main with develop merged in and develop's side taken on every conflict, opened as the promotion in place of the develop head, and merged with a merge commit.

Options

  • Drop the admin bypass from main's ruleset, or set it to pull_request mode, so the merge-method rule binds the maintainer too.
  • Have the promotion gate fail when main's tip is not an ancestor of the promotion head. That catches a squash at the next promotion and names the cause, rather than surfacing as an unexplained conflict.
  • Document the recovery, a sync branch from main merging develop with develop's side, in branching-and-release-model beside the EOL-only conflict trap.

Activity

  1. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Decision needed (decision triage, 2026-11-01)

    Question: How should main's ruleset admin bypass (bypass_mode: always, RepositoryRole 5) be kept from squash-merging into main against allowed_merge_methods: ["merge"] in repo-config/main.json: drop the bypass, add a promotion-gate check in validate-task.yml, or only document the recovery in branching-and-release-model?

    Options, recommended first:

    1. Gate check, reworded, plus docs (recommended): The issue's proposed check ("main's tip is not an ancestor of the promotion head") fires on every correct promotion, since the merge commit is never in develop. Instead flag any single-parent commit on main's first-parent chain since main's previous promotion merge (Dependabot's main-only commits are second parents, so they pass), with a floor past the one historical squash 048a442 (Refresh the PhotoCleaner audit report and driftNotes #508). Add the recovery to branching-and-release-model. No setting write. No work in flight.
    2. Drop the admin bypass on main per repo: Closes the hole at the source but removes the escape hatch for a stuck required check. A UI ruleset write on each repo only the maintainer makes (configure.sh:321: "The bypass list is a human decision"). pull_request bypass mode likely still allows a squash on a PR merge (unverified against GitHub docs). No work in flight.
    3. Document the recovery only: Cheapest, but a squash still surfaces only as an unexplained conflict at the next promotion. No work in flight.

    Evidence: Live main and develop rulesets both carry bypass_actors: [{"actor_id":5,"actor_type":"RepositoryRole","bypass_mode":"always"}]. configure.sh:577-582 reports the bypass list and never asserts it. #508 (merged 2026-08-01) sits on main as single-parent 048a442, the only result of git rev-list --first-parent --no-merges origin/develop..origin/main. merge-and-release SKILL.md:84 uses gh pr merge --merge, so the risk is a manual or UI merge.

    Blocks: none

  2. added
    decision
    on Nov 1, 2026
  3. ptr727 commented on Nov 1, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer (decision triage, 2026-11-01): Option 1: a promotion-gate check that flags any single-parent commit on main's first-parent chain since main's previous promotion merge, floored past 048a442, plus the recovery documented in branching-and-release-model. No ruleset change. This is now work for the next burndown round.

  4. removed
    decision
    on Nov 1, 2026
  5. ptr727 commented on Nov 23, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown claim (round 5, 2026-11-23): branch burndown/promotion-squash-gate.

    Predicted files: .github/workflows/validate-task.yml, tests/test_workflow_steps.py, .agents/skills/branching-and-release-model/references/branch-protection-and-promotion.md, .agents/skills/drive-pr/SKILL.md.

    Group issues: #2510 #4373.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions