-
Notifications
You must be signed in to change notification settings - Fork 37
feat: Amber automatic code reviews with memory system (Phase 2) #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Amber automatic code reviews with memory system (Phase 2) #405
Conversation
Add workflow run links to amber-issue-handler and claude-code-review workflows, enabling users to see complete AI decision-making process. Changes: - amber-issue-handler.yml: Add links to 3 comment locations * "Report no changes" comment * "Validate changes" comment * "Create Pull Request" issue comment - claude-code-review.yml: Add post-processing step to append link All bot comments now include workflow run link with 90-day retention note, allowing users to inspect files read, search patterns, and AI reasoning. Part of Phase 1: Add Transparency (non-breaking, additive changes) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Create amber-auto-review.yml for automatic PR reviews using memory system - Loads CLAUDE.md + 6 memory files (context + patterns) for repository-aware reviews - Disable automatic trigger in claude-code-review.yml (now @claude mentions only) - Adds transparency links showing which memory files were loaded - Result: Automatic reviews use Amber (repository-aware), @claude stays lightweight Related to Phase 2 of Amber workflow transparency initiative. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Claude Code ReviewSummaryThis PR implements Phase 2 of the Amber workflow transparency initiative by adding automatic PR reviews using the memory system. The implementation is well-designed and production-ready, with excellent transparency features and proper separation of concerns between automatic (Amber) and manual (@claude) reviews. The code follows GitHub Actions best practices, implements proper error handling, and provides exceptional user experience through workflow transparency links and collapsible context sections. Issues by Severity🚫 Blocker IssuesNone - No blocking issues found. 🔴 Critical Issues1. Security: `pull_request_target` requires careful review (.github/workflows/amber-auto-review.yml:12) Using `pull_request_target` is necessary for fork support but creates security risks if untrusted code is executed. Your implementation is currently safe because: ✅ Only uses `anthropics/claude-code-action@v1` (trusted action) However, document this security consideration in a comment at the top of the workflow file: ```yaml SECURITY NOTE: Using pull_request_target for fork support- ONLY trusted actions are used (anthropics/claude-code-action)- NO untrusted code from PR is executed- allowed_non_write_users limits write capabilitiesSee: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/``` 2. Missing error handling for PR number extraction (.github/workflows/claude-code-review.yml:22-23) The conditional check `contains(github.event.comment.body, '@claude')` will pass for both issue comments and PR review comments, but `context.payload.pull_request.number` is undefined for issue comments on issues (not PRs). Fix: Add a check to ensure the comment is on a PR: ```yaml Or handle in the script: ```javascript 🟡 Major Issues1. Duplicate comment minimization logic (3 files with identical code) Files: `amber-auto-review.yml:33-69`, `claude-code-review.yml:40-76` Issue: The bash script for minimizing old comments is duplicated. This violates DRY principles and makes maintenance harder. Recommendation: Extract to a composite action or reusable workflow: ```yaml .github/actions/minimize-review-comments/action.ymlname: 'Minimize Old Review Comments' 2. Hardcoded memory file list in prompt (.github/workflows/amber-auto-review.yml:84-92) The memory system files are listed explicitly. If files are renamed/moved, the workflow breaks silently. Recommendation: Either:
3. Inconsistent transparency link format `amber-issue-handler.yml` adds transparency links inline, but review workflows add them in separate step. Creates maintenance burden. 🔵 Minor Issues1. Missing workflow file size optimization The `transparencySection` template string contains 24 lines of markdown. Consider moving to a separate file. 2. Inconsistent comment detection method `amber-auto-review.yml:153` sorts by `created_at` descending, but `claude-code-review.yml:188` includes `includes('View AI decision process')` check. 3. Continue-on-error may hide real issues Line 34: `continue-on-error: true` means failures are silent. Consider adding a warning notification. 4. No rate limiting consideration Rapid force-pushes could cause API rate limiting or excessive costs. Recommendation: Add concurrency control: 5. Missing CODEOWNERS integration Consider notifying human reviewers after Amber completes. Positive HighlightsExcellent transparency design 🌟
Well-structured separation of concerns 🎯
Robust error handling 💪
Great user experience ✨
Security conscious 🔒
RecommendationsPriority 1 (Before merge)
Priority 2 (Follow-up PR recommended)
Priority 3 (Nice to have)
Testing ValidationPer the PR description, this was tested on a fork PR. Recommend also testing:
Architectural AlignmentThis PR excellently aligns with repository patterns:
Overall AssessmentAPPROVED with minor improvements recommended. This is high-quality work that significantly improves the developer experience. The automatic reviews with memory system integration provide consistent, repository-aware code quality checks. The transparency features are exemplary. The critical issues noted are for defense-in-depth security documentation and edge case handling - the core functionality is sound. Recommendation: ✅ Safe to merge after addressing the two critical issues (documentation + PR check). Consider the major/minor issues in follow-up PRs. |
Summary
Implements Phase 2 of the Amber workflow transparency initiative: automatic PR reviews using the memory system from PRs #359 and #360.
Changes
New Workflow:
.github/workflows/amber-auto-review.ymlAutomatic PR reviews with repository intelligence:
Modified Workflow:
.github/workflows/claude-code-review.ymlChanged from automatic to manual-only:
@claudementions in commentsThree-Tier AI Integration
This completes the separation of AI review types:
@claude(Lightweight) - Manual, quick interactionsAutomatic PR Reviews (Amber-Wrapped) - NEW with this PR
@ambermentions (Repository-Aware) - Future Phase 3@ambermentions for specific tasksTesting
Tested on fork with PR: jeremyeder#33
After merge, every new PR will trigger
amber-auto-review.yml. To verify immediately:Design Decisions
Why Direct File Loading (No Shell Script)
Rejected approach: Shell script prompt builder using sed/grep/perl to extract CLAUDE.md sections
Chosen approach: Direct file loading via Claude's Read tool
Why Memory System Over CLAUDE.md Extraction
The memory system (PRs #359, #360) provides:
Impact
Users will see: Every PR automatically gets a repository-aware code review showing:
Developers will benefit from:
Related
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com