Skip to content

fix: the already-up-to-date branch needs the status retry too - #18

Merged
braghettos merged 1 commit into
mainfrom
fix/already-up-to-date-status-retry
Sep 17, 2026
Merged

braghettos merged 1 commit into
mainfrom
fix/already-up-to-date-status-retry

Conversation

@braghettos

Copy link
Copy Markdown

Follow-up to #17, caught in review by the installer session before tagging. Thank you — this was a real miss, not a nit.

#17 fixed the status write on the committed path and left the identical bare e.kube.Status().Update(ctx, cr) in the git.NoErrAlreadyUpToDate branch a few lines above. Same function, same failure mode.

That branch needs it more, not less

It is the variant that cannot self-heal. It makes no commit, so a later Observe has no footer to recognise the resource by and cannot adopt it — it falls through to the terminal default branch.

And #17 makes this path more likely to be taken. A retried sync re-clones a tree that may already contain the file from the attempt that actually won the push, so the commit becomes a no-op and lands exactly here. My own fix increased traffic through the branch it left unfixed.

A source guard, not a behavioural test

Deliberate. The bug is a missed call site, not a wrong result. A behavioural test would have to mock git deeply enough to reach each branch, and would still say nothing about a third branch added later.

The guard asserts no bare Status().Update survives outside updateStatusWithRetry. I verified it actually catches the regression it exists for — reverting line 515 fails it, restoring passes.

Corrections to #17's description

Both raised in the same review, both verified, both mine to own:

1. The permanence fix is not in #17. It is in the already-merged base 18afa8b (provider-runtime v1.2.1 → v1.3.1), which changes the create handshake from terminal refusal to adopt-on-Observe. #17 narrows the race; an exhausted conflict still escapes Create conflict-typed and still leaves pending set. Worth stating plainly because tagging ships that handshake change to LocalResource and Repo as a rider.

2. "The apiserver rejected every event this controller emitted" was too broad. True only of the two Eventf sites in localresource.go. repo.go has no Eventf calls at all, and the reconciler passes actions.

Verification

go build, go vet clean; full suite 9 packages ok.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JumEqTGGJ2hf3vjE3xFQsv

#17 fixed the status write on the committed path and left the identical bare
`e.kube.Status().Update(ctx, cr)` in the `git.NoErrAlreadyUpToDate` branch a few lines above — same
function, same failure mode, missed. Caught in review by the installer session before tagging.

That branch needs it MORE, not less:

* It is the variant that cannot self-heal. It makes NO commit, so a later Observe has no footer to
  recognise the resource by and cannot adopt it — it falls through to the terminal default branch.

* #17 makes this path MORE likely to be taken. A retried sync re-clones a tree that may already
  contain the file from the attempt that actually won the push, so the commit becomes a no-op and
  lands exactly here.

Also adds a SOURCE guard rather than a behavioural test, because the bug is a missed call site, not a
wrong result: a behavioural test would need to mock git deeply enough to reach each branch and would
still say nothing about a branch added later. The guard asserts no bare Status().Update survives
outside updateStatusWithRetry. Verified it actually catches the regression — reverting line 515 fails
it, restoring passes.

go build, go vet clean; full suite 9 packages ok.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JumEqTGGJ2hf3vjE3xFQsv
@braghettos
braghettos merged commit 4d85acd into main Sep 17, 2026
3 checks passed
@braghettos
braghettos deleted the fix/already-up-to-date-status-retry branch September 17, 2026 09:16
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