migrator

package
v0.0.0-...-71304e1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator struct {
	Mode
	// contains filtered or unexported fields
}

func New

func New(mode Mode, token, org, repo string, dryRun, continueOnError bool) *Migrator

func (*Migrator) Migrate

func (m *Migrator) Migrate(prOptions *github.PullRequestListOptions) error

func (*Migrator) ProcessPR

func (m *Migrator) ProcessPR(pr *github.PullRequest) error

type Mode

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

Mode is a struct that describes the behavior of a status migration. The behavior is described as a list of conditions and a function that determines the actions to be taken when the conditions are met.

func CopyMode

func CopyMode(origContext, newContext string) *Mode

CopyMode makes a mode that creates a new context in every PR that has the old context, but not the new one. The state, description and target URL of the new context are made the same as those of the old context.

func MoveMode

func MoveMode(origContext, newContext string) *Mode

MoveMode creates a mode that both copies and retires. The mode creates a new context on every PR with the old context but not the new one, setting the state of the new context to that of the old context before retiring the old context.

func RetireMode

func RetireMode(origContext, newContext string) *Mode

RetireMode creates a mode that retires an old context on all PRs. If newContext is the empty string, origContext is retired without replacement. Its state is set to 'success' and its description is set to indicate that the context is retired. If newContext is not the empty string it is considered the replacement of origContext. This means that only PRs that have the newContext in addition to the origContext will be considered and the description of the retired context will indicate that it was replaced by newContext.

func (Mode) ProcessStatuses

func (m Mode) ProcessStatuses(combStatus *github.CombinedStatus) []*github.RepoStatus

ProcessStatuses checks the mode against the combined status of a PR and emits the actions to take.

Jump to

Keyboard shortcuts

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