Skip to content

docs(git-workflow): wait for CI and fix code-caused check failures - #138

Merged
furedea merged 9 commits into
mainfrom
docs/wait-for-ci-and-fix-failing-checks
Nov 10, 2026
Merged

furedea merged 9 commits into
mainfrom
docs/wait-for-ci-and-fix-failing-checks

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

概要

lane が PR を出したあとの CI チェックの扱いを git-workflow の delivery 手順に追加した.

  • delivery.md に「Wait for CI」節を追加:push 後に gh run list --commit <sha> で CI run を探し(上限付きで待つ),gh run watch <run-id> --exit-status を裏で実行して通知を待つ(ポーリングしない).完了後 gh pr checks <n> --required で必須チェックを確認する
  • 失敗時は gh pr checks <n> で失敗チェックを特定し,gh run view <run-id> --log-failed でログを読む
  • コード起因(test,lint,format,型,Nix build/check)は直して手元確認し push,外部要因(AI レビューの利用上限,GitHub/ランナー障害,ネットワーク)は作業内容を変えず,再実行を 1 回まで,だめなら LANE-BLOCKED.判別できない場合も推測で直さず LANE-BLOCKED
  • 同じチェックの修正が 3 回で通らなければ止めて報告する
  • 「Review on GitHub」の手順 1 は新しい節を参照する形に整理し,重複を避けた

herdr-delegation の LANE-READY / LANE-BLOCKED の条件は既存の記述(required checks green かつ未対応の指摘なし,それ以外は理由付き LANE-BLOCKED)と矛盾しないため変更していない.

Closes #136

計画コメント: #136 (comment)

検証

  • uv run --with pytest python -m pytest tests/hooks/test_allowed_command.py:265 passed(gh pr checks,gh run view|rerun は既存ルールで許可される)
  • commit 時の lefthook(markdown/shell/commitlint など):通過

計画からの逸脱

なし.

🤖 Generated with Claude Code

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T17:38:24.657137Z
We couldn’t complete this review. Comment @codex review to try again.
73cde66 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.


After every push, wait for the PR's checks before handling review findings or reporting.

1. Run `gh pr checks <n> --watch --fail-fast` in the background and wait for its completion

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Running gh pr checks <n> --watch --fail-fast right after a push can exit before the new head commit has any check runs registered. Depending on the gh version, it either errors with "no checks reported on the '' branch" or exits non-zero right away. Since step 2 treats any completion as "on failure", a lane can misread this as a CI failure (and then likely an "Undetermined" LANE-BLOCKED). Consider saying to wait until checks for the pushed head SHA appear (or to rerun the watch if it reports no checks) before treating a non-zero exit as a failure.

locally, push, and return to step 1.
- External (AI review usage limit, GitHub or runner outage, network): do not change the work.
If a retry can help, run `gh run rerun <run-id> --failed` once; otherwise stop with
`LANE-BLOCKED: <check name and reason>`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: The External branch doesn't say what happens after gh run rerun <run-id> --failed. Unlike the Code-caused branch, it has no "return to step 1", and it doesn't say that a second failure of the rerun ends in LANE-BLOCKED. Also, this section applies to every delivery, not only herdr lanes, so a non-lane session is told to emit a LANE-* marker. Suggestion: "…once and return to step 1; if it fails again, stop with LANE-BLOCKED: … (outside a lane, report the reason to the user)."

@github-actions

Copy link
Copy Markdown

Review summary

This PR only changes documentation (agents/skills/git-workflow/references/delivery.md). I found nothing blocking (no P0 or P1).

  • P2: Right after a push, gh pr checks --watch --fail-fast can exit before any checks are registered for the new commit, and a lane could read that as a CI failure.
  • P3: The external-failure branch doesn't say what to do after a rerun, such as going back to step 1 or stopping with LANE-BLOCKED if it fails again. It also asks non-lane sessions to emit a LANE-* marker.

The allowed-command rules already cover gh pr checks and gh run view|rerun, so no new tests are needed.

🤖 Generated with Claude Code

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment on lines +74 to +79
- Code-caused (test, lint, format, type check, Nix build or check): fix it, run the same check
locally, push, and return to step 1.
- External (AI review usage limit, GitHub or runner outage, network): do not change the work.
If a retry can help, run `gh run rerun <run-id> --failed` once and return to step 1; if the
check fails again or a retry cannot help, stop and report the check name and reason.
- Undetermined: do not guess a fix; stop and report the check name and reason.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: a review check that fails on findings has no category here, so the lane stops instead of fixing.

claude-review and codex-review are both CI checks under all-green. This review job returns a blocking_findings count, which suggests the check fails when a P0 or P1 finding is raised. I couldn't open the pinned reusable workflow to confirm this.

If the check does fail on findings, this happens:

  • gh pr checks --watch --fail-fast exits on the review failure.
  • The cause is not code-caused (test/lint/format/type/Nix) and not external, so it lands in Undetermined.
  • The lane stops with LANE-BLOCKED before it reaches "Review on GitHub" steps 2–3, which say to read and fix every finding.
  • Step 1 (line 92) also requires waiting until all-green passes. With blocking findings it never passes, so the review loop can't start.

Suggested fix: add a category for review checks: "failed because of findings → go to Review on GitHub step 2". Also change line 92 to "until all checks finish" rather than "until all-green passes".

@github-actions

Copy link
Copy Markdown

Review summary

1 finding (P1). This PR only changes agents/skills/git-workflow/references/delivery.md.

  • P1: The new "Wait for CI" steps have no case for claude-review or codex-review failing because they raised findings. That failure lands in "Undetermined", so the lane stops with LANE-BLOCKED instead of going to "Review on GitHub" to fix the findings. Also, "Review on GitHub" step 1 now waits until all-green passes, which can't happen while blocking findings are open. This assumes the review checks fail when they raise blocking findings. That is implied by the blocking_findings output, but I couldn't open the pinned reusable workflow to confirm it. Details are in the inline comment.

The rest looks fine: the gh pr checks and gh run view|rerun commands are already allowed in allowed_commands.json, and the LANE-BLOCKED wording matches herdr-delegation. There is no executable behavior to test.

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

[reusable-workflows README](https://github.com/furedea/reusable-workflows#readme).

1. After pushing, wait for `all-green`.
1. After pushing, [wait for CI](#wait-for-ci) until every check has finished; failures that are review findings are

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This says to wait "until every check has finished", but the Wait for CI procedure it points to uses gh pr checks <n> --watch --fail-fast. That command exits on the first failure, and a review check failing because it raised findings is a normal failure here. So the watch can return while codex-review or other checks are still running, and step 3 sends the agent straight back to this section. Nothing tells the agent to keep waiting for the remaining checks, so it can read findings while one reviewer is still running and then report early. Consider adding a line that says: after a review-findings failure, run gh pr checks <n> --watch without --fail-fast until every check has finished. A related gap: the aggregate all-green check fails whenever any check fails and fits none of the step 3 categories, so it could be classed as "Undetermined" and lead to an unneeded LANE-BLOCKED.

@github-actions

Copy link
Copy Markdown

Review summary

This PR only changes docs: it adds a Wait for CI section to git-workflow/references/delivery.md. The commands it relies on (gh pr checks, gh run view, gh run rerun) are already allowed by agents/hooks/rules/allowed_commands.json. The new section does not conflict with the LANE-READY/LANE-BLOCKED rules in herdr-delegation.

Findings:

  • P2: --fail-fast makes the watch exit on the first failure, including a review check that failed because it raised findings. Review on GitHub step 1 says to wait until every check has finished, but nothing says to keep watching the checks that are still running. Separately, the aggregate all-green check fits none of the step 3 categories, so it could be classed as Undetermined. See the inline comment.

No blocking issues.

🤖 Generated with Claude Code

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Review summary: I found nothing that should block this PR. It only changes docs (agents/skills/git-workflow/references/delivery.md). The new "Wait for CI" procedure fits the existing "Review on GitHub" steps and the LANE-READY / LANE-BLOCKED rules in herdr-delegation. The commands it uses (gh pr checks --watch [--fail-fast], gh run view --log-failed, gh run rerun --failed) are valid. The check names claude-review, codex-review and all-green match the jobs in .github/workflows/ci.yml. No code changed, so no tests are needed.

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Review summary

I found no blocking issues. This PR only changes documentation (agents/skills/git-workflow/references/delivery.md).

  • The new Wait for CI section matches the existing LANE-READY / LANE-BLOCKED conditions in herdr-delegation.
  • The existing allow rules in agents/hooks/rules/allowed_commands.json already permit every command it uses: gh pr checks and gh run view|watch|rerun.
  • Review checks that fail because they raised findings are sent to Review on GitHub. The section also covers how --fail-fast interacts with them, and it says how to classify an all-green failure.
  • No behavior changed, so no new tests are needed.

Findings: P0 0 · P1 0 · P2 0 · P3 0

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment on lines +66 to +77
After every push, wait for the PR's checks before handling review findings or reporting.

1. Print the pushed commit with `git rev-parse HEAD`, then find its CI run with
`gh run list --commit <sha>`, writing the literal SHA (a shell variable triggers a confirmation
prompt); the run exists from push time, possibly `queued`. If none is listed, wait briefly and look again, up to a fixed
bound (for example 2 minutes). If none appears within it, the workflow did not trigger: stop and
report instead of waiting forever.
2. Wait for each relevant run with `gh run watch <run-id> --exit-status` as one blocking background
command and take its completion notification. Do not poll: one blocking command, or one bounded
wait for the run to appear, is fine; repeated manual checks across turns are not.
3. When the runs have finished, confirm the repository's required check (`all-green` where it
exists) with `gh pr checks <n> --required`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This section says "After every push" and isn't limited to particular repositories, but it assumes the repo has a CI workflow and at least one required check. Step 1 tells the agent to stop and report when no run shows up within the bound. In a repo that has no Actions workflow for PRs, every push will end in a stop (or LANE-BLOCKED for a lane). Step 3 has a similar gap: if a repo has no required checks configured, gh pr checks <n> --required prints "no required checks reported" and exits non-zero. The agent can read that exit code as a failed check, and since no failing check fits any bucket in step 5 it ends up as "Undetermined" and stops. Consider saying what to do when the repo has no CI or no required checks (for example, skip this section, or fall back to gh pr checks <n>).

@github-actions

Copy link
Copy Markdown

Review summary

Reviewed the new Wait for CI section in agents/skills/git-workflow/references/delivery.md and the change to step 1 of Review on GitHub. Nothing blocks the merge.

  • P2 (inline comment): The steps assume every repository has a PR CI workflow and at least one required check. In a repo without them, step 1 stops when no run appears. Step 3's gh pr checks --required exits non-zero when no required checks are configured, which the agent can mistake for a failed check. Either way the agent stops or reports LANE-BLOCKED when nothing is actually wrong.

Other things I checked:

  • The commands in the section (gh run list, gh run watch, gh run view, gh run rerun, gh pr checks) are covered by agents/hooks/rules/allowed_commands.json.
  • ci.yml uses cancel-in-progress, so a fix push cancels the old run. That doesn't cause a problem, because the steps send the agent back to step 1 to look up the run for the new SHA.
  • The PR description says gh pr checks <n> --watch --fail-fast, but the diff uses gh run watch --exit-status. The body is stale, but this isn't a code issue.

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Review summary

No blocking findings.

This PR changes only docs (agents/skills/git-workflow/references/delivery.md). Here is what I checked:

  • Every command the new Wait for CI section tells agents to run (git rev-parse, gh run list|view|watch|rerun, gh pr checks) is already allowed by agents/hooks/rules/allowed_commands.json, so following these steps won't trigger extra permission prompts.
  • The new section and Review on GitHub step 1 agree on who handles failing review checks (claude-review / codex-review). Each section sends those to the review steps, so neither one loops back to the other.
  • The LANE-BLOCKED reporting matches the existing LANE-READY / LANE-BLOCKED conditions in herdr-delegation/SKILL.md.
  • ci.yml has no paths filters, so the rule "stop if no run appears within the time limit" won't wrongly block PRs in this repo.

The PR adds no executable behavior, so no tests are needed.

Blocking findings (P0/P1): 0

@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Review summary

No P0–P3 findings.

This PR only changes docs (agents/skills/git-workflow/references/delivery.md). What I checked:

  • All the gh commands it relies on are already allowed by agents/hooks/rules/allowed_commands.json: gh pr checks, and gh run list, view, watch and rerun. So the lanes won't hit confirmation prompts.
  • The new stop conditions fit what herdr-delegation expects: a lane reports LANE-READY only when the required checks are green, and LANE-BLOCKED with a reason otherwise.
  • Failures that are review findings go to Review on GitHub, so the two sections don't overlap or loop into each other.
  • No behavior covered by tests changed, so no new tests are needed.

🤖 Generated with Claude Code

@furedea
furedea merged commit 2bcebd0 into main Nov 10, 2026
22 of 24 checks passed
@furedea
furedea deleted the docs/wait-for-ci-and-fix-failing-checks branch November 10, 2026 18:06
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.

docs(git-workflow): wait for CI and fix failing checks in lanes

1 participant