fleetd #621: make the context-roll notice obey requireOperatorConfirm #622
Reference in New Issue
Block a user
Delete Branch "worker/621-b4520b-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #621.
LeadHeartbeatLoop.contextNotice(...)built its closing sentences unconditionally: "ask the operator" and "Only the operator can approve the roll", with no config reaching it.LeadRollover.confirm(...)already honoursleadRollover.requireOperatorConfirm(LeadRollover.java:480), so setting the knob tofalsestopped the daemon refusing the roll but did nothing about the instruction the lead actually receives — a lead that follows its own text still asks the operator.This change threads the effective
requireOperatorConfirmvalue through:contextNoticegains a 4-arg overload(enabled, reading, alreadyNotified, requireOperatorConfirm). The existing 2-arg and 3-arg overloads delegate to it withrequireOperatorConfirm=true, so every existing caller (including every pre-#621 test) keeps byte-identical text.LeadHeartbeatLoopgains a 14-arg constructor carrying the flag; the existing 13-arg constructor delegates withtrue.Fleetd.javacomputes the effective value (cfg.leadRollover() == null || cfg.leadRollover().requireOperatorConfirm()) and passes it at construction.false, the notice now tells the lead to confirm on its own judgement and names the actual gate: the handover file must exist, be modified after theopen()request, and not be older thanmaxDocAgeSeconds.LeadRollover.confirm's own enforcement is untouched — this PR is the message only, per the ticket's stated scope.Tests
LeadHeartbeatLoopTest:contextNoticeKeepsAskingTheOperatorWhenRequireOperatorConfirmIsTrueandcontextNoticeDropsTheOperatorAskWhenRequireOperatorConfirmIsFalse, asserting on the returned string (not source text).expected: <false> but was: <true>), then restored the fix.mvn clean installfromfleetd/:Tests run: 1879, Failures: 0, Errors: 0—BUILD SUCCESS. Baseline onmainwas 1877; this PR adds 2 tests.Not in this PR
wiki/11-Features.md—wiki/is an uninitialized submodule in my worktree. The wiki entry text is in my handoff to the lead, who will paste it in.