Skip to content

Setup Cloud Code Reviewer to work for git forks#357

Merged
alex-alecu merged 4 commits intomainfrom
fix/fix-code-reviewer-for-forks
Feb 19, 2026
Merged

Setup Cloud Code Reviewer to work for git forks#357
alex-alecu merged 4 commits intomainfrom
fix/fix-code-reviewer-for-forks

Conversation

@alex-alecu
Copy link
Contributor

Fix code reviews not working for forks - example Kilo-Org/kilo#390

@alex-alecu alex-alecu self-assigned this Feb 19, 2026
@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 19, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Merge (minor suggestion only)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.test.ts 1 Test file named pull-request-handler.test.ts but only tests code from pull-request-checkout-ref.ts — consider renaming to pull-request-checkout-ref.test.ts
Highlights
  • Security: Shell command injection is properly prevented via strict regex validation (GITHUB_PULL_REF_PATTERN) before interpolating into git commands
  • Logic: Fork detection correctly handles null, undefined, and matching repo names
  • Schema: Zod schema update (.nullable().optional()) correctly models GitHub's API where head.repo can be null for deleted fork repos
  • Types: PullRequestCheckoutRefInput is structurally compatible with the inferred PullRequestPayload type
  • Tests: Good coverage of same-repo, fork, and missing-repo edge cases
Files Reviewed (7 files)
  • src/lib/integrations/platforms/github/webhook-handlers/pull-request-checkout-ref.ts — new, clean
  • src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.test.ts — 1 suggestion
  • src/lib/integrations/platforms/github/webhook-handlers/pull-request-handler.ts — no issues
  • src/lib/integrations/platforms/github/webhook-schemas.ts — no issues
  • cloud-agent/src/workspace.ts — no issues
  • cloud-agent-next/src/workspace.ts — no issues
  • cloud-agent/src/workspace.test.ts + cloud-agent-next/src/workspace.test.ts — no issues

Fix these issues in Kilo Cloud

* Resolve which git ref should be checked out for a PR review.
*
* - Same-repo PRs: use head.ref (e.g. "feature/my-change")
* - Fork PRs: use GitHub's synthetic pull ref (e.g. "refs/pull/123/head")
Copy link
Contributor

Choose a reason for hiding this comment

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

why not always use this ref? doesnt this work for regular prs?

@alex-alecu alex-alecu merged commit 7d5bc04 into main Feb 19, 2026
12 checks passed
@alex-alecu alex-alecu deleted the fix/fix-code-reviewer-for-forks branch February 19, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments