Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f12e66b
Add Claude Code workflow for AI-assisted PR reviews
shreyas-goenka Mar 13, 2026
fe063a0
Fix claude-code-action inputs to use claude_args and settings
shreyas-goenka Mar 13, 2026
f2bc990
Increase max turns for Claude Code workflows
shreyas-goenka Mar 13, 2026
47a7034
Remove secrets from Claude Code workflow caller
shreyas-goenka Mar 13, 2026
5eea506
Add wildcards to Bash() permission rules for Claude Code workflow
shreyas-goenka Mar 13, 2026
c831fb5
Enable inline PR review comments via MCP tool
shreyas-goenka Mar 13, 2026
832a975
Add MCP tools and fix allowed_tools for Claude Code workflow
shreyas-goenka Mar 13, 2026
36559e9
Pass inline comment tool via claude_args --allowedTools
shreyas-goenka Mar 13, 2026
fb84c12
Strengthen prompt to require inline comments for code review
shreyas-goenka Mar 13, 2026
7c70001
Trigger Claude Code review
shreyas-goenka Mar 13, 2026
5d712a8
Retry Claude Code review after federation policy propagation
shreyas-goenka Mar 13, 2026
1f01239
Retry after fixing federation policy to use repository claim
shreyas-goenka Mar 13, 2026
adbf271
Restructure into reusable workflow for stable OIDC federation
shreyas-goenka Mar 13, 2026
480c726
Add debug logging for OIDC claims and token exchange errors
shreyas-goenka Mar 13, 2026
7479fc0
Switch to protected runner group for Databricks IP ACL compatibility
shreyas-goenka Mar 13, 2026
e70030e
Add Linux label to protected runner group
shreyas-goenka Mar 13, 2026
33db89d
Try eng-protected runner group for IP ACL whitelisted IPs
shreyas-goenka Mar 13, 2026
fcde226
Clean up debug logging, revert to deco-testing runner group
shreyas-goenka Mar 13, 2026
f97a217
Add connectivity validation steps to Claude Code review workflow
shreyas-goenka Mar 13, 2026
e2efcef
Show token exchange error response body for debugging
shreyas-goenka Mar 13, 2026
3cf6d9b
Dispatch Claude Code to eng-dev-ecosystem for IP ACL compatibility
shreyas-goenka Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions .github/workflows/claude-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Claude Code

# AI-assisted PR reviews and interactive @claude mentions.
#
# The actual Claude Code execution runs in eng-dev-ecosystem on
# protected runners whose IPs are allowlisted by the Databricks
# account IP ACL. This workflow is a thin trigger that dispatches
# to eng-dev-ecosystem via the DECO workflow trigger GitHub App.

on:
pull_request:
types: [opened, synchronize, reopened]

issue_comment:
types: [created]

pull_request_review_comment:
types: [created]

jobs:
# Automatic PR review when a PR is opened or updated.
review:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
environment: test-trigger-is
permissions:
contents: read

steps:
- name: Generate GitHub App token
id: token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
owner: databricks-eng
repositories: eng-dev-ecosystem

- name: Trigger Claude Code review
run: |
gh workflow run cli-claude-code.yml \
-R databricks-eng/eng-dev-ecosystem \
--ref main \
-F pull_request_number=${{ github.event.pull_request.number }} \
-F event_type=review
env:
GH_TOKEN: ${{ steps.token.outputs.token }}

# Interactive @claude mentions.
assist:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
runs-on: ubuntu-latest
environment: test-trigger-is
permissions:
contents: read

steps:
- name: Generate GitHub App token
id: token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.DECO_WORKFLOW_TRIGGER_APP_ID }}
private-key: ${{ secrets.DECO_WORKFLOW_TRIGGER_PRIVATE_KEY }}
owner: databricks-eng
repositories: eng-dev-ecosystem

- name: Determine PR number
id: pr
run: |
if [ -n "$ISSUE_NUMBER" ]; then
echo "number=$ISSUE_NUMBER" >> "$GITHUB_OUTPUT"
else
echo "number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
fi
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ github.event.pull_request.number }}

- name: Trigger Claude Code assist
uses: actions/github-script@v7
with:
github-token: ${{ steps.token.outputs.token }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'databricks-eng',
repo: 'eng-dev-ecosystem',
workflow_id: 'cli-claude-code.yml',
ref: 'main',
inputs: {
pull_request_number: '${{ steps.pr.outputs.number }}',
event_type: 'assist',
comment_body: process.env.COMMENT_BODY
}
});
env:
COMMENT_BODY: ${{ github.event.comment.body }}
84 changes: 84 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Claude

# AI-assisted PR reviews and interactive @claude mentions.
# This workflow delegates to the reusable claude-code.yml workflow
# which handles authentication and execution.

on:
pull_request:
types: [opened, synchronize, reopened]

issue_comment:
types: [created]

pull_request_review_comment:
types: [created]

jobs:
review:
if: github.event_name == 'pull_request'
uses: ./.github/workflows/claude-code.yml
with:
prompt: |
Review this PR. Focus on correctness, error handling, and adherence to the project's Go conventions documented in CLAUDE.md.

You MUST post all code-specific feedback as inline comments using the mcp__github_inline_comment__create_inline_comment tool. For each issue you find, call this tool with the file path, line number, and your comment. Always set confirmed: true. Do NOT put code-level feedback in a summary comment.

After posting all inline comments, write a brief summary to a temporary file and post it with: pr-comment --body-file <path>. The summary should only list the number of inline comments posted and a one-line overview. If you have no issues to raise, just post a short comment saying the PR looks good.
allowed_tools: |
mcp__github_inline_comment__create_inline_comment
Bash(pr-diff)
Bash(pr-diff *)
Bash(pr-view)
Bash(pr-view *)
Bash(pr-comment *)
Bash(git log)
Bash(git log *)
Bash(git diff)
Bash(git diff *)
Bash(git show *)
Bash(grep *)
Read
Write
Glob
Grep
claude_args: '--max-turns 100 --allowedTools "mcp__github_inline_comment__create_inline_comment"'

assist:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))
uses: ./.github/workflows/claude-code.yml
with:
allowed_tools: |
mcp__github_ci__get_ci_status
mcp__github_ci__get_workflow_run_details
mcp__github_ci__download_job_log
Bash(make lint)
Bash(make test)
Bash(make fmt)
Bash(make schema)
Bash(go build *)
Bash(go test *)
Bash(go vet)
Bash(go vet *)
Bash(git add *)
Bash(git commit *)
Bash(pr-push)
Bash(pr-push *)
Bash(git diff)
Bash(git diff *)
Bash(git log)
Bash(git log *)
Bash(git status)
Bash(git show *)
Bash(pr-comment *)
Bash(pr-view)
Bash(pr-view *)
Bash(grep *)
Read
Edit
Write
Glob
Grep
claude_args: "--max-turns 100"
Loading