-
Notifications
You must be signed in to change notification settings - Fork 16
fix: code review workflows to checkout PR head commit #2652
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
Conversation
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
can we check somehow that this actually works? |
Can you add some rule to yourself to follow conventional commits in naming pr title? |
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
Yes! I've added comprehensive validation to verify the workflow fix works correctly: Automatic Validation (commit 7040bdf):
Testing Tools:
Manual Testing:
The workflows will now fail fast with clear errors if the checkout logic doesn't work, and provide visible confirmation when they're correctly reviewing the latest PR changes. |
You're absolutely right! The PR title should follow conventional commit format. This should be "fix: Claude code review workflows to checkout PR head commit and add validation" since it's fixing a bug in the workflow logic. I'll make sure to use conventional commit prefixes (fix:, feat:, chore:, etc.) in future PR titles. |
|
…dance Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
...
|
I dont think we need changes in CLAUDE.md either |
Validate checkout (verification step) in workflows looks excessive too |
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
Removed the CLAUDE.md documentation changes (commit 5e6f39e). The file is now back to its original state with only the core workflow fixes remaining. |
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
Removed the excessive validation steps from both workflows (commit 593db13). The workflows now have a clean, minimal implementation while maintaining the core fix to checkout the correct PR head commit. |
/claude_review |
Claude finished @astandrik's task —— View job Code ReviewTodo List:
Review SummaryThe PR correctly fixes the issue where Claude workflows were reviewing stale code. The solution is well-implemented and addresses the root cause effectively. ✅ What Works Well
🔍 Observations & Suggestions
📋 Technical DetailsThe fix works by:
✅ ConclusionThis is a clean, focused fix that addresses the issue without introducing unnecessary complexity. The implementation follows GitHub Actions best practices and maintains backward compatibility with manual workflow triggers. The PR successfully ensures Claude will review the most recent changes rather than stale code. |
bugbot run |
PR Title / Verify Title check fails with current title - find the problem and add adjust rule in copilot instructions |
Co-authored-by: astandrik <8037318+astandrik@users.noreply.github.com>
Found the issue: commitlint's subject-case rule requires lowercase subjects in PR titles. "Claude" (capitalized proper noun) was causing the failure. Updated copilot instructions with specific guidance about conventional commit format requirements, including that PR title subjects must be lowercase (commit 25e4e79). |
The Claude code review workflows (
claude-code-review.yml
andclaude.yml
) were reviewing stale data instead of the latest PR changes when triggered by/claude_review
or@claude
comments.Problem
When users made changes to a PR and then requested a Claude review, the workflows were checking out the repository's default branch instead of the PR's head commit. This caused Claude to review outdated code as if no changes had been made since the PR was opened.
Root Cause
The workflows triggered on
issue_comment
events but used:fetch-depth: 1
which only fetched the latest commit from the default branchref
parameter in the checkout step, defaulting to the repository's default branchSolution
Updated both workflows to dynamically resolve the correct git reference:
fetch-depth: 0
to provide complete git history for better contextClaude will now correctly review the latest changes in PRs.
Also updated project copilot instructions to clarify conventional commit format requirements for PR titles, including the requirement for lowercase subjects to pass commitlint validation.
Fixes #2651.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Test Changes Summary ⏭️2
⏭️ Skipped Tests (2)
Bundle Size: ✅
Current: 85.36 MB | Main: 85.36 MB
Diff: 0.00 KB (0.00%)
✅ Bundle size unchanged.
ℹ️ CI Information