review

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package review provides shared logic for creating PR review worktrees. Both the CLI commands and the MCP server use this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectRepo

func DetectRepo(ctx context.Context, cfg *config.Config, prNumber int) (string, error)

DetectRepo tries each configured repo to find which one contains the given PR number. Returns the repo short name or an error. Unlike the CLI version, this does not prompt interactively -- it returns an error if ambiguous.

Types

type Logger

type Logger func(msg string)

Logger is called for progress messages. CLI callers pass ui.LogInfo; MCP callers pass nil or a no-op to avoid stdout pollution.

type Result

type Result struct {
	WorktreePath string `json:"worktree_path"`
	PRNumber     int    `json:"pr_number"`
	Title        string `json:"title"`
	Author       string `json:"author"`
}

Result holds the output of a successful worktree creation.

func CreateWorktree

func CreateWorktree(ctx context.Context, cfg *config.Config, repoShort string, prNumber int, log Logger) (*Result, error)

CreateWorktree creates a PR review worktree. It fetches the PR branch, creates the git worktree, injects CLAUDE.local.md context, and caches PR metadata. Returns the result or an error.

If the worktree already exists, returns a Result with the existing path. The caller is responsible for detecting the repo if repoShort is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL