pullrequest

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrWrongConfig is returned when a pullrequest has missing mandatory attributes.
	ErrWrongConfig = errors.New("wrong pull request configuration")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Title defines the pullRequest title
	Title string `yaml:",omitempty"`
	// Kind defines the pullRequest `kind` which affects accepted "spec" values
	Kind string `yaml:",omitempty"`
	// Spec defines parameters for a specific "kind"
	Spec interface{} `yaml:",omitempty"`
	// scmid references an scm configuration defined within the updatecli manifest
	ScmID string `yaml:",omitempty"`
	// !Deprecated in favor for `scmid`
	DeprecatedScmID string `yaml:"scmID,omitempty" jsonschema:"-"`
	// Targets defines a list of target related to the pullRequest
	Targets []string `yaml:",omitempty"`
}

Config define pullRequest provided via an updatecli configuration

func (Config) JSONSchema added in v0.23.0

func (Config) JSONSchema() *jschema.Schema

JSONSchema implements the json schema interface to generate the "pullrequest" jsonschema

func (*Config) Validate

func (c *Config) Validate() (err error)

Validate ensures that a pullRequest configuration has required parameters.

type PullRequest

type PullRequest struct {
	Title          string
	Changelog      string
	PipelineReport string
	Config         Config
	Scm            *scm.Scm
	Handler        PullRequestHandler
}

PullRequest is a struct used by an updatecli pipeline.

func New

func New(config *Config, sourceControlManager *scm.Scm) (PullRequest, error)

New returns a new PullRequest based on a pullrequest config and an scm

func (*PullRequest) Update

func (p *PullRequest) Update() error

Update updates a pullRequest object based on its configuration

type PullRequestHandler

type PullRequestHandler interface {
	CreatePullRequest(title, changelog, pipelineReport string) error
}

PullRequestHandler interface defines required functions to be an pullRequest

Jump to

Keyboard shortcuts

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