Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
65 changes: 4 additions & 61 deletions .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,69 +65,12 @@ jobs:
steps:
# Checkout the repository at the appropriate commit for review
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
# Use PR head SHA for pull_request_target, fallback to current SHA otherwise
# Use PR head SHA for pull_request_target to review the actual PR code
# For comment events, this will default to the base branch (PR context is inferred by Claude action)
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
Comment on lines 69 to 73

Copilot AI Feb 12, 2026

Copy link

Choose a reason for hiding this comment

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

For issue_comment / pull_request_review_comment / pull_request_review events, github.event.pull_request is not present, so this checkout will fall back to github.sha (default branch commit) and the review will run against the wrong code. The previous workflow explicitly resolved and checked out the PR head ref for comment-driven triggers; that behavior likely needs to be preserved (e.g. resolve PR number via gh pr view and fetch/checkout the head SHA/ref).

Copilot uses AI. Check for mistakes.
ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }}

# Handle fork branches for pull_request_target events
- name: Setup Fork Remote (for pull_request_target)
if: ${{ github.event_name == 'pull_request_target' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_HEAD_OWNER: ${{ github.event.pull_request.head.repo.owner.login }}
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.name }}
REPO_OWNER: ${{ github.repository_owner }}
run: |
PR_NUMBER="$PR_NUMBER"
HEAD_REF="$PR_HEAD_REF"
HEAD_OWNER="$PR_HEAD_OWNER"
HEAD_REPO="$PR_HEAD_REPO"
CURRENT_OWNER="$REPO_OWNER"

# For forked PRs, temporarily change origin URL to fork repository
# This allows claude-code-action to fetch the PR branch correctly
if [ "$HEAD_OWNER" != "$CURRENT_OWNER" ]; then
echo "PR is from fork: $HEAD_OWNER/$HEAD_REPO"
FORK_URL="https://github.com/$HEAD_OWNER/$HEAD_REPO.git"
echo "Temporarily changing origin URL to fork: $FORK_URL"
git remote set-url origin "$FORK_URL"
git fetch origin "$HEAD_REF"
git branch "$HEAD_REF" "origin/$HEAD_REF" 2>/dev/null || git branch -f "$HEAD_REF" "origin/$HEAD_REF"
fi

# For comment-driven triggers, ensure we have the correct PR branch checked out
- name: Checkout PR Branch (for comments)
if: ${{ github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}

# Fetch PR metadata: head branch name and source repository
PR_DATA=$(gh pr view $PR_NUMBER --json headRefName,headRepositoryOwner,headRepository,baseRefName)
HEAD_REF=$(echo "$PR_DATA" | jq -r '.headRefName')
HEAD_OWNER=$(echo "$PR_DATA" | jq -r '.headRepositoryOwner.login')
HEAD_REPO=$(echo "$PR_DATA" | jq -r '.headRepository.name')
BASE_BRANCH=$(echo "$PR_DATA" | jq -r '.baseRefName')
CURRENT_OWNER="${{ github.repository_owner }}"

# For forked PRs, temporarily change origin URL to fork repository
# This allows claude-code-action to fetch the PR branch correctly
if [ "$HEAD_OWNER" != "$CURRENT_OWNER" ]; then
echo "PR is from fork: $HEAD_OWNER/$HEAD_REPO"
FORK_URL="https://github.com/$HEAD_OWNER/$HEAD_REPO.git"
echo "Temporarily changing origin URL to fork: $FORK_URL"
git remote set-url origin "$FORK_URL"
fi

# Fetch and checkout the PR branch
git fetch origin "$HEAD_REF"
git branch "$HEAD_REF" "origin/$HEAD_REF" 2>/dev/null || git branch -f "$HEAD_REF" "origin/$HEAD_REF"
git checkout "$HEAD_REF"

# Invoke Claude to perform an automated PR review with progress tracking
- name: PR Review with Progress Tracking
Expand Down
8 changes: 4 additions & 4 deletions BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ rust_library(
"//third-party/rust/crates/bincode/2.0.1:bincode",
"//third-party/rust/crates/bstr/1.12.1:bstr",
"//third-party/rust/crates/byteorder/1.5.0:byteorder",
"//third-party/rust/crates/bytes/1.11.0:bytes",
"//third-party/rust/crates/bytes/1.11.1:bytes",
"//third-party/rust/crates/chrono/0.4.43:chrono",
"//third-party/rust/crates/colored/3.1.1:colored",
"//third-party/rust/crates/crc32fast/1.5.0:crc32fast",
"//third-party/rust/crates/dashmap/6.1.0:dashmap",
"//third-party/rust/crates/diffs/0.5.1:diffs",
"//third-party/rust/crates/encoding_rs/0.8.35:encoding_rs",
"//third-party/rust/crates/flate2/1.1.8:flate2",
"//third-party/rust/crates/flate2/1.1.9:flate2",
"//third-party/rust/crates/futures-util/0.3.31:futures-util",
"//third-party/rust/crates/futures/0.3.31:futures",
"//third-party/rust/crates/hex/0.4.3:hex",
"//third-party/rust/crates/libc/0.2.180:libc",
"//third-party/rust/crates/libc/0.2.181:libc",
"//third-party/rust/crates/lru-mem/0.3.0:lru-mem",
"//third-party/rust/crates/memchr/2.7.6:memchr",
"//third-party/rust/crates/natord/1.0.9:natord",
Expand All @@ -65,7 +65,7 @@ rust_library(
"//third-party/rust/crates/tokio/1.49.0:tokio",
"//third-party/rust/crates/tracing-subscriber/0.3.22:tracing-subscriber",
"//third-party/rust/crates/tracing/0.1.44:tracing",
"//third-party/rust/crates/uuid/1.19.0:uuid",
"//third-party/rust/crates/uuid/1.20.0:uuid",
"//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys",
],
)
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ dashmap = "6.1.0"
lru-mem = "0.3.0"
byteorder = "1.5.0"
futures-util = "0.3.31"
bytes = "1.11.0"
bytes = "1.11.1"
memchr = "2.7.6"
encoding_rs = "0.8.35"
rayon = "1.11.0"
ahash = "0.8.12"
diffs = "0.5.1"
libc = "0.2.180"
libc = "0.2.181"
async-trait = "0.1.89"
futures = "0.3.31"
tokio-stream = "0.1.18"
Expand All @@ -40,10 +40,10 @@ sha2 = "0.10.9"
crc32fast = "1.4"
zstd-sys = { version = "2.0.16+zstd.1.5.7", features = ["experimental"] }
sea-orm = { version = "1.1.17", features = ["sqlx-sqlite"] }
flate2 = { version = "1.1.8", features = ["zlib"] }
flate2 = { version = "1.1.9", features = ["zlib"] }
serde = { version = "1.0.228", features = ["derive"] }
chrono = { version = "0.4.43", features = ["serde"] }
uuid = { version = "1.19.0", features = ["serde", "v4", "v7"] }
uuid = { version = "1.20.0", features = ["serde", "v4", "v7"] }
tokio = { version = "1.49.0", features = ["fs", "io-util"] }
bincode = { version = "2.0.1", features = ["serde"] }
axum = { version = "0.8.8", features = ["macros", "json"] }
Expand Down
Loading
Loading