Skip to content

Add automated Claude PR review - #208

Merged
ljwharbers merged 5 commits into
devfrom
ci/claude-review
Sep 29, 2026
Merged

ljwharbers merged 5 commits into
devfrom
ci/claude-review

Conversation

@ljwharbers

@ljwharbers ljwharbers commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds automated Claude PR review, replacing the stock workflows removed in bf8fa56. Those ran 13 times between March and April and never posted a comment, because the template set pull-requests: read and never asked for comments.

  • .github/workflows/claude-review.yml
    • Reviews PRs from branches of this repo when they are opened, reopened or marked ready for review. It skips drafts and does not re-run on every push.
    • A maintainer (OWNER/MEMBER/COLLABORATOR) can comment @claude review on any PR, including fork PRs, which don't get secrets on pull_request.
    • Findings are posted as inline comments, plus a one-line summary comment.
    • The base branch is checked out at the workspace root and the PR head in pr-head/, read-only. A fork PR therefore can't supply Claude settings, hooks or review rules. Claude's tools are limited to Read/Grep/Glob, the inline-comment tool and gh pr view/diff/comment.
    • Uses the existing CLAUDE_CODE_OAUTH_TOKEN secret. The action is pinned by SHA (v1.0.236).
  • REVIEW.md: lrsomatic-specific review checks drawn from past reviews: small-tag CI coverage gaps, snapshots under errorStrategy 'ignore', CHM13 and custom-genome paths, container pairs, schema and docs. It also works as a guide for human reviewers.

Things to know

  • Nothing runs until the workflow is on main (Add Claude PR review workflow to main #209). claude-code-action refuses to run unless the PR's copy of the workflow is identical to the one on the default branch ("Workflow validation failed ... identical content to the version on the repository's default branch"). On top of that, issue_comment workflows only run from main. So this PR and Add Claude PR review workflow to main #209 are both skipped by design. After Add Claude PR review workflow to main #209 merges, every PR whose claude-review.yml matches main gets reviewed. Any future change to the workflow has to land on main (via patch) before it takes effect.
  • CI review is static. It cannot run nf-test, and it is told never to claim tests pass. Merge-gating reviews still need the Slurm test array.
  • Once this is confirmed posting, Copilot automatic review should be turned off in repo settings to avoid duplicate reviews.

Testing

  • Pre-commit/prettier pass. The workflow YAML parses.
  • This PR is opened as a draft, so no review runs yet. Marking it ready for review should trigger the first real run on this PR. Check that inline comments and a summary appear.

PR checklist

  • This comment contains a description of changes (with reason).

🤖 Generated with Claude Code

ljwharbers and others added 3 commits September 29, 2026 15:52
Replaces the removed stock workflows (bf8fa56), which ran with
pull-requests: read and never posted a comment. This one posts inline
comments, auto-reviews same-repo PRs when opened or marked ready, and
lets maintainers request a review on fork PRs with `@claude review`.
The PR head is checked out read-only in pr-head/ so a fork cannot
supply Claude settings or hooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 9a39c9c

+| ✅ 215 tests passed       |+
#| ❔  21 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗  40 tests had warnings |!
Details

❗ Test warnings:

  • nextflow_config - Config manifest.version should end in dev: 1.1.0
  • pipeline_todos - TODO string in nextflow.config: Specify your pipeline's command line flags
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in README.md: Include a figure that guides the user through the major workflow steps. Many nf-core
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in lint_log.txt: Named file extensions MUST be emitted for ALL output channels
  • pipeline_todos - TODO string in lint_log.txt: List additional required output channels/values here
  • pipeline_todos - TODO string in meta.yml: #Add a description of the module and list keywords
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in base.config: Customise requirements for specific processes.
  • pipeline_todos - TODO string in CONTRIBUTING.md: Add any pipeline specific contribution guidelines here, such as coding styles, procedures, checklists etc.
  • schema_description - Ungrouped param in schema: skip_modkit
  • schema_description - No description provided in schema for parameter: generate_gvcf
  • schema_description - No description provided in schema for parameter: autocorrelation
  • schema_description - No description provided in schema for parameter: vep_custom
  • schema_description - No description provided in schema for parameter: vep_custom_tbi
  • schema_description - No description provided in schema for parameter: severus_minsupport
  • schema_description - No description provided in schema for parameter: wakhan_chroms
  • local_component_structure - prepare_vep_plugins.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - deepsomatic.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - small_variant_consensus.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_reference_files.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_annotation.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - prepare_signatures.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure
  • local_component_structure - phasing_haplotyping.nf in subworkflows/local should be moved to a SUBWORKFLOW_NAME/main.nf structure

❔ Tests ignored:

  • files_exist - File is ignored: CODE_OF_CONDUCT.md
  • files_exist - File is ignored: assets/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_exist - File is ignored: .github/ISSUE_TEMPLATE/config.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • files_exist - File is ignored: .github/CONTRIBUTING.md
  • nextflow_config - Config variable ignored: manifest.name
  • nextflow_config - Config variable ignored: manifest.homePage
  • files_unchanged - File ignored due to lint config: CODE_OF_CONDUCT.md
  • files_unchanged - File ignored due to lint config: .github/ISSUE_TEMPLATE/bug_report.yml
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File ignored due to lint config: .github/workflows/branch.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/email_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-lrsomatic_logo_dark.png
  • files_unchanged - File ignored due to lint config: docs/README.md
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/lrsomatic/lrsomatic/.github/workflows/awstest.yml

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 4.1.0
  • Run at 2026-09-29 14:23:51

ljwharbers and others added 2 commits September 29, 2026 16:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ljwharbers
ljwharbers marked this pull request as ready for review September 29, 2026 14:21
@ljwharbers
ljwharbers merged commit f66cadc into dev Sep 29, 2026
5 of 6 checks passed
@ljwharbers
ljwharbers deleted the ci/claude-review branch September 29, 2026 14:21
Comment on lines +18 to +20
concurrency:
group: claude-review-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Any PR comment cancels a review that is still running. Workflow-level concurrency applies before the job-level if runs. Every issue_comment on the PR (a human comment, a bot comment, or the review's own gh pr comment summary if it is posted with an app token) starts a run in the group claude-review-<N>, and cancel-in-progress: true cancels the review in progress. The new run is then skipped by the if. In practice, a comment posted during a review of up to 30 minutes stops it, often before any inline comments are posted.

Move the concurrency block into the review job. A job skipped by its if doesn't take a concurrency slot:

jobs:
  review:
    if: ...
    concurrency:
      group: claude-review-${{ github.event.pull_request.number || github.event.issue.number }}
      cancel-in-progress: true

Comment on lines +42 to +45
- name: Check out base branch (trusted)
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

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 step doesn't check out the base branch on pull_request events. With no ref, actions/checkout uses github.sha. For pull_request that SHA is the test merge commit refs/pull/N/merge, which already contains the PR's changes. A run on this PR shows it: the workspace root HEAD is "Merge 9a39c9c… into 6c553bc…". So on automatic runs, Claude loads REVIEW.md, CLAUDE.md and .claude/ settings from the PR, not from trusted code. The header comment (lines 8-10) says the opposite.

Because the pull_request path only runs for same-repo branches, the practical risk is low. But the claim is wrong, and a PR can change the rules it is reviewed against. There is a second mismatch: on issue_comment, the default ref is the default branch (main), while PRs here target dev. So the REVIEW.md used there can differ from the one on the PR's base branch.

Suggested fix: pin the ref explicitly, e.g. ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }}. The issue_comment path could also resolve the PR's base ref with gh pr view first. Alternatively, correct the comment.

Comment thread REVIEW.md

## Documentation

- `CHANGELOG.md` has an entry under the `dev` version with the PR number.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing CHANGELOG entry. This PR breaks the rule it adds: CHANGELOG.md has no #208 entry under v1.2.0dev. Earlier Claude workflow changes were logged (#150 added them, #160 removed them), so this re-addition should be logged too. For example, under Added: [#208](https://github.com/IntGenomicsLab/lrsomatic/pull/208) - Added automated Claude PR review (.github/workflows/claude-review.yml) and REVIEW.md (@ljwharbers).

@claude

claude Bot commented Sep 29, 2026

Copy link
Copy Markdown

Claude review: 3 findings. (1) Workflow-level concurrency with cancel-in-progress lets any PR comment cancel a review that is still running; move it into the job. (2) On pull_request, the 'base branch' checkout is actually the PR merge commit, so REVIEW.md and Claude settings come from the PR; on issue_comment they come from main, not the dev base. (3) No CHANGELOG entry for #208. For a human to check (this can't be verified statically): after #209 lands on main, check that a review of up to 30 minutes survives a comment posted during it, and that inline comments and the summary are posted on a same-repo PR and on an @claude review of a fork PR.

ana-lu-rocha pushed a commit to ana-lu-rocha/lrsomatic that referenced this pull request Oct 2, 2026
Same files as IntGenomicsLab#208 on dev. GitHub runs issue_comment workflows from the default branch, so the `@claude review` trigger needs this on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant