Documentation
¶
Overview ¶
Package code configures and registers optional PR code reviews with GitHub verdicts. It owns the prompt, model, and schedule; workflow supplies the shared consent, source lookup, reply template, and publication safeguards.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Module = signal.Module(signal.Constructor(NewCommand), signal.Register(Register))
Module registers the exact command and its optional independent queue job.
Functions ¶
func Register ¶ added in v1.41.0
func Register(dispatcher *commands.Dispatcher, schedules *scheduler.Scheduler, command *Command) error
Register adds the concurrent code review handler and its independent, queue-triggered job before startup. A nil command only registers the disabled handler for rejection feedback.
Types ¶
type Command ¶
type Command struct {
// Command supplies shared consent, source access, publication, and a queue dedicated to code reviews.
*workflow.Command
// contains filtered or unexported fields
}
Command keeps code review configuration and registration feature-owned. The embedded workflow command supplies consent checks and an independent queue.
func NewCommand ¶
func NewCommand(params CommandParams) (*Command, error)
NewCommand constructs the optional code review using the shared workflow. Omitted configuration returns nil; enabled reviews require a provider.
type CommandParams ¶ added in v0.53.0
type CommandParams struct {
// In marks this struct as an injected dependency group.
signal.In
// Config enables code reviews and selects their model and schedule.
Config *Config
// Workflow constructs commands sharing source access and verdict publication.
Workflow *workflow.Factory
}
CommandParams supplies code review configuration and shared workflow dependencies.
type Config ¶
type Config struct {
// ModelConfig selects the code review provider, model, and optional effort.
ai.ModelConfig `yaml:",inline" json:",inline" toml:",inline"`
// Config provides independent job timing; zero values use a thirty-second interval and two-minute timeout.
scheduler.Config `yaml:",inline" json:",inline" toml:",inline"`
}
Config selects the code review model and independent job schedule. Omit the block to disable code reviews. Zero durations use 30s and 2m.
func (*Config) GetInterval ¶
GetInterval returns the code review interval, defaulting to thirty seconds when zero. Config must be non-nil.
func (*Config) GetTimeout ¶
GetTimeout returns the complete code review job's timeout, defaulting to two minutes when zero. Config must be non-nil.