feat(code-reviews): incremental reviews on follow-up pushes#927
feat(code-reviews): incremental reviews on follow-up pushes#927alex-alecu wants to merge 14 commits intomainfrom
Conversation
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Fix these issues in Kilo Cloud Files Reviewed (7 files)
|
84d0d37 to
f787f24
Compare
src/lib/code-reviews/prompts/default-prompt-template-gitlab.json
Outdated
Show resolved
Hide resolved
| // 4. Generate auth token for cloud agent with bot identifier | ||
| // 4. Check for previous completed review (incremental review optimization) | ||
| let previousHeadSha: string | null = null; | ||
| const incrementalEnabled = await isFeatureFlagEnabled(FEATURE_FLAG_INCREMENTAL_REVIEW); |
There was a problem hiding this comment.
WARNING: Incremental-review rollout is evaluated against a shared PostHog bucket
isFeatureFlagEnabled() defaults distinctId to 'server-config-fetch', so this call ignores the current review owner. Any percentage rollout or targeted rule for code-review-incremental will therefore turn incremental mode on for everyone or no one instead of the intended subset. Pass the same distinct ID you already use for code-review flags here.
| const incrementalEnabled = await isFeatureFlagEnabled(FEATURE_FLAG_INCREMENTAL_REVIEW); | |
| const incrementalEnabled = await isFeatureFlagEnabled(FEATURE_FLAG_INCREMENTAL_REVIEW, owner.userId); |
There was a problem hiding this comment.
I couldn't apply this fix automatically this time.
The auto-fix run failed before it could push an updated commit.
Next steps:
- Retry with more guidance, or apply the fix manually.
- Session ID:
agent_4ab0cb7c-0039-49da-a9ea-b4bd6a84015e
Technical details
Network connection lost.
|
🤖 Auto-Fix Update I successfully implemented changes to fix this issue, but encountered an error while creating the pull request: The changes are available on branch |
Summary
On follow-up pushes, code reviews was starting completely from scratch — re-reading every file, re-analyzing everything. This PR adds incremental mode: when a previous completed review exists for the same PR, the agent gets the old summary + inline comments + previous HEAD SHA so it can
git diffonly what changed.findPreviousCompletedReviewto find the last completed review SHAincrementalReviewWorkflowprompt section in both GitHub and GitLab templatesgenerateReviewPromptswaps in the incremental workflow when conditions are metprepareReviewPayloadchecks thecode-review-incrementalfeature flag, looks up the previous SHA, and passes it throughTest plan
generateReviewPromptwith and withoutpreviousHeadSha(7 new tests)gh pr diff)