fix: recover published rebased gate lanes - #879
Conversation
Confidence Score: 4/5The target-resolution mismatch should be fixed before merging because it can reject valid recovery or verify publication against the wrong remote. Adoption does not reliably query the same authoritative push target used by the pipeline when the current worktree origin differs from the refreshed repository registration. Files Needing Attention: internal/branchsync/sync.go Reviews (1): Last reviewed commit: "fix: recover published rebased gate lane..." | Re-trigger Greptile |
| } | ||
| if originURL, err := git.GetRemoteURL(ctx, s.workDir(), "origin"); err == nil && strings.TrimSpace(originURL) != "" && | ||
| (!s.Repo.URLsVerified || safeurl.Redact(originURL) == s.Repo.UpstreamURL) { |
There was a problem hiding this comment.
When the worktree
origin differs from the refreshed upstream registration used by the pipeline, the database-loaded repository has URLsVerified unset, so resolvedPushURL queries origin instead of the pipeline's configured destination. This rejects a legitimately published rebased head as blocked_published_head_mismatch, or accepts adoption based on publication to the wrong remote.
Context Used: If there is a VISION.md file at the root of the re... (source)
|
Speaking as Kun's firstmate: Reviewed the tip ( Diff read (fail-closed): Greptile P1 (blocking for merge): CI: First-time fork workflows approved on this head (CI / docs / Guard / Require no-mistakes). Waiting on green + the P1 fix. Greptile Review is currently red on that P1. VISION.md (this PR tip):
Classification: corrective / opt-in recovery (not a default-behavior gate-meaning change). Not merging while P1 is open / CI unsettled. |
Summary
no-mistakes axi sync --adopt-publishedto recover a stale gate lane after a clean branch is rebased and force-with-lease pushed.axi run, which cannot make the rejected non-fast-forward push.Reproduction
Before this change, recover custody, rebase the branch onto newer main, add a commit, and publish it with a lease-protected force update. The gate lane still names the pre-rebase head, so its ordinary branch push rejects as non-fast-forward and the pipeline cannot start.
Design
Recovery is explicit, rather than an automatic reset during
axi run. The command only operates on the current lane after it verifies that custody was returned, the worktree is clean, the preserved lane still matches the recovered pipeline head, and the configured push target exactly matches the local rebased head. It imports that verified remote object, rechecks the remote and local assumptions, preserves the old gate head, then moves only the lane with a compare-and-swap update. Any failed guard leaves the lane unchanged. This rejects local or remote divergence that has not been safely published.Verification
make lintgo test -race ./...go build -o ./bin/no-mistakes ./cmd/no-mistakes