runner

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package runner orchestrates one review run end to end — checkout, prompt assembly, reviewer passes, result merging, and persistence — so every frontend (TUI, web GUI) drives the same pipeline and stores the same artifacts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRequests

func BuildRequests(cfg config.Config, detail gitlabx.MRDetail, diffs []gitlabx.FileDiff, commits []gitlabx.Commit, template, repoPath string) ([]review.Request, []string, error)

BuildRequests assembles the reviewer request(s) from project-resolved config: chunked diffs, category list, and combined custom instructions.

func RebaseWarning

func RebaseWarning(detail gitlabx.MRDetail) string

RebaseWarning describes why the MR branch is not up to date with its target, for the findings-screen warning banner.

Types

type CheckoutFunc

type CheckoutFunc func(ctx context.Context, mr gitlabx.MRDetail, progress func(string)) (path string, cleanup func(context.Context) error, err error)

CheckoutFunc prepares a review worktree for an MR and returns its path plus a cleanup function. Progress lines go to the run's progress log.

type Outcome

type Outcome struct {
	Result  *review.Result
	Rec     *resultstore.Record
	LogPath string
	Err     error
}

Outcome is everything a frontend needs after a run: the merged result, the stored record (nil on failure, cancellation, or when storage is disabled), and the progress log location.

type Runner

type Runner struct {
	Cfg      config.Config
	Svc      gitlabx.Service
	Reviewer review.Reviewer
	Checkout CheckoutFunc
	// Logs stores the run's progress log; nil disables storing.
	Logs *runlog.Store
	// Results stores the run's result record; nil disables storing.
	Results *resultstore.Store
}

Runner bundles everything one review run needs. Cfg must already be resolved for the MR's project (per-project overrides applied).

func (Runner) Run

func (r Runner) Run(ctx context.Context, detail gitlabx.MRDetail, diffs []gitlabx.FileDiff, commits []gitlabx.Commit, emit func(string)) Outcome

Run executes the whole review, reporting every progress line through emit (may be nil) and mirroring it into the stored run log. On success the result is saved as a record so the review can be reopened later; curation screens keep re-saving the same record as states change.

Jump to

Keyboard shortcuts

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