Repository navigation
fix(git): retry a failed publication on its own schedule, and close the 0.51 docs gaps - #412
Conversation
A failed push, or a failed rebuild before it, stopped the push timer and armed nothing. A branch that then went quiet kept its work indefinitely, and a CommitRequest riding it stayed WaitingForPush, because the controller never fails a request the worker holds. A branch that kept receiving commits did the opposite: lastPushAt advances only on success, so every new commit tried the remote that had just refused. The failure now schedules the next attempt itself: 10s, doubling to 5m, on the existing push timer. Commits before that deadline accumulate locally, and a success resets it. A failure caused by a missing parent stays with parent recovery's probe schedule, so the two never both spend a connection. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
UPGRADING tells readers to suspend a Flux or Argo CD source before removing commit.window, adds the quickstart chart value to the Was/Is table, corrects the closeDelay claim (a client without strict field validation has it pruned silently), and records that a save on a target that may not be written now fails. The CommitRequest and GitTarget commit descriptions, configuration.md and the CommitRequest spec stop describing a save as closing the window now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…get stands The branch worker event model and the HA plan describe durable admission, save identity across restarts and publication evidence. gittarget-state-of-affairs.md records what is built, which page owns which decision, the known gaps ranked by user impact, and the next steps. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (18)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe branch worker now schedules bounded retries after failed publication, including when no new writes arrive. The pull request updates CommitRequest and commit-window documentation and adds proposals for recoverable worker execution and GitTarget durability. ChangesBranch publication and CommitRequest behavior
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant branchWorkerEventLoop
participant publicationRetry
participant GitRemote
participant CommitRequest
branchWorkerEventLoop->>GitRemote: Push retained writes
GitRemote-->>branchWorkerEventLoop: Return publication failure
branchWorkerEventLoop->>publicationRetry: Record failure and arm retry deadline
publicationRetry-->>branchWorkerEventLoop: Retry deadline expires
branchWorkerEventLoop->>GitRemote: Retry retained writes
GitRemote-->>branchWorkerEventLoop: Return successful publication
branchWorkerEventLoop-->>CommitRequest: Report committed hash
Merge Risk: ⚪ Minimal · up to Failed Git publications now retry on a bounded schedule, and the documentation is updated to match. No concrete merge-blocking issue was found. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Automatic retries improve recovery while retaining the existing destination and save-result semantics. No introduced security issue was established. Permission changes during a pending retry remain insufficiently verified, and retries do not provide recovery across process restarts. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ch ships it The event model, its INDEX row and the HA plan still described the quiet-branch retry as the next fix. They now say #412 built it, keep the Git operation deadlines as the next step, and record that a publication that keeps failing shows only in logs and the push metric. The state-of-affairs page marks gaps 1 and 2 fixed, records the event-model review as resolved, and is listed in INDEX. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…er the parent returns A publication that failed while parent recovery was open cleared the retry, on the grounds that recovery owns it. Once the parent is found, recovery's missing-parent hold is gone while its obligation stays open until the work publishes, so every new commit retried the failing push at once: three attempts where one was due. Such a failure now defers to recovery's next probe deadline; new commits wait for it, and recovery's timer makes the attempt. Found in review; it also failed on main. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
UPGRADING names the reconciler to pause (the Flux Kustomization or HelmRelease, or Argo CD automated sync) and restores Git-managed values before resuming. The push-cooldown analysis drops obsolete claims: the retry now shares the push timer, and serialization does not batch queued commits. The failure-status gap is narrowed to the worker's publication failure and retry deadline. The HA plan states that its phases assume preserved save outcomes and that combining providers needs explicit repository-identity and credential decisions. Rebuild recovery and publication visibility now come before the transition refactor. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
What this changes
A failed publication retries by itself
After a failed push, or a failed rebuild before it, the branch worker stopped its push timer and armed nothing. Two consequences:
CommitRequestthe worker holds. So a save riding that write stayedWaitingForPushuntil some unrelated write arrived.lastPushAtadvances only on success, so once the cooldown had passed, each new commit tried the remote that had just refused.Now the failure schedules the next attempt on the existing push timer: 10s, doubling to at most 5m (
internal/git/publication_retry.go). Commits made before that deadline accumulate locally, and a successful push resets the schedule. A failure caused by a missing parent branch stays with parent recovery's probe schedule, so the two never both spend a connection. This is option C indocs/design/push-cooldown.md; the success cooldown is unchanged.Tests (
internal/git/publication_retry_test.go, realgit http-backendserver):CommitRequestresolvesCommittedwith no further write.With the retry turned into a no-op, the four behavior tests fail; the held-request test times out at 10s. They pass under
-race.Not addressed, and recorded in
docs/TODO.md: when a rebuild's fetch fails, the open window is dropped. Unless the cause was a missing parent, nothing asks for a snapshot, so those writes wait for the next resync.The 0.51 docs gaps
docs/UPGRADING.md, commit-window entry:commit.window;quickstart.gitTarget.commit.windowchart value to the Was/Is table;closeDelayclaim: a client without strict field validation has the field pruned silently.CommitRequestandGitTargetcommit descriptions, so the CRD descriptions change, but no schema. Also fixed inconfiguration.md(including the generated settings row, viahack/crdfields/fields.yaml) anddocs/spec/commitrequest-design.md.Design records
docs/design/branch-worker-event-model.mdanddocs/future/ha-gittarget-distribution-plan.md: the branch worker's recovery boundary, durable admission and publication evidence. Proposals only; no behavior change.docs/design/gittarget-state-of-affairs.md: what is built for GitTarget and the branch worker, which page owns which decision, the known gaps ranked by user impact, and the recommended order.docs/INDEX.mdlists them.Review fixes
maintoo. Such a failure now defers to recovery's next probe deadline. Pinned byTestPublicationRetry_AFailureAfterTheParentReturnsWaitsForRecovery, which fails without the change.KustomizationorHelmRelease, or Argo CD automated sync.Validation
task lintandtask testpass on the code (unit coverage 79.5%, at baseline).task lint-docsand thehack/crdfieldscheck pass on the combined branch. Local e2e was not run; this relies on the CI e2e legs.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation