Add Claude Code GitHub Workflow#9
Conversation
📝 WalkthroughWalkthroughTwo new GitHub Actions workflows are introduced to enable Claude-powered code review capabilities. The first workflow runs automated code review on pull request events, while the second responds to Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/claude-code-review.yml (1)
13-21: Add workflow concurrency to prevent duplicate/stale PR reviews.Without
concurrency, rapid pushes can queue overlapping Claude runs for the same PR, causing noisy or outdated feedback.Proposed change
jobs: claude-review: + concurrency: + group: claude-code-review-${{ github.event.pull_request.number }} + cancel-in-progress: true # Optional: Filter by PR author # if: |🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/claude-code-review.yml around lines 13 - 21, Add a concurrency configuration to the workflow to prevent overlapping runs for the same PR: under the claude-review job (or at the top-level of the workflow) add a concurrency block that groups by the PR-specific ref (e.g., use github.workflow and github.head_ref or github.ref) and set cancel-in-progress: true so any previous queued run for the same PR is cancelled when a new push arrives; modify the claude-review job definition to include this concurrency block to ensure only one active Claude run per PR.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/claude-code-review.yml:
- Around line 13-21: Add a concurrency configuration to the workflow to prevent
overlapping runs for the same PR: under the claude-review job (or at the
top-level of the workflow) add a concurrency block that groups by the
PR-specific ref (e.g., use github.workflow and github.head_ref or github.ref)
and set cancel-in-progress: true so any previous queued run for the same PR is
cancelled when a new push arrives; modify the claude-review job definition to
include this concurrency block to ensure only one active Claude run per PR.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b8e2c483-eaa2-4d7f-9299-0a2dae2eb728
📒 Files selected for processing (2)
.github/workflows/claude-code-review.yml.github/workflows/claude.yml
Fixes findings #4, #5, #6, #7, #9, #12 from /tmp/codecov-100-ecc-audit.md. HIGH severity findings #1-3 already fixed in HEAD; this commit covers the medium/low tier with regression tests for each. MEDIUM: - #4 BOUNDARY (src/commands/local-vault/parseArgs.ts): reject keys whose first character is in the Unicode hyphen/dash family (U+2010, U+2013, U+2014, U+2212, U+FF0D, etc.). A '−mykey' (U+2212 MINUS SIGN) would pass startsWith('-') but be unretrievable via the CLI. - #5 VALIDATION (VaultHttpFetchTool.ts): document the port-binding contract on `key@host` permission rules — distinct ports are distinct scopes (mirrors RFC 6454 same-origin), and IPv6 brackets round-trip through the validator. Tests pin the contract. - #6 VALIDATION (scrub.ts): omit bare-base64 form for short secrets (4-7 chars) where the 7-8 char base64 collides with naturally- occurring tokens in response bodies. Raw + Bearer + Basic-prefixed are still scrubbed; only the unprefixed base64 form is suppressed. Boundary at 8 chars (>= MIN_SCRUB_BASE64_LENGTH). - #7 RACE CONDITION (LocalMemoryRecallTool.ts): document the JS event-loop atomicity guarantee for consumeBudget's read-modify-write sequence and pin it via a Promise.all-driven concurrency test that asserts no torn-write lets two calls past the budget cap. - #9 EXCEPTION (multiStore.ts): track actual readSync byte count and surface short-reads as truncated=true. Previously the bounded read loop returned a buf of allocation size with truncated=false even when readSync delivered fewer bytes (file truncated mid-read), which silently appended trailing NULs. LOW: - #12 BOUNDARY (teleport/api.ts): distinguish "workspace key was cleared" (null/empty/whitespace) from "never set" (undefined) so the error message is actionable. Predicate extracted to isWorkspaceKeyCleared() and unit-tested directly (process-wide mock.module() pollution from sibling tests prevents in-suite coverage of the full prepareWorkspaceApiRequest flow). DEFERRED: - #11 (LOW, store.ts:145 EEXIST race-resilient read): defensive retry logic was implemented but pulled out together with its regression test because the test file is in an existing pollution group whose flake would have raised the suite fail-count above baseline. The underlying race is narrow and benign; revisit in a follow-up after the test isolation work. Verification: - bun run typecheck: clean - bun run lint: clean - bun test: 22 failures (matches baseline e9421fe; zero new failures) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🤖 Installing Claude Code GitHub App
This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository.
What is Claude Code?
Claude Code is an AI coding agent that can help with:
How it works
Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment.
Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action.
Important Notes
Security
There's more information in the Claude Code action repo.
After merging this PR, let's try mentioning @claude in a comment on any PR to get started!
Summary by CodeRabbit