Do not report push failure after successful publication #32

Closed
opened 2026-10-27 13:34:40 +00:00 by sam · 0 comments
Owner

Push publishes the remote ref before writing unused local upstream metadata, then returns local config errors as if publication failed.

Confirmed still present on main: Manager.Push (internal/worktree/worktree.go:414-449) completes r.PushContext successfully, then calls r.Config() / r.SetConfig(cfg) to record branch upstream. Either of those returns read repo config: %w or record branch upstream: %w from Push, so a caller sees a push failure for a branch that is already published on the forge.

Steps to Reproduce

  1. Prepare a task worktree and commit a change so there is a branch to publish.
  2. Make the local repository config unwritable or unreadable after the remote is reachable (e.g. chmod 000 <worktree>/.git/config, or a .git/config the go-git config parser rejects).
  3. Call Manager.Push(ctx, dir, branch).
  4. Observe the remote branch exists on the forge, but Push returns record branch upstream: ... (or read repo config: ...).
  5. The daemon treats that error as a failed publication and parks the task, even though the PR branch is live.

Acceptance Criteria

A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.

Acceptance criteria

A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent.

Close reason

Fixed: recordUpstream extracted from Push (worktree.go:465); a post-publication config failure is now a logged warning and Push returns success once the remote ref is published. Manager gained an optional Log field with a slog.Default() fallback. Verified by inspection rather than a red run -- the test uses the new Log field so it cannot compile against the pre-fix code. task check green; fresh adversarial review (independent, did not write the code) zero findings.


Imported from beads archie-core-1ysw.6 · GitHub #600 · type bug · priority P2 · created 2026-08-22 · closed 2026-08-24

Push publishes the remote ref before writing unused local upstream metadata, then returns local config errors as if publication failed. Confirmed still present on main: `Manager.Push` (internal/worktree/worktree.go:414-449) completes `r.PushContext` successfully, then calls `r.Config()` / `r.SetConfig(cfg)` to record branch upstream. Either of those returns `read repo config: %w` or `record branch upstream: %w` from `Push`, so a caller sees a push failure for a branch that is already published on the forge. ## Steps to Reproduce 1. Prepare a task worktree and commit a change so there is a branch to publish. 2. Make the local repository config unwritable or unreadable after the remote is reachable (e.g. `chmod 000 <worktree>/.git/config`, or a `.git/config` the go-git config parser rejects). 3. Call `Manager.Push(ctx, dir, branch)`. 4. Observe the remote branch exists on the forge, but `Push` returns `record branch upstream: ...` (or `read repo config: ...`). 5. The daemon treats that error as a failed publication and parks the task, even though the PR branch is live. ## Acceptance Criteria A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent. ### Acceptance criteria A post-publication metadata failure cannot park the task as an unsuccessful push; tests verify the remote ref and returned result remain consistent. ### Close reason Fixed: recordUpstream extracted from Push (worktree.go:465); a post-publication config failure is now a logged warning and Push returns success once the remote ref is published. Manager gained an optional Log field with a slog.Default() fallback. Verified by inspection rather than a red run -- the test uses the new Log field so it cannot compile against the pre-fix code. task check green; fresh adversarial review (independent, did not write the code) zero findings. --- _Imported from beads `archie-core-1ysw.6` · GitHub #600 · type bug · priority P2 · created 2026-08-22 · closed 2026-08-24_
sam added the mediumbug labels 2026-10-27 13:34:40 +00:00
sam self-assigned this 2026-10-27 13:34:40 +00:00
sam closed this issue 2026-10-27 13:34:40 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#32