task

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PluginAction

type PluginAction struct {
	Provider plugin.Provider
}

PluginAction wraps remote actions provided by a plugin.

func (*PluginAction) Apply

func (a *PluginAction) Apply(ctx context.Context) error

Apply implements action.Apply().

func (*PluginAction) String

func (a *PluginAction) String() string

Apply implements action.String().

type PluginFilter

type PluginFilter struct {
	Provider plugin.Provider
}

PluginFilter wraps remote filters provided by a plugin.

func (*PluginFilter) Do

func (f *PluginFilter) Do(ctx context.Context) (bool, error)

Do implements filter.Do().

func (*PluginFilter) Name

func (f *PluginFilter) Name() string

Name implements filter.Name().

func (*PluginFilter) String

func (f *PluginFilter) String() string

String implements filter.String().

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry contains all tasks.

func NewRegistry

func NewRegistry(opts options.Opts) *Registry

func (*Registry) GetTasks

func (tr *Registry) GetTasks() []Task

GetTasks returns all tasks registered with the Registry. Should be called only after ReadAll() has been called at least once.

func (*Registry) ReadAll

func (tr *Registry) ReadAll(taskFiles []string) error

ReadAll takes a list of paths to task files and reads all tasks from the files.

func (*Registry) Stop

func (tr *Registry) Stop()

Stop notifies every task that this Registry is being stopped. This usually happens at the end of a run. Every task can then execute code to clean itself up.

type Task

type Task interface {
	Actions() []action.Action
	AutoMergeAfter() time.Duration
	BranchName() string
	Checksum() string
	Filters() []filter.Filter
	HasReachedChangeLimit() bool
	HasReachMaxOpenPRs() bool
	IncChangeLimitCount()
	IncOpenPRsCount()
	OnPrClosed(host.Repository) error
	OnPrCreated(host.Repository) error
	OnPrMerged(host.Repository) error
	PrTitle() string
	SetLogger(*zap.SugaredLogger)
	SourceTask() schema.Task
	Stop()
}

type Wrapper

type Wrapper struct {
	Task schema.Task
	// contains filtered or unexported fields
}

func (*Wrapper) Actions

func (tw *Wrapper) Actions() []action.Action

func (*Wrapper) AddFilters added in v0.6.0

func (tw *Wrapper) AddFilters(f ...filter.Filter)

func (*Wrapper) AutoMergeAfter

func (tw *Wrapper) AutoMergeAfter() time.Duration

func (*Wrapper) BranchName

func (tw *Wrapper) BranchName() string

func (*Wrapper) Checksum

func (tw *Wrapper) Checksum() string

func (*Wrapper) Filters

func (tw *Wrapper) Filters() []filter.Filter

func (*Wrapper) HasReachMaxOpenPRs added in v0.5.0

func (tw *Wrapper) HasReachMaxOpenPRs() bool

func (*Wrapper) HasReachedChangeLimit added in v0.5.0

func (tw *Wrapper) HasReachedChangeLimit() bool

func (*Wrapper) IncChangeLimitCount added in v0.5.0

func (tw *Wrapper) IncChangeLimitCount()

func (*Wrapper) IncOpenPRsCount added in v0.5.0

func (tw *Wrapper) IncOpenPRsCount()

func (*Wrapper) OnPrClosed

func (tw *Wrapper) OnPrClosed(repository host.Repository) error

func (*Wrapper) OnPrCreated

func (tw *Wrapper) OnPrCreated(repository host.Repository) error

func (*Wrapper) OnPrMerged

func (tw *Wrapper) OnPrMerged(repository host.Repository) error

func (*Wrapper) PrTitle

func (tw *Wrapper) PrTitle() string

func (*Wrapper) SetLogger added in v0.11.0

func (tw *Wrapper) SetLogger(l *zap.SugaredLogger)

func (*Wrapper) SourceTask

func (tw *Wrapper) SourceTask() schema.Task

func (*Wrapper) Stop

func (tw *Wrapper) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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