Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoHostsConfigured = errors.New("no hosts configured")
)
var ( // ErrRunFailed indicates that a run failed with an error ErrRunFailed = errors.New("run failed") )
var (
PluginFuncs = map[string]func(ExecPluginOptions, *plugin.Plugin) (any, error){
"apply": applyPlugin,
"filter": filterPlugin,
"onPrClosed": onPrClosedPlugin,
"onPrCreated": onPrCreatedPlugin,
"onPrMerged": onPrMergedPlugin,
}
)
Functions ¶
func ExecPlugin ¶ added in v0.12.0
func ExecPlugin(funcName string, opts ExecPluginOptions) error
ExecPlugin executes the function of a plugin specified by `funcName`. It creates a temporary directory if `opts` doesn't specify one. It decodes the context content to send to the plugin from JSON.
Types ¶
type CiRunner ¶ added in v0.14.0
func NewCiRunnerFromConfig ¶ added in v0.14.0
NewCiRunnerFromConfig creates a new CiRunner by reading from configFile. It ignores some errors that are not relevant in a CI run.
type ExecPluginOptions ¶ added in v0.12.0
type ExecPluginOptions struct { Addr string Config map[string]string Context *protoV1.Context LogFormat string LogLevel string Out io.Writer Path string WorkDir string }
ExecPluginOptions defines all options expected by function ExecPlugin.
type NewScheduleRunnerOptions ¶ added in v0.24.0
type NewScheduleRunnerOptions struct { HttpClient *http.Client ServerApiKey string ServerUrl string }
NewScheduleRunnerOptions defines all options expected by NewScheduleRunner.
type Run ¶ added in v0.9.0
type Run struct { Clock clock.Clock DryRun bool Hosts []host.Host Processor processor.RepositoryTaskProcessor PullRequestCache host.PullRequestCache PushGateway *push.Pusher RepositoryLister host.RepositoryLister TaskRegistry *task.Registry }
type RunResult ¶
type ScheduleRunner ¶ added in v0.24.0
type ScheduleRunner struct {
// contains filtered or unexported fields
}
ScheduleRunner wraps the logic to schedule a new run.
func NewScheduleRunner ¶ added in v0.24.0
func NewScheduleRunner(opts NewScheduleRunnerOptions) (*ScheduleRunner, error)
NewScheduleRunner initializes a new ScheduleRunner from NewScheduleRunnerOptions.
func (*ScheduleRunner) Run ¶ added in v0.24.0
func (s *ScheduleRunner) Run(opts ScheduleRunnerRunOptions) error
Run schedules a new run from payload via the API of saturn-bot server.
type ScheduleRunnerRunOptions ¶ added in v0.24.0
type ScheduleRunnerRunOptions struct { // OutLog is the writer that [ScheduleRunner] // writes human-readable log messages to. OutLog io.Writer // OutReport is the writer that [ScheduleRunner] // writes task results to, if the user requests it. OutReport io.Writer // OutputFormat defines the output format to use. OutputFormat string // ScheduleRequest is the data to send to saturn-bot server. ScheduleRequest client.ScheduleRunV1Request // WaitFor is the total amount of time to wait for the run to complete. WaitFor time.Duration // WaitInterval is the time between requests sent to saturn-bot server // to check if the run has finished. WaitInterval time.Duration }
ScheduleRunnerRunOptions are all options expected by ScheduleRunnerRunOptions.
type TryRunner ¶
type TryRunner struct { ApplyActionsFunc func(actions []action.Action, ctx context.Context, dir string) error GitClient git.GitClient Hosts []host.Host Inputs map[string]string Out io.Writer Registry *task.Registry RepositoryName string TaskFile string TaskName string }