Documentation ¶
Overview ¶
Package trigger defines triggers that map events to notifications.
Index ¶
- func ConvertToFamilyTrigger(trigger string) string
- func EvalProjectTriggers(ctx context.Context, e *event.EventLogEntry, processor projectProcessor) ([]model.Version, error)
- func GetRecordByTriggerType(subID, triggerType string, t *task.Task) (*alertrecord.AlertRecord, error)
- func JIRATaskPayload(params JiraIssueParameters) (*message.JiraIssue, error)
- func NotificationsFromEvent(ctx context.Context, e *event.EventLogEntry) ([]notification.Notification, error)
- func TriggerDownstreamProjectsForPush(ctx context.Context, projectId string, event *github.PushEvent, ...) error
- func TriggerDownstreamVersion(ctx context.Context, args ProcessorArgs) (*model.Version, error)
- func ValidateTrigger(resourceType, triggerName string) bool
- type JiraIssueParameters
- type ProcessorArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToFamilyTrigger ¶
ConvertToFamilyTrigger takes a trigger and returns its "family-" equivalent, if it exists.
func EvalProjectTriggers ¶
func EvalProjectTriggers(ctx context.Context, e *event.EventLogEntry, processor projectProcessor) ([]model.Version, error)
EvalProjectTriggers takes an event log entry and a processor (either the mock or TriggerDownstreamVersion) and checks if any downstream builds should be triggered, creating them if they should
func GetRecordByTriggerType ¶
func GetRecordByTriggerType(subID, triggerType string, t *task.Task) (*alertrecord.AlertRecord, error)
func JIRATaskPayload ¶
func JIRATaskPayload(params JiraIssueParameters) (*message.JiraIssue, error)
JIRATaskPayload creates a Jira issue for a given task.
func NotificationsFromEvent ¶
func NotificationsFromEvent(ctx context.Context, e *event.EventLogEntry) ([]notification.Notification, error)
It is possible for this function to return notifications and errors at the same time. If the notifications array is not nil, they are valid and should be processed as normal.
func TriggerDownstreamProjectsForPush ¶
func TriggerDownstreamProjectsForPush(ctx context.Context, projectId string, event *github.PushEvent, processor projectProcessor) error
TriggerDownstreamProjectsForPush triggers downstream projects for a push event from a repo that does not have repotracker enabled.
func TriggerDownstreamVersion ¶
TriggerDownstreamVersion assumes that you definitely want to create a downstream version and will go through the process of version creation given a triggering version. If the trigger is a push event, the triggering version will be nonexistent.