Repository navigation
feat(commitrequest)!: say why a write outside a save's window closed it early, and split identity_change into precise close reasons - #491
Merged
sunib merged 3 commits intoNov 27, 2026
Conversation
…window early When a write by another author touches a file an open window holds, the window closes with path_conflict, and a request attached to it commits less than its author may have meant to save. Nothing on the request said so. The worker now marks the request when path_conflict closes its window, FinalizeResult carries the mark as ClosedByPathConflict, and the request's Ready and Reconciling messages add that the window closed early. The reason is unchanged, so clients that read Committed keep working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 26 minutes. View limit details
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. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…d it early, and split identity_change A save's window is cut short not only by path_conflict. A write of another GitTarget on the branch, another author writing where the files cannot be proven apart, a write after the worker fell back to one window, and the fallback itself close it too. All of these used to be one close reason, identity_change, apart from the last two. git_commit_windows_total's identity_change is now three precise reasons: other_target, unproven_footprint and single_window. With timer_source="commit_request" the counter shows which saves were cut short, and why. FinalizeResult.WindowClosedEarly carries that close reason for path_conflict, unproven_footprint, other_target, single_window and footprint_fallback, and the request's Ready and Reconciling messages say why its window closed early. The reason is unchanged. BREAKING CHANGE: gitopsreverser_git_commit_windows_total no longer has close_reason="identity_change". It is one of other_target, unproven_footprint or single_window; sum the three for the old total. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt as unproven_footprint closeConflictingWindows reproves the open windows before a write and closed every overlapping pair with path_conflict. After a GitTarget change makes the footprints unknown, they overlap only because nothing is proven, so a save attached to one was told another author touched its file. A pair that shares a proven path still closes with path_conflict; a pair that overlaps through an unknown footprint closes with unproven_footprint. The reference model makes the same split. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #490. Answers gitops-api ask #42, and open question 3 in
docs/design/concurrent-author-windows.md.Problem
A save's window can close before its own timers run out because of a write outside it. The save then commits what the window held at that point, without its author's later edits, and nothing on the request said so. The metric couldn't tell most of these situations apart either:
close_reason="identity_change"covered three different causes.Change
Close reasons.
identity_changeis replaced by three precise reasons:close_reason(log form)other_target(other-target)GitTargeton the same branch arrives; GitTargets on one branch commit one window at a timeunproven_footprint(unproven-footprint)single_window(single-window)path_conflictandfootprint_fallbackstay as they are. Ongit_commit_windows_total, the existingtimer_source="commit_request"label picks out windows a save was attached to. Together, they show how many saves were cut short and by what. No new metric is needed.Request status. A request whose window closed for one of those five reasons gets
FinalizeResult.WindowClosedEarlyset to thatclose_reasonvalue:finalizeWindowand copies the mark onto the result inresolveCommitRequest. The "CommitRequest resolved" log line includes it.ReadyandReconciling: "the window closed early, because : edits made after that are not part of this save". Each cause has its own wording.Readyreason is unchanged (Committed,AlreadyPresent), and a failure keeps only its own message.Not reported: closes that pre-date concurrent windows and aren't caused by another write:
buffer_limit,foreign_commit,apply_due,resync_before_apply,shutdown.attach_nextisn't reported either, since the author's own next save causes it.Docs:
interpreting-metrics.mdgains the new values and how to read save windows, andUPGRADING.mdgains an entry.configuration.md,push-cooldown.mdand the concurrent-windows design doc are updated; the design doc's history of the pre-stage-2identity_changeis left as it was.Breaking change
gitopsreverser_git_commit_windows_totalno longer hasclose_reason="identity_change". A query or alert on it matches nothing. Sumother_target,unproven_footprintandsingle_windowfor the old total.Tests
TestWindowAdmission_ARequestWhoseWindowAnotherWriteClosedIsToldWhyputs a request on alice's window, then a write outside it arrives. Five cases:path_conflict;unproven_footprint;team-b:other_target;single_window;TestWindowFinalizeReason_ClosedEarlyByAnotherWrite: exactly the five reasons are reported, under the exported values.TestCommitWindowMetrics_*:single_windowis counted under its own name, and every reason maps to its label.TestApplyFinalizeResultToStatus: each value adds its own note toCommittedandAlreadyPresent; other values and failures get none.window_model_test.go) now usesunproven_footprintand still agrees with the worker.TestWindowAdmission_AGitTargetChangeProvesTheOpenWindowsAgain: a GitTarget change makes two open windows' footprints unknown, and both now close asunproven_footprint, notpath_conflict. Before the fix,closeConflictingWindowscalled every overlap apath_conflict, so alice's save would have been told another author touched its file. The reference model makes the same split.🤖 Generated with Claude Code