trigger

package
v0.0.0-...-0df91af Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 37 Imported by: 6

Documentation

Overview

Package trigger defines triggers that map events to notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToFamilyTrigger

func ConvertToFamilyTrigger(trigger string) string

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(ctx context.Context, subID, triggerType string, t *task.Task) (*alertrecord.AlertRecord, error)

func JIRATaskPayload

func JIRATaskPayload(ctx context.Context, 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, ingestTime time.Time, processor projectProcessor) error

TriggerDownstreamProjectsForPush triggers downstream projects with push-level triggers for a GitHub push event.

func TriggerDownstreamVersion

func TriggerDownstreamVersion(ctx context.Context, args ProcessorArgs) (*model.Version, error)

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.

func ValidateTrigger

func ValidateTrigger(resourceType, triggerName string) bool

Types

type JiraIssueParameters

type JiraIssueParameters struct {
	SubID         string
	Project       string
	UiURL         string
	UiV2URL       string
	ParsleyLogURL string
	EventID       string
	TestNames     string
	Mappings      *evergreen.JIRANotificationsConfig
	Task          *task.Task
	Host          *host.Host
}

JiraIssueParameters specify a task payload.

type ProcessorArgs

type ProcessorArgs struct {
	SourceVersion                *model.Version
	DownstreamProject            model.ProjectRef
	ConfigFile                   string
	TriggerID                    string
	TriggerType                  string
	EventID                      string
	DefinitionID                 string
	Alias                        string
	UnscheduleDownstreamVersions bool
	PushRevision                 model.Revision
	PushIngestTime               time.Time
}

Jump to

Keyboard shortcuts

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