Skip to content

fix(orchestrate): retry state-write push on a non-fast-forward trunk - #451

Merged
joshua-temple merged 1 commit into
mainfrom
fix/orchestrator-state-retry-land
Jul 5, 2026
Merged

joshua-temple merged 1 commit into
mainfrom
fix/orchestrator-state-retry-land

Conversation

@joshua-temple

Copy link
Copy Markdown
Collaborator

Problem

Orchestrator.commitAndPush wrote pipeline state to trunk with a plain git add, git commit, and git push, without the optimistic-lock or rebase-retry that the promote finalizer path already uses. If a concurrent state writer or a [skip ci] commit advanced trunk between checkout and push, the push was non-fast-forward and the orchestrate run failed outright with no retry.

Fix

Route the orchestrator state write through the existing push-with-retry path so a non-fast-forward trunk is retried behind a rebase instead of failing the run, making the two state-write paths consistent.

Verification

go build ./..., go test ./... -race -count=1, and golangci-lint run ./... all clean locally, including a new test that exercises the non-fast-forward retry path.

@joshua-temple
joshua-temple force-pushed the fix/orchestrator-state-retry-land branch from 5d6c0aa to 371b5fe Compare July 5, 2026 01:31
@joshua-temple joshua-temple reopened this Jul 5, 2026
commitAndPush wrote orchestrator state to trunk with a plain git push and no
retry, so a concurrent state writer or an automated skip-CI commit that advanced
trunk between checkout and push failed the run outright with a non-fast-forward
rejection. The promote and hotfix finalizers already rebase-and-retry the same
state write (git.CommitAndPushWithRetry).

Route the orchestrator state push through the same optimistic retry: on a
rejected push, rebase onto the advanced upstream and retry, up to three attempts.
The retry backoff is injectable so the regression test stays fast.

Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
@joshua-temple
joshua-temple force-pushed the fix/orchestrator-state-retry-land branch from 371b5fe to ae10b79 Compare July 5, 2026 02:41
@joshua-temple
joshua-temple merged commit 38b28cb into main Jul 5, 2026
19 checks passed
@joshua-temple
joshua-temple deleted the fix/orchestrator-state-retry-land branch July 5, 2026 02:53
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