Skip to content

Claude review - #864

Closed
HyakoV3 wants to merge 3 commits into
librespeed:masterfrom
HyakoV3:claude-review
Closed

HyakoV3 wants to merge 3 commits into
librespeed:masterfrom
HyakoV3:claude-review

Conversation

@HyakoV3

@HyakoV3 HyakoV3 commented Oct 9, 2026

Copy link
Copy Markdown

Adicionando o vandame como revisor das PRs.

@HyakoV3

HyakoV3 commented Oct 9, 2026

Copy link
Copy Markdown
Author

My bad friends... wrong repo.

@HyakoV3 HyakoV3 closed this Oct 9, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Add automated Claude PR reviews and mention-triggered responses

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Run Claude reviews when pull requests are opened, reopened, or marked ready for review.
• Let users invoke Claude from issue or PR review comments with @claude.
• Authenticate both workflows as the Vandame GitHub App; use the enterprise token for automated
 reviews.
Diagram

sequenceDiagram
    actor User
    participant GitHub
    participant Actions
    participant AppToken
    participant Claude
    participant ReviewPlugin
    User->>GitHub: Open or ready PR
    GitHub->>Actions: Pull request event
    Actions->>AppToken: Request Vandame token
    AppToken-->>Actions: App token
    Actions->>Claude: Run enterprise review
    Claude->>ReviewPlugin: Review PR
    ReviewPlugin->>GitHub: Post review comments
    User->>GitHub: Post @claude comment
    GitHub->>Actions: Comment event
    Actions->>AppToken: Request Vandame token
    AppToken-->>Actions: App token
    Actions->>Claude: Run mention response
    Claude->>GitHub: Post response
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Gate mention-triggered runs by commenter trust
  • ➕ Limits who can invoke a write-capable, token-backed assistant.
  • ➕ Reduces unwanted runs and associated costs.
  • ➖ Restricts participation from outside contributors.
  • ➖ Requires an explicit contributor-authorization policy.

Recommendation: Keep separate workflows for automatic reviews and interactive mentions: they have different triggers, permissions, and Claude credentials. Before enabling the mention workflow broadly, decide whether any commenter should be allowed to invoke it; if not, add a trust gate.

Files changed (2) +61 / -0

Other (2) +61 / -0
claude-code-review.ymlAdd automatic Claude PR review workflow +30/-0

Add automatic Claude PR review workflow

• Runs the Claude code-review plugin when a PR is opened, reopened, or marked ready for review. Uses the enterprise Claude OAuth secret and a Vandame App token, and requests GitHub suggestion blocks for small inline fixes.

.github/workflows/claude-code-review.yml

claude.ymlAdd @claude comment workflow +31/-0

Add @claude comment workflow

• Runs Claude when a newly created issue or PR review comment contains '@claude'. Authenticates through the Vandame App and limits the Claude run to ten turns.

.github/workflows/claude.yml

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Any commenter can start privileged jobs 🐞 Bug ⛨ Security
Description
The claude job checks only whether a newly created comment contains @claude, without checking
the commenter's authorization. A qualifying issue or pull-request comment starts a job that receives
an OAuth secret, creates a GitHub App token, and grants write permissions, even when the commenter
is untrusted.
Code

.github/workflows/claude.yml[9]

+    if: contains(github.event.comment.body, '@claude')
Evidence
Both comment-created events reach the same job, whose sole condition examines comment text. The job
then requests write permissions and supplies credentials to the action.

.github/workflows/claude.yml[3-9]
.github/workflows/claude.yml[12-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Any newly created comment containing `@claude` can start the credential-bearing Claude job, regardless of who posted it.
## Fix Focus Areas
- .github/workflows/claude.yml[3-9]
- .github/workflows/claude.yml[12-30]
## Recommended Fix
Require an authorized commenter before running the job, using a permission check that applies to both comment event types. Do not create the App token or invoke Claude for unauthorized comments.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Later PR commits receive no review 🐞 Bug ≡ Correctness
Description
The review workflow lists opened, ready_for_review, and reopened but omits the synchronize
pull-request event. Commits pushed after a PR is opened therefore do not start another automatic
review unless a separately listed event occurs.
Code

.github/workflows/claude-code-review.yml[4]

+    types: [opened, ready_for_review, reopened]
Evidence
The event-type list excludes synchronize, and the review job has no other trigger for subsequent
commits.

.github/workflows/claude-code-review.yml[3-5]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The automatic review does not run when commits are pushed to an existing pull request.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-4]
## Recommended Fix
Add `synchronize` to the pull-request event types so updates to an open PR start a new review.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Reviews fail for forked pull requests 🐞 Bug ☼ Reliability
Description
The pull_request review job unconditionally creates an App token from repository secrets and
passes another repository secret to the Claude action. GitHub does not provide those secrets to
pull_request runs from forks, so the authentication steps cannot complete for those PRs.
Code

.github/workflows/claude-code-review.yml[R21-22]

+          app-id: ${{ secrets.VANDAME_APP_ID }}
+          private-key: ${{ secrets.VANDAME_APP_PRIVATE_KEY }}
Evidence
The workflow triggers directly on pull requests, has no fork condition, and requires the App
credentials and Claude OAuth secret on every run.

.github/workflows/claude-code-review.yml[3-5]
.github/workflows/claude-code-review.yml[18-26]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The review workflow requires secrets that are unavailable to pull-request runs originating from forks.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-4]
- .github/workflows/claude-code-review.yml[18-26]
## Recommended Fix
Provide a safe, separately authorized review path for forked PRs, or explicitly skip forked PRs before the token-creation step and avoid presenting those runs as working reviews.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. Draft PRs receive premature reviews 🐞 Bug ≡ Correctness
Description
The review workflow includes opened without checking whether the pull request is a draft. Opening
a draft starts the Claude review, and marking that same PR ready starts another review through
ready_for_review.
Code

.github/workflows/claude-code-review.yml[4]

+    types: [opened, ready_for_review, reopened]
Evidence
The workflow subscribes to both opened and ready_for_review, and the review job has no draft
condition before invoking Claude.

.github/workflows/claude-code-review.yml[3-9]
.github/workflows/claude-code-review.yml[23-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Opening a draft PR starts a review before the PR is ready, followed by another review when it is marked ready.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-6]
## Recommended Fix
Add a job condition that excludes draft PRs while retaining the `ready_for_review` event.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: Security-sensitive workflow changes involve permissions, secrets, and external actions.

Grey Divider

Tip of the day
💡 Did you know, you can show, collapse, or hide each part of a finding: code, evidence, and all

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

types: [created]
jobs:
claude:
if: contains(github.event.comment.body, '@claude')

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.

Action required

1. Any commenter can start privileged jobs 🐞 Bug ⛨ Security

The claude job checks only whether a newly created comment contains @claude, without checking
the commenter's authorization. A qualifying issue or pull-request comment starts a job that receives
an OAuth secret, creates a GitHub App token, and grants write permissions, even when the commenter
is untrusted.
Agent Prompt
## Issue description
Any newly created comment containing `@claude` can start the credential-bearing Claude job, regardless of who posted it.
## Fix Focus Areas
- .github/workflows/claude.yml[3-9]
- .github/workflows/claude.yml[12-30]
## Recommended Fix
Require an authorized commenter before running the job, using a permission check that applies to both comment event types. Do not create the App token or invoke Claude for unauthorized comments.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

name: Code Review
on:
pull_request:
types: [opened, ready_for_review, reopened]

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.

Action required

2. Later pr commits receive no review 🐞 Bug ≡ Correctness

The review workflow lists opened, ready_for_review, and reopened but omits the synchronize
pull-request event. Commits pushed after a PR is opened therefore do not start another automatic
review unless a separately listed event occurs.
Agent Prompt
## Issue description
The automatic review does not run when commits are pushed to an existing pull request.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-4]
## Recommended Fix
Add `synchronize` to the pull-request event types so updates to an open PR start a new review.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +21 to +22
app-id: ${{ secrets.VANDAME_APP_ID }}
private-key: ${{ secrets.VANDAME_APP_PRIVATE_KEY }}

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.

Remediation recommended

3. Reviews fail for forked pull requests 🐞 Bug ☼ Reliability

The pull_request review job unconditionally creates an App token from repository secrets and
passes another repository secret to the Claude action. GitHub does not provide those secrets to
pull_request runs from forks, so the authentication steps cannot complete for those PRs.
Agent Prompt
## Issue description
The review workflow requires secrets that are unavailable to pull-request runs originating from forks.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-4]
- .github/workflows/claude-code-review.yml[18-26]
## Recommended Fix
Provide a safe, separately authorized review path for forked PRs, or explicitly skip forked PRs before the token-creation step and avoid presenting those runs as working reviews.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

name: Code Review
on:
pull_request:
types: [opened, ready_for_review, reopened]

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.

Remediation recommended

4. Draft prs receive premature reviews 🐞 Bug ≡ Correctness

The review workflow includes opened without checking whether the pull request is a draft. Opening
a draft starts the Claude review, and marking that same PR ready starts another review through
ready_for_review.
Agent Prompt
## Issue description
Opening a draft PR starts a review before the PR is ready, followed by another review when it is marked ready.
## Fix Focus Areas
- .github/workflows/claude-code-review.yml[3-6]
## Recommended Fix
Add a job condition that excludes draft PRs while retaining the `ready_for_review` event.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@HyakoV3
HyakoV3 deleted the claude-review branch October 9, 2026 18:15
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