wip

package
v0.0.0-...-a196a74 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProwPluginName is an external prow plugin name used to register this service
	ProwPluginName = "work-in-progress"

	// InProgressMessage is a message used in GH Status as description when the PR is in progress
	InProgressMessage = "PR is in progress and can't be merged yet. You might want to wait with review as well"
	// InProgressDetailsPageName is a name of a documentation page that contains additional status details for InProgressMessage
	InProgressDetailsPageName = "wip-failed"

	// ReadyForReviewMessage is a message used in GH Status as description when the PR is ready for review and merge
	ReadyForReviewMessage = "PR is ready for review and merge"
	// ReadyForReviewDetailsPageName is a name of a documentation page that contains additional status details for ReadyForReviewMessage
	ReadyForReviewDetailsPageName = "wip-success"
)
View Source
const DefaultLabel = "work-in-progress"

DefaultLabel is the GitHub label name set in absence of any configured label name

Variables

This section is empty.

Functions

func GetWorkInProgressPrefix

func GetWorkInProgressPrefix(title string, config PluginConfiguration) (string, bool)

GetWorkInProgressPrefix separates a prefix matching any of the "work in progress" patterns - if it is present

Types

type GitHubWIPPRHandler

type GitHubWIPPRHandler struct {
	Client  ghclient.Client
	BotName string
}

GitHubWIPPRHandler handles PR events and updates status of the PR based on work-in-progress indicator

func (*GitHubWIPPRHandler) HandleIssueCommentEvent

func (gh *GitHubWIPPRHandler) HandleIssueCommentEvent(logger log.Logger, comment *gogh.IssueCommentEvent) error

HandleIssueCommentEvent is an entry point for the plugin logic. This method is invoked by the Server when issue comment event is dispatched from the /hook service

func (*GitHubWIPPRHandler) HandlePullRequestEvent

func (gh *GitHubWIPPRHandler) HandlePullRequestEvent(logger log.Logger, event *gogh.PullRequestEvent) error

HandlePullRequestEvent is an entry point for the plugin logic. This method is invoked by the Server when pull request vent is dispatched from the /hook service

type PluginConfiguration

type PluginConfiguration struct {
	config.PluginConfiguration `yaml:",inline,omitempty"`
	Prefix                     []string `yaml:"title_prefixes,omitempty"`
	Label                      string   `yaml:"gh_label,omitempty"`
	Combine                    bool     `yaml:"combine_defaults,omitempty"`
}

PluginConfiguration defines prefix patterns set of PR titles will be matched against It is unmarshalled from work-in-progress.yml configuration file.

func LoadConfiguration

func LoadConfiguration(logger log.Logger, change scm.RepositoryChange) PluginConfiguration

LoadConfiguration loads a PluginConfiguration for the given change

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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