incidents

package
v0.0.0-...-b2f41c8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActiveIncidentLabel = "Incident::Active"
	SeverityCritical    = "CRITICAL"
	SeverityHigh        = "HIGH"
	SeverityMedium      = "MEDIUM"
	SeverityLow         = "LOW"
	SeverityUnknown     = "Unknown"
)
View Source
const (
	EOCSelection  = "pageEOC"
	IMSelection   = "pageIM"
	CMOCSelection = "pageCMOC"
)
View Source
const (
	DeclareModalCallbackID   = "incident-declare"
	PostStatuspageCallbackID = "incident-post-statuspage"
)

Variables

This section is empty.

Functions

func IssueHasNotableUpdate

func IssueHasNotableUpdate(issueEvent *gitlab.IssueEvent) bool

Types

type DeclareModalHandler

type DeclareModalHandler struct {
	JobRunner                   *woodhouse.AsyncJobRunner
	SlackClient                 *slack.Client
	GitlabClient                *gitlab.Client
	GitlabOpsClient             *gitlab.Client
	GitlabGraphQLClient         *gitlabutil.GraphQLClient
	GitlabOpsGraphQLClient      *gitlabutil.GraphQLClient
	GitlabProductionProjectPath string
	GitLabProfileSlackFieldID   string
	GitLabIssueType             string

	IncidentChannelNamePrefix string
	IncidentCallURL           string

	Pager                         *pagerduty.Pager
	PagerdutyIntegrationKeyEOC    string
	PagerdutyIntegrationKeyIMOC   string
	PagerdutyIntegrationKeyCMOC   string
	PagerdutyEscalationPolicyEOC  string
	PagerdutyEscalationPolicyIMOC string
	InviteMemberIDs               []string
}

func (*DeclareModalHandler) Handle

func (*DeclareModalHandler) Validate

type GLClientInterface

type GLClientInterface struct {
}

type IncidentContext

type IncidentContext struct {
	UserID            string
	Username          string
	AnnounceChannelID string
	TeamID            string
}

type IncidentPayload

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

func NewIncidentPayload

func NewIncidentPayload(payload *slack.InteractionCallback) (*IncidentPayload, error)

func (*IncidentPayload) ExtraLabels

func (p *IncidentPayload) ExtraLabels() []string

func (*IncidentPayload) IMSelected

func (p *IncidentPayload) IMSelected() bool

func (*IncidentPayload) IsConfidential

func (p *IncidentPayload) IsConfidential() bool

func (*IncidentPayload) IsInternallyFacing

func (p *IncidentPayload) IsInternallyFacing() bool

func (*IncidentPayload) PrivateMetadata

func (p *IncidentPayload) PrivateMetadata() string

func (*IncidentPayload) SelectedTasks

func (p *IncidentPayload) SelectedTasks() []string

func (*IncidentPayload) ServiceLabel

func (p *IncidentPayload) ServiceLabel() string

func (*IncidentPayload) SeverityLabel

func (p *IncidentPayload) SeverityLabel() string

func (*IncidentPayload) Title

func (p *IncidentPayload) Title() string

func (*IncidentPayload) UseOps

func (p *IncidentPayload) UseOps() bool

type IssueWebhookHandler

type IssueWebhookHandler struct {
	GitlabGraphQLClient    *gitlabutil.GraphQLClient
	GitlabOpsGraphQLClient *gitlabutil.GraphQLClient
	UpdateIncidentSeverity bool
	SlackClient            *slack.Client
	ChannelID              string
}

func (*IssueWebhookHandler) ServeHTTP

func (h *IssueWebhookHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type OnCallGitLabUser

type OnCallGitLabUser struct {
	Mention              string
	Username             string
	UserID               int
	UsernameLookupFailed bool
	IsShadow             bool
}

type OnCallGitLabUsers

type OnCallGitLabUsers struct {
	IMOCs             []*OnCallGitLabUser
	EOCs              []*OnCallGitLabUser
	IncidentAssignees []*OnCallGitLabUser
}

type PostStatuspageModalHandler

type PostStatuspageModalHandler struct {
	JobRunner      *woodhouse.AsyncJobRunner
	SlackClient    *slack.Client
	StatusioClient *statusio.Client
}

func (*PostStatuspageModalHandler) Handle

func (*PostStatuspageModalHandler) Validate

type ReactionHighlights

type ReactionHighlights struct {
	GitlabClient                *gogitlab.Client
	GitlabProductionProjectPath string
	IssueIIDsForChannelNames    *timedmap.TimedMap[string, int]
	DiscussionIDsForIssueIIDs   *timedmap.TimedMap[int, string]
	Timestamps                  *timedmap.TimedMap[float64, bool]
}

func NewReactionHighlights

func NewReactionHighlights(gitlabClient *gogitlab.Client, gitlabProductionProjectPath string) *ReactionHighlights

func (*ReactionHighlights) AddHighlight

func (h *ReactionHighlights) AddHighlight(issueIID int, discussionID, highlightMsg string) error

func (*ReactionHighlights) Handle

func (h *ReactionHighlights) Handle(msg, channelName, name string, ts float64)

func (*ReactionHighlights) HighlightDiscussionID

func (h *ReactionHighlights) HighlightDiscussionID(issueIID int) (string, error)

func (*ReactionHighlights) IssueIIDFromSlackChannel

func (h *ReactionHighlights) IssueIIDFromSlackChannel(channelName string) (int, error)

func (*ReactionHighlights) SlackToGitLabMarkdown

func (h *ReactionHighlights) SlackToGitLabMarkdown(tsDisplay, name, msg string) string

type Severity

type Severity int

func ParseSeverityFromIssueLabel

func ParseSeverityFromIssueLabel(label string) (Severity, error)

func (Severity) IncidentSeverity

func (s Severity) IncidentSeverity() string

func (Severity) IsSev1Sev2

func (s Severity) IsSev1Sev2() bool

func (Severity) IssueLabel

func (s Severity) IssueLabel() string

func (Severity) SlackEmoji

func (s Severity) SlackEmoji() string

type SlashCommand

type SlashCommand struct {
	SlackClient                 *slack.Client
	JobRunner                   *woodhouse.AsyncJobRunner
	IncidentChannelID           string
	GitlabProductionProjectPath string
	GitlabClient                *gitlab.Client
	GitlabOpsClient             *gitlab.Client
	StatusioClient              *statusio.Client
}

func (*SlashCommand) Handle

func (s *SlashCommand) Handle(
	event *instrumentation.Event, commandName string, command slack.SlashCommand,
	w http.ResponseWriter, req *http.Request,
)

Jump to

Keyboard shortcuts

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