Skip to content

fix(merge): auto-update Gitea PRs behind base, land work against the fork working branch - #2

Merged
LoneExile merged 1 commit into
feat/gitea-pr-adapterfrom
fm/harden-fleet-merge-flow-20260812
Aug 12, 2026
Merged

LoneExile merged 1 commit into
feat/gitea-pr-adapterfrom
fm/harden-fleet-merge-flow-20260812

Conversation

@LoneExile

Copy link
Copy Markdown
Owner

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.

  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.

…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.
@LoneExile
LoneExile merged commit f8b5ebb into feat/gitea-pr-adapter Aug 12, 2026
@LoneExile
LoneExile deleted the fm/harden-fleet-merge-flow-20260812 branch August 12, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant