notifier

package
v0.0.0-...-1ea9000 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: BSD-3-Clause Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Types of notification message sent by the roller. These can be
	// selected via notifier.Config.IncludeMsgTypes.
	MSG_TYPE_ISSUE_UPDATE                = "issue update"
	MSG_TYPE_LAST_N_FAILED               = "last n failed"
	MSG_TYPE_MANUAL_ROLL_CREATION_FAILED = "manual roll cl creation failed"
	MSG_TYPE_MODE_CHANGE                 = "mode change"
	MSG_TYPE_NEW_FAILURE                 = "new failure"
	MSG_TYPE_NEW_SUCCESS                 = "new success"
	MSG_TYPE_ROLL_CREATION_FAILED        = "cl creation failed"
	MSG_TYPE_SAFETY_THROTTLE             = "safety throttle"
	MSG_TYPE_STRATEGY_CHANGE             = "strategy change"
	MSG_TYPE_SUCCESS_THROTTLE            = "success throttle"
	MSG_TYPE_TOO_MANY_CLS                = "too many CLs"
)

Variables

This section is empty.

Functions

func ConfigToProto

func ConfigToProto(cfg *notifier.Config) (*config.NotifierConfig, error)

ConfigToProto converts a notifier.Config to a config.NotifierConfig.

func ProtoToConfig

func ProtoToConfig(cfg *config.NotifierConfig) *notifier.Config

ProtoToConfig converts a config.NotifierConfig to a notifier.Config.

Types

type AutoRollNotifier

type AutoRollNotifier struct {
	// contains filtered or unexported fields
}

AutoRollNotifier is a struct used for sending notifications from an AutoRoller. It is a convenience wrapper around notifier.Router.

func New

func New(ctx context.Context, childName, parentName, serverURL string, client *http.Client, emailer emailclient.Client, chatBotConfigReader chatbot.ConfigReader, configs []*notifier.Config) (*AutoRollNotifier, error)

Return an AutoRollNotifier instance.

func (*AutoRollNotifier) ReloadConfigs

func (a *AutoRollNotifier) ReloadConfigs(ctx context.Context, configs []*notifier.Config) error

func (*AutoRollNotifier) Router

func (a *AutoRollNotifier) Router() *notifier.Router

Return the underlying notifier.Router.

func (*AutoRollNotifier) SendIssueUpdate

func (a *AutoRollNotifier) SendIssueUpdate(ctx context.Context, id, url, msg string)

Send an issue update message.

func (*AutoRollNotifier) SendLastNFailed

func (a *AutoRollNotifier) SendLastNFailed(ctx context.Context, n int, url string)

Send a notification that the last N roll attempts have failed.

func (*AutoRollNotifier) SendManualRollCreationFailed

func (a *AutoRollNotifier) SendManualRollCreationFailed(ctx context.Context, requester, revision string, err error)

Send a notification that creation of a manual roll failed.

func (*AutoRollNotifier) SendModeChange

func (a *AutoRollNotifier) SendModeChange(ctx context.Context, user, mode, message string)

Send a mode change message.

func (*AutoRollNotifier) SendNewFailure

func (a *AutoRollNotifier) SendNewFailure(ctx context.Context, id, url string)

Send a notification that the most recent roll failed when the roll before it succeeded.

func (*AutoRollNotifier) SendNewSuccess

func (a *AutoRollNotifier) SendNewSuccess(ctx context.Context, id, url string)

Send a notification that the most recent roll succeeded when the roll before it failed.

func (*AutoRollNotifier) SendRollCreationFailed

func (a *AutoRollNotifier) SendRollCreationFailed(ctx context.Context, err error)

Send a notification that creation of a roll failed.

func (*AutoRollNotifier) SendSafetyThrottled

func (a *AutoRollNotifier) SendSafetyThrottled(ctx context.Context, until time.Time)

Send a notification that the roller is safety-throttled.

func (*AutoRollNotifier) SendStrategyChange

func (a *AutoRollNotifier) SendStrategyChange(ctx context.Context, user, strategy, message string)

Send a strategy change message.

func (*AutoRollNotifier) SendSuccessThrottled

func (a *AutoRollNotifier) SendSuccessThrottled(ctx context.Context, until time.Time)

Send a notification that the roller is success-throttled.

func (*AutoRollNotifier) SendTooManyCLs

func (a *AutoRollNotifier) SendTooManyCLs(ctx context.Context, numCLs int, rev string)

Send a notification that too many CLs have been created to roll to the same revision.

Jump to

Keyboard shortcuts

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