watchpr: describe arming as a one-way latch, not a window restart
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful

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:
2026-09-26 22:30:14 +10:00
parent 5928233a97
commit ebdd25f725
3 changed files with 30 additions and 14 deletions
+12 -4
View File
@@ -105,10 +105,18 @@ reported while the commits stay put: nothing in Gitea's payload separates it fro
a merge check still in flight, and the baseline line is the only notice of it.
That is a narrower gap than it looks, because `base.sha` is the base branch's
tip — it moves for every open PR whenever anything merges to the base branch, so
the commits rarely stay put for long. A move like that arms the rule, and the
move itself is silent: the window restarts from it, so what is eventually
reported is a conflict still standing two minutes after that fresh merge
computation began, never the run of falses that preceded it.
the commits rarely stay put for long. The first such move arms the rule, and is
itself silent: the window then runs from that arming poll rather than from the
falses that predate it, so what is eventually reported is a conflict that
outlasted the merge computation the move started.
Arming is a one-way latch. Moves after that one — and every move seen by a watch
that was already armed at the baseline — neither re-arm nor restart the window,
because a restart on every `base.sha` move could never complete on a busy base
branch. That is the cost side of the same trade: on a busy base branch a
conflict can be confirmed while the newest merge recompute is less than two
minutes old. The window guarantees that the run of falses outlasted *a* merge
computation this watch saw start, not that it outlasted the most recent one.
```bash
# Watch until something meaningful happens (default interval 60s)