Skip to content

fix(claude-code-review): finalize stuck check + add check_neutral summary-mode#105

Open
JBWatenbergScality wants to merge 3 commits into
mainfrom
fix/review-finalize-stuck-check
Open

fix(claude-code-review): finalize stuck check + add check_neutral summary-mode#105
JBWatenbergScality wants to merge 3 commits into
mainfrom
fix/review-finalize-stuck-check

Conversation

@JBWatenbergScality
Copy link
Copy Markdown

@JBWatenbergScality JBWatenbergScality commented May 19, 2026

Summary

Two additive changes to the reusable Claude Code Review workflow:

  1. Finalize stuck in_progress checks — the Run Claude Code Review step has continue-on-error: true and the job has a 15-min timeout-minutes. If Claude crashes, times out, or the runner is cancelled after the initial in_progress publish, the Claude Code Review check stays at status=in_progress forever and blocks any branch protection that waits on it.
    Adds a post-step that runs when steps.claude-review.outcome != 'success'. It locates publish-summary.sh in whichever marketplace was checked out (glob: .marketplaces/*/plugins/scality-skills/skills/review-pr/publish-summary.sh) and invokes it with the cancelled conclusion, finalizing the check with a link back to the workflow run.

  2. New check_neutral value for summary-mode — like check (check run only, no fallback) but uses GitHub's non-blocking neutral conclusion when issues are found, so the review check does not contribute a failure to the PR status rollup and stops shadowing real CI checks. The full review summary still appears in the check run. Default auto preserves the existing blocking-check contract for consumers who rely on it in branch protection.

The actual action_requiredneutral translation lives in publish-summary.sh (scality/agent-hub#47); this PR just surfaces the new mode at the workflow input layer.

Companion

scality/agent-hub#47 — implements check_neutral in PUBLISH_MODE and the cancelled conclusion handling in publish-summary.sh.

This PR is a no-op for check_neutral until scality/agent-hub#47 lands, but the finalization step is functional immediately (the existing script already passes cancelled straight to GitHub's API).

Test plan

  • Merge scality/agent-hub#47 first so check_neutral resolves and cancelled gets its title/emoji.
  • Default-path: run a normal review with summary-mode: auto (default). Verify the check still publishes as action_required when issues are found (existing consumers see no change).
  • Opt-in path: a consumer sets summary-mode: check_neutral and verifies the check appears as neutral (grey circle, full summary visible, no contribution to the Required CI status).
  • Failure path: trigger a Claude failure (invalid prompt arg) and verify the check ends as cancelled with a link to the run, not stuck at in_progress.
  • Timeout path: force a runner timeout (timeout-minutes: 1) and verify the post-step still runs via always() and finalizes the check.
  • Happy path: a normal completed review skips the post-step (steps.claude-review.outcome == 'success') — no double-finalization.

🤖 Generated with Claude Code

…ilure

The reusable Claude code-review workflow publishes an "in_progress" check
at the start of the review and relies on Claude itself to call
publish-summary.sh again with the final conclusion. When the Claude
action fails (continue-on-error masks it), the 15-min timeout fires, or
the runner is cancelled, the check sits at status=in_progress forever
and blocks any branch protection that waits on it.

Add a post-step that runs when steps.claude-review.outcome != 'success'.
It locates publish-summary.sh in whichever marketplace was checked out
and invokes it with the new "cancelled" conclusion, which finalizes the
check with a link back to the workflow run.

Companion: scality/agent-hub#47 — adds the "cancelled" conclusion (and
switches the success-with-issues conclusion from "action_required" to
"neutral" so the check no longer shadows real CI status).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented May 19, 2026

LGTM

Review by Claude Code

@JBWatenbergScality JBWatenbergScality marked this pull request as ready for review May 20, 2026 14:32
@JBWatenbergScality JBWatenbergScality requested a review from a team as a code owner May 20, 2026 14:32
@JBWatenbergScality JBWatenbergScality changed the title fix(claude-code-review): finalize stuck "in_progress" check on job failure fix(claude-code-review): finalize stuck check + add neutral-on-issues opt-in May 20, 2026
@claude
Copy link
Copy Markdown

claude Bot commented May 20, 2026

LGTM

Review by Claude Code

HEAD_SHA: ${{ github.event.pull_request.head.sha }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
script=$(ls .marketplaces/*/plugins/scality-skills/skills/review-pr/publish-summary.sh 2>/dev/null | head -1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This seems rather explicit and if we change the location or name of this script we break everything; are we sure to use it this way?

- name: Finalize stuck Claude Code Review check
if: always() && steps.claude-review.outcome != 'success'
env:
GH_TOKEN: ${{ github.token }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should not be needed, set already by GitHub?

PUBLISH_MODE: ${{ inputs.summary-mode }}
CLAUDE_REVIEW_NEUTRAL: ${{ inputs.neutral-on-issues }}

# Finalize the "Claude Code Review" check when the review job did not
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FYI (and probably not the point of this PR) : ideally, I would have called the script from here, instead of letting claude do it. This however required finding how to generate an "outcome" from Claude, and process it in next step, which I did not have to investigate....

(start of review could be posted here instead of in the skill)

# Without this the check sits at status=in_progress forever and blocks
# any branch protection that waits on it.
- name: Finalize stuck Claude Code Review check
if: always() && steps.claude-review.outcome != 'success'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should not be called when using legacy skill (from the repo) which does not rely on the script...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added steps.claude-review.outcome != 'success' so it only applies when required

- comment: post as a PR comment
- auto: check if allowed, otherwise post as a comment
default: auto
neutral-on-issues:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

seems to be would be better as another summary-mode (neutral-check maybe?)

Folds the neutral opt-in into the existing summary-mode input instead of
adding a new boolean. Consumers select between blocking and non-blocking
review checks the same way they already select between check / comment /
auto.

- check_neutral: like `check` (check run only, no fallback) but uses
  GitHub's non-blocking `neutral` conclusion when issues are found, so
  the review check does not contribute a failure to the PR status
  rollup and stops shadowing real CI checks. The full review summary
  still appears in the check run.

The actual `action_required` → `neutral` translation lives in
publish-summary.sh (scality/agent-hub#47); this PR just exposes the
new mode at the workflow input layer.

Default (auto) preserves the historical blocking behavior, so existing
consumers see no change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@JBWatenbergScality JBWatenbergScality force-pushed the fix/review-finalize-stuck-check branch from a0fe571 to f643d5a Compare May 20, 2026 15:31
@JBWatenbergScality JBWatenbergScality changed the title fix(claude-code-review): finalize stuck check + add neutral-on-issues opt-in fix(claude-code-review): finalize stuck check + add check_neutral summary-mode May 20, 2026
@claude
Copy link
Copy Markdown

claude Bot commented May 20, 2026

LGTM

Review by Claude Code

Addresses three review comments on PR #105:

- charlesprost: the previous step hardcoded the path to publish-summary.sh
  in the agent-hub marketplace checkout, so renaming or moving the script
  would silently break this workflow. The finalize step does exactly one
  thing — find the in-progress "Claude Code Review" check on this SHA and
  PATCH it to cancelled — which is ~10 lines of gh api with no skill
  coupling. Title/summary formatting now lives in two places (here and in
  publish-summary.sh) but is unlikely to evolve; worth the decoupling.

- francoisferrand: the GH_TOKEN env line is redundant — gh CLI picks up
  the runner-injected GITHUB_TOKEN automatically when the job has the
  appropriate permissions block (which this one does).

- francoisferrand: legacy skills that do not publish an in_progress check
  no longer cause a spurious script invocation. The gh api GET returns
  empty for those cases and the step exits 0 naturally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented May 20, 2026

LGTM

Review by Claude Code

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.

3 participants