Documentation
¶
Overview ¶
Package cmdruntime contains shared command runtime contracts.
Index ¶
- func ConfigPath(opts *root.Options) (string, error)
- func MapRunError(err error) error
- func MissingResponderError() error
- func ResolveRepoRoot(ctx context.Context) (string, error)
- func RetentionPolicyFromConfig(retention config.RetentionConfig) datalifecycle.RetentionPolicy
- type Factory
- type Options
- type ResponseRunner
- type Runner
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
ConfigPath resolves the active config path from root options.
func MapRunError ¶
MapRunError maps lower-level runtime errors to CLI exit-code wrappers.
func MissingResponderError ¶
func MissingResponderError() error
MissingResponderError reports that a command runtime cannot execute response runs.
func ResolveRepoRoot ¶ added in v0.10.200
ResolveRepoRoot returns the current invocation worktree root or reporoot.ErrUnavailable when the command is not running inside a Git worktree.
func RetentionPolicyFromConfig ¶
func RetentionPolicyFromConfig(retention config.RetentionConfig) datalifecycle.RetentionPolicy
RetentionPolicyFromConfig maps config retention settings to runtime policy.
Types ¶
type Factory ¶
type Factory func(cmd *cobra.Command, opts *root.Options, cfg config.File, profile config.Profile, runtimeOpts Options) (Runtime, error)
Factory builds the concrete runtime used by review lifecycle commands.
type Options ¶
type Options struct {
MaxAgents int
MaxConcurrency int
PRRef gitprovider.PRRef
RequireOpinionatedReviewAuthority bool
Retention datalifecycle.RetentionPolicy
RetentionManualOnly bool
ResolveRepoRoot func(context.Context) (string, error)
GitCommand func(context.Context, string, ...string) ([]byte, error)
}
Options carries command flags that affect runtime construction.
type ResponseRunner ¶
type ResponseRunner interface {
Respond(context.Context, threadrespond.Request) (threadrespond.Result, error)
}
ResponseRunner executes response-only thread lifecycle runs.
type Runner ¶
type Runner interface {
DryRun(context.Context, pipeline.Request) (pipeline.Result, error)
Live(context.Context, pipeline.Request, reviewrun.Flags) (reviewrun.Result, error)
}
Runner executes the configured review pipeline.
type Runtime ¶
type Runtime struct {
Runner Runner
Responder ResponseRunner
PostingIdentity gitprovider.Identity
Cleanup func()
}
Runtime contains per-command dependencies that need cleanup after a run.