watchpr: describe arming as a one-way latch, not a window restart
The docs claimed every later head/base move restarts the conflict window. arm() returns early once armed, so only the first move sets armedAt and every move after it is a no-op. State the real trade-off instead: repeated moves do not extend the debounce, so a conflict can be confirmed while the newest recompute is younger than the window. Also narrow the --json stderr claim to the notices watchpr writes itself (cobra's terminal Error: line is plain text), rename the test to what it covers, and stop the unknown-mergeability baseline implying a false answer arms the rule.
This commit is contained in:
@@ -257,10 +257,12 @@ func TestBaselineIsEmittedInJSONMode(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Under --json stderr is the baseline and warning channel, so it has to be one
|
||||
// shape: a caller parsing it line by line must never meet a bare `warning:`
|
||||
// line between two NDJSON records.
|
||||
func TestJSONModeStderrIsAllRecords(t *testing.T) {
|
||||
// Under --json stderr is the baseline and warning channel, so every notice
|
||||
// watchpr writes there has to be one shape: a caller parsing it line by line
|
||||
// must never meet a bare `warning:` line between two NDJSON records. Cobra's
|
||||
// terminal `Error: ...` line is not covered here -- SilenceErrors stays off, so
|
||||
// it is plain text on stderr alongside a non-zero exit.
|
||||
func TestJSONModeWarningsAndBaselineAreRecords(t *testing.T) {
|
||||
st := agent.PRState{
|
||||
Ref: agent.PRRef{Owner: "unkin", Repo: "repo", Number: 7},
|
||||
State: "open",
|
||||
|
||||
Reference in New Issue
Block a user