Skip to content

Show how to act on terminal required-check failures - #1507

Merged
mergify[bot] merged 3 commits into
mainfrom
lean178/1467-terminal-check-message
Nov 26, 2026
Merged

mergify[bot] merged 3 commits into
mainfrom
lean178/1467-terminal-check-message

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Show how to act on terminal required-check failures

Context and goal

  • Goal: A builder can go from a terminal readiness refusal to the failed job and decide whether rerunning helps.
  • Problem: The message gives a check name and conclusion without a link or next step.
  • Context: Required-check reasons also drive the wait policy, so recovery text belongs in the final rendering.

Closes #1467

Acceptance

  • Terminal required-check failures in ready and merge link to PR checks and explain when to retry.
  • Pending and waitable failures, verdicts, and exit codes stay unchanged.

Base

Base: 29a3f88

Validation

Recorded for 677c87b4c559

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Review

  • primary, claude, 677c87b, approve

eowca and others added 3 commits November 26, 2026 04:23
Architecture-Review: unchanged; Only refusal rendering changes, with the recorded readiness reasons left intact.
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on 677c87b4c5592104dccf841e97124c3eccc5ebe1, 45.4s: approve (0 critical, 0 important, 4 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread src/loopzero/cli.py
if (separator and check.startswith("required check '") and conclusion not in {"pending", "skipped"}
and reason not in readiness.waitable_failures):
yield (f"{reason}. Inspect {pr.url}/checks. Fix reproducible failures before retrying. "
"Rerun the failed job only for a transient failure. Once green, run `loopzero ready --wait`.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Merge refusals tell the builder to run loopzero ready --wait instead of a merge command

Both merge paths use _readiness_messages: cmd_merge (line 1626) and _merge_with_mergify (line 1545). In both, a failed required check ends with "Once green, run loopzero ready --wait". Someone who ran loopzero merge on a non-draft PR wants to merge, and ready --wait only reports readiness. They then have to work out that they still need loopzero merge. The existing hints in _merge_check_hint already say loopzero merge --wait. Smallest fix: give _readiness_messages a next_command parameter (or similar) and pass loopzero merge --wait from both merge callers.

Comment thread src/loopzero/cli.py
check, separator, conclusion = reason.rpartition("' is ")
if (separator and check.startswith("required check '") and conclusion not in {"pending", "skipped"}
and reason not in readiness.waitable_failures):
yield (f"{reason}. Inspect {pr.url}/checks. Fix reproducible failures before retrying. "

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: The recovery paragraph repeats once per failed check

The four-sentence guidance is added to every failing required check. With two or more terminal failures, ready prints the same paragraph on each not ready: line. Merge refusals join them with "; ", so one error line contains the paragraph several times. Consider adding the per-check URL and guidance once, after all reasons, for example as a single trailing next: line or suffix. That would also fit the ; next: ... style that _merge_check_hint already uses.

Comment thread src/loopzero/cli.py

def _readiness_messages(pr: github.PR, readiness: github.Readiness) -> Iterator[str]:
for reason in readiness.reasons:
check, separator, conclusion = reason.rpartition("' is ")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Terminal failures are found by parsing a message string built in another module

_readiness_messages uses rpartition("' is ") and a startswith test to take apart the f"required check '{name}' is {conclusion}" text built at github.py:1309. If someone rewords that text in github.readiness, the guidance silently stops appearing, and no type check catches it. _pending_checks already relies on string matching, but Readiness exposes waitable_failures and stale_verdicts as structured fields. A sturdier fix is a parallel field, for example terminal_failures, computed where the reason is built. _readiness_messages could then check membership instead of parsing text.

Comment thread tests/test_cli.py
"name": "checks", "status": "completed", "conclusion": "failure",
"check_suite": {"id": 10}}])
code, out, _ = run(capsys, "ready")
out = out.replace(FAILED_CHECK_HINT, "")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: No test checks that a waitable failure keeps its plain message

Acceptance requires waitable failures to stay unchanged, and the code handles this with reason not in readiness.waitable_failures. The updated tests only cover terminal failures, plus pending and skipped checks through tests that were already there. None renders a final not ready: line, or a merge refusal, for a stale or superseded failure listed in waitable_failures. Add one case, for example a stale verdict without --wait, asserting that the line has no FAILED_CHECK_HINT and that next: loopzero ready --wait or loopzero merge --wait is still printed. Also consider asserting the hint directly in test_ready_not_ready_lists_reasons rather than deleting it with out.replace, which hides where the hint appears.

@eowca
eowca marked this pull request as ready for review November 26, 2026 06:57
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as 3c0d117 at 07:05 UTC

8 min in the queue, 3 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 06:58 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1579
  • ✅ Merged 07:05 · 3c0d117 · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@mergify mergify Bot added the queued label Nov 26, 2026
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit 3c0d117 into main Nov 26, 2026
18 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/1467-terminal-check-message branch November 26, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Give a next action for terminal required-check failures at readiness

1 participant