Repository navigation
fix(merge): auto-update Gitea PRs behind base, land work against the fork working branch - #2
Merged
LoneExile merged 1 commit intoAug 12, 2026
Conversation
…fork working branch The three recurring fleet merge-failure classes that cost many cycles on 2026-08-11/12, fixed in one command each instead of the manual dance. 1. Gitea 405 'head branch is behind base' on nearly every merge: bin/fm-pr-merge.sh now auto-updates the PR branch (rebase style), waits for CI green on the NEW head, then merges - one command. Safety: never merge red; a failure/error status or a CI timeout refuses with the state shown. The host lib gains a status-aware Gitea transport (curl with the tea CLI fallback), fm_pr_update_branch, and fm_pr_wait_ci_green. 2. Gitea 409 same-line conflicts from racing pin/cascade PRs: the same auto-update replays the PR's commits onto the moved base (rebase style) instead of failing; an unresolvable rebase still refuses for a human. 3. Squash-leftover teardown false positives: the landed-work check now resolves the landing branch through fm_landing_branch (bin/fm-tangle-lib.sh), the one owner of that resolution - the checkout's own working branch first, never origin/HEAD alone. Work squash-merged onto a fork working branch is torn down without an override; genuinely unlanded work still refuses. fm-merge-local.sh and fm-teardown.sh share the resolver; config/primary-branch declares a fork's permanent line; the coding-guidelines rule pins the owner. Tests: 5 new fm-pr-merge Gitea auto-update cases, 3 host-lib update/CI-wait cases, 2 tangle-guard resolver cases, 2 teardown fork-branch cases, and the ported fm-merge-local suite. Each flow proven RED by neutering the fix and GREEN with it restored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(merge): auto-update Gitea PRs behind base, land work against the fork working branch
The three recurring fleet merge-failure classes that cost many cycles on
2026-08-11/12, fixed in one command each instead of the manual dance.
bin/fm-pr-merge.sh now auto-updates the PR branch (rebase style), waits
for CI green on the NEW head, then merges - one command. Safety: never
merge red; a failure/error status or a CI timeout refuses with the state
shown. The host lib gains a status-aware Gitea transport (curl with the
tea CLI fallback), fm_pr_update_branch, and fm_pr_wait_ci_green.
auto-update replays the PR's commits onto the moved base (rebase style)
instead of failing; an unresolvable rebase still refuses for a human.
resolves the landing branch through fm_landing_branch (bin/fm-tangle-lib.sh),
the one owner of that resolution - the checkout's own working branch first,
never origin/HEAD alone. Work squash-merged onto a fork working branch is
torn down without an override; genuinely unlanded work still refuses.
fm-merge-local.sh and fm-teardown.sh share the resolver; config/primary-branch
declares a fork's permanent line; the coding-guidelines rule pins the owner.
Tests: 5 new fm-pr-merge Gitea auto-update cases, 3 host-lib update/CI-wait
cases, 2 tangle-guard resolver cases, 2 teardown fork-branch cases, and the
ported fm-merge-local suite. Each flow proven RED by neutering the fix and
GREEN with it restored.