From 12407f23e5e460f69f92bf7dde3da7c6ec7b4021 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Sat, 21 Nov 2026 14:22:29 +0100 Subject: [PATCH 1/2] docs(merge-gate-watcher): arm the watch on a pending check, not any check The reference said to arm gh pr checks --watch once a read has seen at least one check. A pull_request_target workflow that skips itself reports seconds after a push, so that one finished check was enough for --watch to exit 0 while the main workflow had not registered yet. The watch is now armed on a read that shows a pending check, and the check count is compared with the previous head's run. An eval covers the case. Signed-off-by: Sebastian Mendel --- skills/git-workflow/evals/evals.json | 24 +++++++++++++++++++ .../references/merge-gate-watcher.md | 17 ++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/skills/git-workflow/evals/evals.json b/skills/git-workflow/evals/evals.json index 5ac542c8..2710b806 100644 --- a/skills/git-workflow/evals/evals.json +++ b/skills/git-workflow/evals/evals.json @@ -1434,5 +1434,29 @@ "The Depends-on sentence and optional green check safely enforce the dependency." ] } + }, + { + "name": "watch-exit-zero-on-finished-check-only", + "prompt": "Right after a force-push I ran `gh pr checks 12 --watch`. It exited 0 at once and printed one line: `review-dependabot-pr skipping`. The previous head had 28 checks. Is the PR green?", + "assertions": [ + { + "type": "content", + "pattern": "pending" + }, + { + "type": "content", + "pattern": "(28|fewer|count)" + }, + { + "type": "content", + "pattern": "(re-?arm|not (yet )?registered|watched nothing)" + } + ], + "samples": { + "passing": "No. The watch exited on a check that had already finished, so it watched nothing. Only 1 of the previous 28 checks is listed, so the main workflow has not registered yet. Wait until a read shows a pending check, then re-arm the watch.", + "failing": [ + "Yes, the watch exited 0 with no failures, so the PR is green." + ] + } } ] diff --git a/skills/git-workflow/references/merge-gate-watcher.md b/skills/git-workflow/references/merge-gate-watcher.md index cbe59ee4..7da3f299 100644 --- a/skills/git-workflow/references/merge-gate-watcher.md +++ b/skills/git-workflow/references/merge-gate-watcher.md @@ -466,14 +466,25 @@ Two consequences for the loop: - Read the watcher's output, not only its exit code. A run that ends on the "no checks reported" line watched nothing and has to be re-armed. -- Give the runs a moment to appear, or arm the watcher on a read that has - already seen at least one check. A plain `gh pr checks ` right after the - push shows whether anything is `pending` yet; arm `--watch` once it does. +- Give the runs a moment to appear, and arm the watcher only on a read that + shows at least one check `pending`. A plain `gh pr checks ` right after the + push shows whether anything is `pending` yet; arm `--watch` once it does. A + check that has already finished does not count: a `pull_request_target` + workflow that skips itself, such as a Dependabot reviewer, reports seconds + after the push, and `--watch` exits 0 on it while the main workflow has not + registered yet. +- Compare the number of checks with the previous head's run. Far fewer checks + than last time means the rest have not registered yet. Seen 2026-09-18 on a rebase-and-force-push: the watcher returned immediately, `gh pr checks` a moment later listed seven checks all `pending`, and the re-armed watcher then reported them green. +Seen 2026-11-21 on phpDocumentor/guides#1448 after a force-push: the first +read listed one check, a skipped `review-dependabot-pr`, and `--watch` exited 0 +at once. The `Integrate` workflow registered 75 seconds after the push; the +previous head had 28 checks. + ## Auto-merge armed + CLEAN but never enqueued: disable/re-enable to nudge On a merge-queue repo a PR can sit `CLEAN` with auto-merge **armed** and every required check green, yet never gets a `mergeQueueEntry` — it silently fails to enter the queue, so the watcher just times out. Confirm the symptom, then re-arm to force GitHub to re-evaluate enqueue-readiness: From d53983cef6775e2e77bb50ca70532c80a3547566 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Sat, 21 Nov 2026 15:05:15 +0100 Subject: [PATCH 2/2] docs(merge-gate-watcher): settle a read with no pending check by the run list Review findings on the previous commit: - A read can show every check finished, with none pending. It now counts as complete only when gh run list --commit lists the workflows the previous head ran. - The check count is a warning, not proof: a changed matrix changes it. - The eval accepted an answer that used its words negated. Its first pattern now asks for "watched nothing" or "not registered", and that answer is a failing sample. Signed-off-by: Sebastian Mendel --- skills/git-workflow/evals/evals.json | 7 ++++--- skills/git-workflow/references/merge-gate-watcher.md | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/skills/git-workflow/evals/evals.json b/skills/git-workflow/evals/evals.json index 2710b806..5e15789f 100644 --- a/skills/git-workflow/evals/evals.json +++ b/skills/git-workflow/evals/evals.json @@ -1441,7 +1441,7 @@ "assertions": [ { "type": "content", - "pattern": "pending" + "pattern": "(watched nothing|not (yet )?registered)" }, { "type": "content", @@ -1449,13 +1449,14 @@ }, { "type": "content", - "pattern": "(re-?arm|not (yet )?registered|watched nothing)" + "pattern": "(re-?arm|wait)" } ], "samples": { "passing": "No. The watch exited on a check that had already finished, so it watched nothing. Only 1 of the previous 28 checks is listed, so the main workflow has not registered yet. Wait until a read shows a pending check, then re-arm the watch.", "failing": [ - "Yes, the watch exited 0 with no failures, so the PR is green." + "Yes, the watch exited 0 with no failures, so the PR is green.", + "Yes, the PR is green. There are no pending checks; the count is 1 of 28. Do not re-arm the watch." ] } } diff --git a/skills/git-workflow/references/merge-gate-watcher.md b/skills/git-workflow/references/merge-gate-watcher.md index 7da3f299..549107bc 100644 --- a/skills/git-workflow/references/merge-gate-watcher.md +++ b/skills/git-workflow/references/merge-gate-watcher.md @@ -473,8 +473,15 @@ Two consequences for the loop: workflow that skips itself, such as a Dependabot reviewer, reports seconds after the push, and `--watch` exits 0 on it while the main workflow has not registered yet. +- A read that shows no `pending` check is complete only when the workflows of + the current head are all there. Check that with + `gh run list --commit ` against the workflows the previous head ran, + then read `pr-status.sh`. Keep waiting while only self-skipping checks are + listed. - Compare the number of checks with the previous head's run. Far fewer checks - than last time means the rest have not registered yet. + than last time is a warning that the rest have not registered yet. It is not + proof: a change to a workflow or its matrix can change the count, so settle it + with the run list above. Seen 2026-09-18 on a rebase-and-force-push: the watcher returned immediately, `gh pr checks` a moment later listed seven checks all `pending`, and the