Skip to content

fix: patch the Workload for a location restart - #642

Merged
scotwells merged 1 commit into
mainfrom
claude/project-thread-1h922j
Nov 11, 2026
Merged

scotwells merged 1 commit into
mainfrom
claude/project-thread-1h922j

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Requested by Scot Schuchert-Wells · project thread

This follows up on the review of #641. A location restart replaced the whole Workload it had read, so if someone else edited the Workload at the same moment, the command failed with a conflict. It now patches only its own annotation, so it applies cleanly on top of other edits. It also documents how the annotation behaves after a restart, and adds tests for the cases the review pointed out.

Changes

  • Patch the restart annotation instead of updating the whole Workload.
  • Document that the annotation stays after the restart (a value that doesn't change doesn't roll again), that removing it rolls that location once more, and that an annotation for a location the workload doesn't place in is ignored. I chose to document this rather than clear the annotation: clearing it would itself cause a second roll.
  • Add tests for a restart that races another edit, and for an annotation that names a location the workload doesn't place in.

Test plan

  • The concurrent-edit test fails on the old code and passes with this change
  • The test for an unplaced location confirms no deployment gets the restart
  • make test and golangci-lint pass
  • After merge, a one-location restart in staging rolls only that location

Generated by Claude Code

A location restart replaced the whole Workload it had read earlier, so any
concurrent edit made the command fail with a conflict. It now sends a merge
patch of the one annotation, which applies cleanly over other changes.

Key changes:
- patch only the location restart annotation instead of updating the
  Workload
- document that the annotation stays after the restart and that removing
  it rolls the location once more
- test a restart that races another edit, and an annotation naming a
  location the workload does not place in
@scotwells
scotwells requested a review from a team as a code owner November 11, 2026 15:37
@scotwells
scotwells requested review from ecv and kevwilliams November 11, 2026 15:37
@scotwells scotwells self-assigned this Nov 11, 2026

@kevwilliams kevwilliams left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified MergeFrom without optimistic lock sends only the annotation with no resourceVersion, and the concurrent-edit test fails against a full Update.

@scotwells
scotwells merged commit 52f8652 into main Nov 11, 2026
12 checks passed
@scotwells
scotwells deleted the claude/project-thread-1h922j branch November 11, 2026 15:59
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.

2 participants