You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pusher): add Pusher extension and wire it into the merge controller (#151)
## Summary
- New `extension/pusher` interface with all-or-nothing `Push` semantics,
per-change outcomes (committed vs already-existed), and an `ErrConflict`
sentinel for user-caused failures.
- Git-backed implementation that fetches → resets → cherry-picks →
pushes, serialized via mutex on the shared checkout. Detects redundant
picks and rolls back genuinely empty commits so they don't reach the
remote.
- Concurrent-push contention is detected by re-checking the remote tip
after a push failure (rather than parsing git error output, which varies
across versions and rejection sources). The full cycle is retried up to
`Params.MaxPushAttempts` (default 10).
- Merge controller now calls `Pusher.Push`, transitions the batch to
`Succeeded`/`Failed`, and nacks transient infra errors. Three outcome
cases are inlined (success, `ErrConflict` → Failed, generic error →
return) — retryability classification will live in separate infra.
- `example/server/orchestrator` wires a git pusher from
`PUSHER_CHECKOUT_PATH` / `PUSHER_REMOTE` / `PUSHER_TARGET` env vars.
## Test plan
- [x] `make test` — 30 unit tests pass, including new pusher and
rewritten merge controller suites
- [x] Real-git fixture tests for the pusher cover single/stacked URIs,
already-existed, mixed-partial, conflict, recovery-after-conflict,
reset-between-calls, retry-on-contention, and giveup-after-cap
- [x] Pre-receive race hook drives the retry loop end-to-end with real
git mechanics (unsets
`GIT_QUARANTINE_PATH`/`GIT_OBJECT_DIRECTORY`/`GIT_ALTERNATE_OBJECT_DIRECTORIES`
to mutate refs from inside pre-receive)
- [x] `make fmt`, `make gazelle`, `make tidy` — tree clean
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: sergeyb <sergeyb@uber.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments