fix(claude-code-review): finalize stuck check + add check_neutral summary-mode#105
fix(claude-code-review): finalize stuck check + add check_neutral summary-mode#105JBWatenbergScality wants to merge 3 commits into
Conversation
…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>
|
LGTM |
|
LGTM |
| 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) |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
should not be called when using legacy skill (from the repo) which does not rely on the script...
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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>
a0fe571 to
f643d5a
Compare
|
LGTM |
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>
|
LGTM |
Summary
Two additive changes to the reusable
Claude Code Reviewworkflow:Finalize stuck
in_progresschecks — theRun Claude Code Reviewstep hascontinue-on-error: trueand the job has a 15-mintimeout-minutes. If Claude crashes, times out, or the runner is cancelled after the initialin_progresspublish, theClaude Code Reviewcheck stays atstatus=in_progressforever and blocks any branch protection that waits on it.Adds a post-step that runs when
steps.claude-review.outcome != 'success'. It locatespublish-summary.shin whichever marketplace was checked out (glob:.marketplaces/*/plugins/scality-skills/skills/review-pr/publish-summary.sh) and invokes it with thecancelledconclusion, finalizing the check with a link back to the workflow run.New
check_neutralvalue forsummary-mode— likecheck(check run only, no fallback) but uses GitHub's non-blockingneutralconclusion 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. Defaultautopreserves the existing blocking-check contract for consumers who rely on it in branch protection.The actual
action_required→neutraltranslation lives inpublish-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_neutralinPUBLISH_MODEand thecancelledconclusion handling inpublish-summary.sh.This PR is a no-op for
check_neutraluntil scality/agent-hub#47 lands, but the finalization step is functional immediately (the existing script already passescancelledstraight to GitHub's API).Test plan
check_neutralresolves andcancelledgets its title/emoji.summary-mode: auto(default). Verify the check still publishes asaction_requiredwhen issues are found (existing consumers see no change).summary-mode: check_neutraland verifies the check appears asneutral(grey circle, full summary visible, no contribution to theRequiredCI status).cancelledwith a link to the run, not stuck atin_progress.timeout-minutes: 1) and verify the post-step still runs viaalways()and finalizes the check.steps.claude-review.outcome == 'success') — no double-finalization.🤖 Generated with Claude Code