Documentation
¶
Index ¶
- Constants
- type JSONPatch
- type MessageFormat
- type MessageReference
- type Options
- func (o *Options) NotifyPipeline(activity *jenkinsv1.PipelineActivity, cfg *v1alpha1.SlackNotify) (bool, *scm.PullRequest, *users.GitUserResolver, error)
- func (o *Options) PipelineMessage(activity *jenkinsv1.PipelineActivity) error
- func (o *Options) ReviewRequestMessage(activity *jenkinsv1.PipelineActivity) error
- func (o *Options) Run() error
- func (o *Options) Validate() error
- func (o *Options) WatchActivities() chan struct{}
- type PipelineDetails
- type SlackOptions
- type SlackUserResolver
- type Status
- type Statuses
Constants ¶
View Source
const ( // SlackAnnotationPrefix annotatation used on a PipelineActivity to associate a pipeline instance with a slack // messsage in a particular channel SlackAnnotationPrefix = "message.slack.jenkins-x.io" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONPatch ¶
type JSONPatch []jsonpatch.JsonPatchOperation
func CreatePatch ¶
func (JSONPatch) MarshalJSON ¶
type MessageFormat ¶
type MessageReference ¶
type Options ¶ added in v0.0.54
type Options struct { SlackOptions MessageFormat MessageFormat KubeClient kubernetes.Interface JXClient jenkinsv1client.Interface SlackClient slacker.Interface ScmClient *scm.Client SourceConfigs *v1alpha1.SourceConfig Statuses Statuses Timestamps map[string]map[string]*MessageReference SlackUserResolver SlackUserResolver GitClient gitclient.Interface CommandRunner cmdrunner.CommandRunner }
SlackBotOptions contains options for the SlackBot
func (*Options) NotifyPipeline ¶ added in v0.0.54
func (o *Options) NotifyPipeline(activity *jenkinsv1.PipelineActivity, cfg *v1alpha1.SlackNotify) (bool, *scm.PullRequest, *users.GitUserResolver, error)
NotifyPipeline returns true if the given pipeline activity matches the configuration
func (*Options) PipelineMessage ¶ added in v0.0.54
func (o *Options) PipelineMessage(activity *jenkinsv1.PipelineActivity) error
func (*Options) ReviewRequestMessage ¶ added in v0.0.54
func (o *Options) ReviewRequestMessage(activity *jenkinsv1.PipelineActivity) error
func (*Options) WatchActivities ¶ added in v0.0.54
func (o *Options) WatchActivities() chan struct{}
WatchActivities watches for pipeline activities
type PipelineDetails ¶
type PipelineDetails struct { GitOwner string GitRepository string BranchName string Pipeline string Build string Context string }
func CreatePipelineDetails ¶
func CreatePipelineDetails(activity *jenkinsv1.PipelineActivity) *PipelineDetails
CreatePipelineDetails creates a PipelineDetails object populated from the activity
type SlackOptions ¶
type SlackUserResolver ¶
type SlackUserResolver struct { SlackClient slacker.Interface JXClient jenkninsv1client.Interface Namespace string UserMappings map[string]string }
SlackUserResolver allows slack users to be converted to Jenkins X users
func NewSlackUserResolver ¶
func NewSlackUserResolver(slackClient slacker.Interface, jenkinsClient jenkninsv1client.Interface, namespace string) SlackUserResolver
NewSlackUserResolver creates a new struct to work with resolving slack user details
func (*SlackUserResolver) SlackProviderKey ¶
func (r *SlackUserResolver) SlackProviderKey() string
SlackProviderKey returns the provider key for this SlackUserResolver
func (*SlackUserResolver) SlackUserLogin ¶
func (r *SlackUserResolver) SlackUserLogin(user *jenkinsv1.UserDetails) (string, error)
SlackUserLogin returns the login for the slack provider, or an empty string if not found
type Statuses ¶
type Statuses struct { Succeeded *Status `json:"succeeded,omitempty" protobuf:"bytes,1,name=succeeded"` Failed *Status `json:"failed,omitempty" protobuf:"bytes,2,name=failed"` NotApproved *Status `json:"notApproved,omitempty" protobuf:"bytes,3,name=notApproved"` Approved *Status `json:"approved,omitempty" protobuf:"bytes,4,name=approved"` Running *Status `json:"running,omitempty" protobuf:"bytes,5,name=running"` Hold *Status `json:"hold,omitempty" protobuf:"bytes,6,name=hold"` NeedsOkToTest *Status `json:"needsOkToTest,omitempty" protobuf:"bytes,7,name=needsOkToTest"` Merged *Status `json:"merged,omitempty" protobuf:"bytes,8,name=merged"` Pending *Status `json:"pending,omitempty" protobuf:"bytes,9,name=pending"` Errored *Status `json:"errored,omitempty" protobuf:"bytes,10,name=errored"` Aborted *Status `json:"aborted,omitempty" protobuf:"bytes,11,name=aborted"` LGTM *Status `json:"lgtm,omitempty" protobuf:"bytes,12,name=lgtm"` Unknown *Status `json:"unknown,omitempty" protobuf:"bytes,13,name=unknown"` Closed *Status `json:"closed,omitempty" protobuf:"bytes,14,name=closed"` // Closed means the PR is closed but not merged }
Click to show internal directories.
Click to hide internal directories.