Add Claude Code workflow for AI-assisted PR reviews#4738
Add Claude Code workflow for AI-assisted PR reviews#4738shreyas-goenka wants to merge 5 commits intomainfrom
Conversation
|
Commit: 3cf6d9b
18 interesting tests: 7 SKIP, 6 RECOVERED, 5 flaky
Top 20 slowest tests (at least 2 minutes):
|
b418b20 to
0d2b698
Compare
0d2b698 to
6dbf8a3
Compare
6dbf8a3 to
275b67a
Compare
275b67a to
fc25d50
Compare
fc25d50 to
47a7034
Compare
|
Added Changes:
|
Claude Review: Restrict auto-review to trusted PR authorsAddressed the prompt injection concern by adding
External/first-time contributors can still request a review via |
|
Commit: 1713c27
16 interesting tests: 7 KNOWN, 7 SKIP, 2 flaky
Top 20 slowest tests (at least 2 minutes):
|
e8a70ba to
8e9e3f0
Compare
8e9e3f0 to
2ade542
Compare
2ade542 to
c46e877
Compare
Add a GitHub Actions workflow that provides AI-assisted PR reviews and interactive @claude mentions using Claude Code backed by Databricks Model Serving. The workflow dispatches to eng-dev-ecosystem's protected runners (whose IPs are allowlisted by the Databricks account IP ACL) via the DECO workflow trigger GitHub App. Two modes: - Review: automatic on PR open, posts a review comment - Assist: triggered by @claude mentions, can edit code and push Access is restricted to COLLABORATOR/MEMBER/OWNER via author_association allowlists. Co-authored-by: Isaac
c46e877 to
1713c27
Compare
eng-dev-ecosystem-bot
left a comment
There was a problem hiding this comment.
Workflow looks well-structured overall. Good security practices: fork PR checks, author_association allowlists, and using process.env to avoid script injection for comment_body. Two minor observations below.
.github/workflows/claude-code.yml
Outdated
| workflow_id: 'cli-claude-code.yml', | ||
| ref: 'main', | ||
| inputs: { | ||
| pull_request_number: '${{ steps.pr.outputs.number }}', |
There was a problem hiding this comment.
Nit: steps.pr.outputs.number is interpolated directly into the script block via ${{ }}. This is safe in practice (it's a GitHub-assigned integer), but it's inconsistent with line 131 where comment_body correctly uses process.env to avoid expression injection.
For defense-in-depth, consider passing this through an env var too:
env:
COMMENT_BODY: ${{ github.event.comment.body }}
PR_NUMBER: ${{ steps.pr.outputs.number }} pull_request_number: process.env.PR_NUMBER,| (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) | ||
| ) | ||
| runs-on: |
There was a problem hiding this comment.
Minor: The assist job has no concurrency group, unlike review (line 34-36). Multiple @claude mentions on the same PR could trigger parallel dispatches. If that's intentional, a brief comment would help; otherwise, consider adding:
concurrency:
group: claude-assist-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true|
@claude reply to me in this PR with a comment saying hi |
|
@claude say hi |
|
Commit: b640037
19 interesting tests: 9 SKIP, 6 RECOVERED, 4 flaky
Top 22 slowest tests (at least 2 minutes):
|
eng-dev-ecosystem-bot
left a comment
There was a problem hiding this comment.
Clean, well-structured workflow. Good security practices: fork checks on both jobs, author association gating, and passing comment_body through process.env instead of ${{ }} interpolation to avoid script injection. One suggestion below.
| ( | ||
| (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) || | ||
| (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) | ||
| ) |
There was a problem hiding this comment.
Nit: The review job has a concurrency group to cancel in-progress runs, but assist does not. If someone posts multiple @claude comments in quick succession, they could all trigger simultaneously. Consider adding:
concurrency:
group: claude-assist-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: true|
@claude is elon musk the founder of computing? |
After dispatching to eng-dev-ecosystem, the workflow now finds the remote run, posts a link in the step summary, and waits for it to complete. This keeps the check visible on the PR while Claude works. Co-authored-by: Isaac
- Pin actions to commit SHAs instead of mutable version tags - Add concurrency group to assist job to prevent parallel dispatches - Pass PR number through env var for defense-in-depth against injection Co-authored-by: Isaac
Reflects current implementation: composite action, standalone workflows, OIDC policies, SHA-pinned actions, concurrency groups, allowed tools, and comprehensive threat model. Co-authored-by: Isaac
Co-authored-by: Isaac
f2d638a to
b640037
Compare
Summary
Adds a GitHub Actions workflow for AI-assisted PR reviews and interactive
@claudementions. This is a thin dispatcher — it triggers execution indatabricks-eng/eng-dev-ecosystemon protected runners via the DECO workflow trigger GitHub App.@claudecomments, can edit and pushAccess restricted to org
MEMBER/OWNERviaauthor_associationallowlists.Depends on
https://github.com/databricks-eng/eng-dev-ecosystem/pull/1202
Test plan
@claudeassist mode tested