Require branches to be up to date before merge across the protected fleet #815
Labels
No labels
burndown-2026-06
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/infrastructure#815
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
DESIRED_RULEinscripts/forgejo-branch-protection.pyalready ownsblock_on_outdated_branchand actively drives it toFalseon every protected repo. Flip it toTrueso a pull request whose base branch has moved cannot merge until its head is updated.Why
Today a pull request can go green against a base that no longer exists by the time it merges. CI proves the branch was good, not that the merge result is good. Requiring the branch to be current closes that gap: the tree CI tested is the tree that lands.
Scope
Fleet-wide, every repo the converge covers. The field is already in
DESIRED_RULE, so this is a one-value flip rather than a new claim on server state, and no repo needs opting in.What this does not change
enable_pushstaysTrue, so ordinary fast-forward pushes to a protected default branch keep working for any write user. The gate binds pull request merges only.That matters because the fleet's automated writers push directly rather than through pull requests: the containerized dispatch implementer lands on
main, and tap and scoop bumps push straight to their protected default branches. A grep across the CI of agentic-os, deploy, and infrastructure found no automated pull request merges, so nothing merges unattended today that this would start blocking.required_approvalsstays0. This adds no review gate.Cost
On a fast-moving repo a pull request will need its branch updated when
mainadvances underneath it. Every affected repo already allows update-by-rebase, so the web UI update button covers it. This is the intended trade: the churn is the price of the merged tree being the tested tree.Also needs updating
The rule's own documentation describes it as a force-push and deletion boundary only, which stops being the whole truth:
scripts/forgejo-branch-protection.py.agents/skills/forgejo-admin/references/forgejo-branch-protection.md.agents/skills/forgejo-admin/SKILL.md, which states the rule does not gate the PR lanescripts/forgejo_branch_protection_test.pycovers the engine rather than the policy values, so it needs no change.Rollout
The converge is the rollout and needs the attended admin-token shell. Land the change, then run
ward exec forgejo-branch-protection -- --dry-runto preview the fleet diff, then apply.Related: coilyco-flight-deck/agentic-os#994