catalog

package
v0.0.0-...-8fb4044 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

README

Poule operations

Operation Docker specific Issues Pull Requests Purpose
ci-label-clean Remove CI failures labels where necessary.
dco-check 🐳 Check for commit signatures, label and post a comment if missing.
label Auto-label issues and pull requests according on matching regexps.
poule-updater Reload poule configuration when a pull request modifies it.
prune Manage issues with no activities.
random-assign Auto-assign a random user to issues and pull requests.
rebuild 🐳 Rebuild all or selected pull request jobs.
version-label 🐳 Add a version/x label based on Docker version string in the body.
version-milestone ~ Add merged pull requests to the upcoming milestone.

CI label cleaning

DCO check

Label

The label operation applies a label when the body of the GitHub issue or pull requests matches any of a list of provided regular expressions.

Configuration
Configuration Description
patterns A map of string to string arrays, where keys are the label to add, and values are a collection of regexp to match.
Example configuration
type: label
filters: {
    is: "issue",
}
settings: {
    patterns: {
        platform/desktop:    [ "docker for mac", "docker for windows" ],
        platform/freebsd:    [ "freebsd" ],
        platform/windows:    [ "nanoserver", "windowsservercore", "windows server" ],
    }
}

Poule update

The poule-updater operation is a very special one that monitors for merged pull request which modify a poule.yml file at the root of the repository, and reload the internal configuration accordingly. It is only meant to be used as a server-mode operation.

Prune

Random assign

Configuration
Configuration Description
users A string array.
Example configuration
type: random-assign
settings: {
    users: ["icecrime", "vieux"]
}

Rebuild

The rebuild operation triggers a rebuild operation on pull requests, optionally restricting to a given set of configurations or statuses (e.g., "documentation" configuration in status "failing"). The rebuild operation also takes an optional label parameter which is used as a signal: the operation looks for the label, triggers a rebuild, and removes it.

Example use cases:

  • As a one-time command invokation to rebuild pull requests after a test was fixed.
  • In server mode, to trigger a rebuild when a given label is set on a pull request.
Configuration
Configuration Description
configurations The list of configurations to consider for rebuild (empty means all).
label Filter pull requests with the corresponding label, and remove it after the rebuild is triggered.
statuses The list of status to meet for rebuilding (default: [ "failing", "error" ]).
Example configuration
type: rebuild
settings: {
    configurations: [ janky ]
    label:          "rebuild/janky"
    statuses:       [ error, failing ]
}

Version label

Version milestone

The version-milestone operation adds merged pull requests to the currently active milestone: it uses a VERSION file at the root of the repository to determine the current version in the making and searches for a milestone which title matches that version string.

The goal is for every merged pull request to be attached to a milestone, in such way that it's trivial to determine from GitHub in which release a given changeset was shipped.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PouleUpdateCallback func(repository string) error

PouleUpdateCallback is the callback to call when a configuration update is required.

OK, global state is terrible, but I like to think of `pouleUpdaterOperation` as an exception rather than the norm. If more of such operations need to exist in the future, we may want to create a special kind of "core operations" which have privileged access to the configuration.

Functions

func OperationFromConfig

func OperationFromConfig(operationConfig *configuration.OperationConfiguration) (operations.Operation, error)

OperationFromConfig returns an operation parsed from the configuration.

Types

type CommandLineDescription

type CommandLineDescription struct {
	// Name is the operation's command.
	Name string

	// Description is the operation's help message.
	Description string

	// Flags is an array of operation-specific command line flags.
	Flags []cli.Flag

	// ArgsUsage describes the arguments to this command.
	ArgsUsage string
}

CommandLineDescription describes the command-line interface for an operation.

type OperationDescriptor

type OperationDescriptor interface {
	// CommandLineDescription returns the necessary information to populate the
	// command line with that operation.
	CommandLineDescription() CommandLineDescription

	// OperationFromCli returns a new instance of that operations configured as
	// described by command line flags and arguments.
	OperationFromCli(*cli.Context) (operations.Operation, error)

	// OperationFromConfig returns a new instance of that operation configured
	// as described by the opaque `operations.Configuration` structure.
	OperationFromConfig(operations.Configuration) (operations.Operation, error)
}

OperationDescriptor describes an operation.

type OperationDescriptors

type OperationDescriptors []OperationDescriptor

OperationDescriptors is a collection of OperationDescriptor.

var (
	Index       OperationDescriptors
	ByNameIndex = map[string]OperationDescriptor{}
)

Index is the catalog of all known operations by name.

func (OperationDescriptors) Len

func (d OperationDescriptors) Len() int

func (OperationDescriptors) Less

func (d OperationDescriptors) Less(i, j int) bool

func (OperationDescriptors) Swap

func (d OperationDescriptors) Swap(i, j int)

type OperationValidator

type OperationValidator struct{}

OperationValidator validates an operation configuration.

func (OperationValidator) Validate

func (o OperationValidator) Validate(operationConfig *configuration.OperationConfiguration) error

Validate verifies the validity of the configuration object.

Jump to

Keyboard shortcuts

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