diff --git a/pkg/app/piped/controller/scheduler.go b/pkg/app/piped/controller/scheduler.go index 74b3976125..9eee811920 100644 --- a/pkg/app/piped/controller/scheduler.go +++ b/pkg/app/piped/controller/scheduler.go @@ -345,10 +345,14 @@ func (s *scheduler) Run(ctx context.Context) error { )) defer span.End() + s.notifyStageStartEvent(ps) + result = s.executeStage(sig, *ps, func(in executor.Input) (executor.Executor, bool) { return s.executorRegistry.Executor(model.Stage(ps.Name), in) }) + s.notifyStageEndEvent(ps, result) + switch result { case model.StageStatus_STAGE_SUCCESS: span.SetStatus(codes.Ok, statusReason) @@ -450,10 +454,14 @@ func (s *scheduler) Run(ctx context.Context) error { )) defer span.End() + s.notifyStageStartEvent(&rbs) + result := s.executeStage(sig, rbs, func(in executor.Input) (executor.Executor, bool) { return s.executorRegistry.RollbackExecutor(s.deployment.Kind, in) }) + s.notifyStageEndEvent(&rbs, result) + switch result { case model.StageStatus_STAGE_SUCCESS: span.SetStatus(codes.Ok, statusReason) @@ -850,3 +858,52 @@ func (a appAnalysisResultStore) GetLatestAnalysisResult(ctx context.Context) (*m func (a appAnalysisResultStore) PutLatestAnalysisResult(ctx context.Context, analysisResult *model.AnalysisResult) error { return a.store.PutLatestAnalysisResult(ctx, a.applicationID, analysisResult) } + +// notifyStageStartEvent sends notification evnet STAGE_STARTED +func (s *scheduler) notifyStageStartEvent(stage *model.PipelineStage) { + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_STARTED, + Metadata: &model.NotificationEventStageStarted{ + Deployment: s.deployment, + Stage: stage, + }, + }) +} + +// notifyStageEndEvent sends notification event based on the stage result. +func (s *scheduler) notifyStageEndEvent(stage *model.PipelineStage, result model.StageStatus) { + switch result { + case model.StageStatus_STAGE_SUCCESS, model.StageStatus_STAGE_EXITED: // Exit stage is treated as success. + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_SUCCEEDED, + Metadata: &model.NotificationEventStageSucceeded{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_FAILURE: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_FAILED, + Metadata: &model.NotificationEventStageFailed{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_CANCELLED: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_CANCELLED, + Metadata: &model.NotificationEventStageCancelled{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_SKIPPED: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_SKIPPED, + Metadata: &model.NotificationEventStageSkipped{ + Deployment: s.deployment, + Stage: stage, + }, + }) + } +} diff --git a/pkg/app/piped/notifier/slack.go b/pkg/app/piped/notifier/slack.go index c4b9dcb3d2..619ab5810b 100644 --- a/pkg/app/piped/notifier/slack.go +++ b/pkg/app/piped/notifier/slack.go @@ -255,6 +255,22 @@ func (s *slack) buildSlackMessage(event model.NotificationEvent, webURL string) } } + generateStageEventData := func(d *model.Deployment, s *model.PipelineStage, accounts []string, groups []string) { + accountsStr := getAccountsAsString(accounts) + groupsStr := getGroupsAsString(groups) + link = fmt.Sprintf("%s/deployments/%s?project=%s", webURL, d.Id, d.ProjectId) + fields = []slackField{ + {"Project", truncateText(d.ProjectId, 8), true}, + {"Application", makeSlackLink(d.ApplicationName, fmt.Sprintf("%s/applications/%s?project=%s", webURL, d.ApplicationId, d.ProjectId)), true}, + {"Kind", strings.ToLower(d.Kind.String()), true}, + {"Deployment", makeSlackLink(truncateText(d.Id, 8), link), true}, + {"Stage", s.Name, true}, + {"Triggered By", d.TriggeredBy(), true}, + {"Mention To Users", accountsStr, true}, + {"Mention To Groups", groupsStr, true}, + } + } + switch event.Type { case model.NotificationEventType_EVENT_DEPLOYMENT_TRIGGERED: md := event.Metadata.(*model.NotificationEventDeploymentTriggered) @@ -337,6 +353,35 @@ func (s *slack) buildSlackMessage(event model.NotificationEvent, webURL string) title = "A piped has been stopped" generatePipedEventData(md.Id, md.Name, md.Version, md.ProjectId, s.config.MentionedAccounts, s.config.MentionedGroups) + case model.NotificationEventType_EVENT_STAGE_STARTED: + md := event.Metadata.(*model.NotificationEventStageStarted) + title = fmt.Sprintf("Stage %q was started", md.Stage.Name) + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_SKIPPED: + md := event.Metadata.(*model.NotificationEventStageSkipped) + title = fmt.Sprintf("Stage %q was skipped", md.Stage.Name) + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_SUCCEEDED: + md := event.Metadata.(*model.NotificationEventStageSucceeded) + title = fmt.Sprintf("Stage %q was completed successfully", md.Stage.Name) + color = slackSuccessColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_FAILED: + md := event.Metadata.(*model.NotificationEventStageFailed) + title = fmt.Sprintf("Stage %q was failed", md.Stage.Name) + text = md.Stage.StatusReason + color = slackErrorColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_CANCELLED: + md := event.Metadata.(*model.NotificationEventStageCancelled) + title = fmt.Sprintf("Stage %q was cancelled", md.Stage.Name) + color = slackWarnColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + // TODO: Support application type of notification event. default: return slackMessage{}, false diff --git a/pkg/app/pipedv1/controller/scheduler.go b/pkg/app/pipedv1/controller/scheduler.go index 2ec97c6096..91775a8625 100644 --- a/pkg/app/pipedv1/controller/scheduler.go +++ b/pkg/app/pipedv1/controller/scheduler.go @@ -317,8 +317,12 @@ func (s *scheduler) Run(ctx context.Context) error { )) defer span.End() + s.notifyStageStartEvent(ps) + result = s.executeStage(sig, ps) + s.notifyStageEndEvent(ps, result) + switch result { case model.StageStatus_STAGE_SUCCESS: span.SetStatus(codes.Ok, statusReason) @@ -420,8 +424,12 @@ func (s *scheduler) Run(ctx context.Context) error { )) defer span.End() + s.notifyStageStartEvent(rbs) + result := s.executeStage(sig, rbs) + s.notifyStageEndEvent(rbs, result) + switch result { case model.StageStatus_STAGE_SUCCESS: span.SetStatus(codes.Ok, statusReason) @@ -756,3 +764,52 @@ func (s *scheduler) reportMostRecentlySuccessfulDeployment(ctx context.Context) return err } + +// notifyStageStartEvent sends notification evnet STAGE_STARTED +func (s *scheduler) notifyStageStartEvent(stage *model.PipelineStage) { + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_STARTED, + Metadata: &model.NotificationEventStageStarted{ + Deployment: s.deployment, + Stage: stage, + }, + }) +} + +// notifyStageEndEvent sends notification event based on the stage result. +func (s *scheduler) notifyStageEndEvent(stage *model.PipelineStage, result model.StageStatus) { + switch result { + case model.StageStatus_STAGE_SUCCESS, model.StageStatus_STAGE_EXITED: // Exit stage is treated as success. + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_SUCCEEDED, + Metadata: &model.NotificationEventStageSucceeded{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_FAILURE: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_FAILED, + Metadata: &model.NotificationEventStageFailed{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_CANCELLED: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_CANCELLED, + Metadata: &model.NotificationEventStageCancelled{ + Deployment: s.deployment, + Stage: stage, + }, + }) + case model.StageStatus_STAGE_SKIPPED: + s.notifier.Notify(model.NotificationEvent{ + Type: model.NotificationEventType_EVENT_STAGE_SKIPPED, + Metadata: &model.NotificationEventStageSkipped{ + Deployment: s.deployment, + Stage: stage, + }, + }) + } +} diff --git a/pkg/app/pipedv1/notifier/slack.go b/pkg/app/pipedv1/notifier/slack.go index c4b9dcb3d2..619ab5810b 100644 --- a/pkg/app/pipedv1/notifier/slack.go +++ b/pkg/app/pipedv1/notifier/slack.go @@ -255,6 +255,22 @@ func (s *slack) buildSlackMessage(event model.NotificationEvent, webURL string) } } + generateStageEventData := func(d *model.Deployment, s *model.PipelineStage, accounts []string, groups []string) { + accountsStr := getAccountsAsString(accounts) + groupsStr := getGroupsAsString(groups) + link = fmt.Sprintf("%s/deployments/%s?project=%s", webURL, d.Id, d.ProjectId) + fields = []slackField{ + {"Project", truncateText(d.ProjectId, 8), true}, + {"Application", makeSlackLink(d.ApplicationName, fmt.Sprintf("%s/applications/%s?project=%s", webURL, d.ApplicationId, d.ProjectId)), true}, + {"Kind", strings.ToLower(d.Kind.String()), true}, + {"Deployment", makeSlackLink(truncateText(d.Id, 8), link), true}, + {"Stage", s.Name, true}, + {"Triggered By", d.TriggeredBy(), true}, + {"Mention To Users", accountsStr, true}, + {"Mention To Groups", groupsStr, true}, + } + } + switch event.Type { case model.NotificationEventType_EVENT_DEPLOYMENT_TRIGGERED: md := event.Metadata.(*model.NotificationEventDeploymentTriggered) @@ -337,6 +353,35 @@ func (s *slack) buildSlackMessage(event model.NotificationEvent, webURL string) title = "A piped has been stopped" generatePipedEventData(md.Id, md.Name, md.Version, md.ProjectId, s.config.MentionedAccounts, s.config.MentionedGroups) + case model.NotificationEventType_EVENT_STAGE_STARTED: + md := event.Metadata.(*model.NotificationEventStageStarted) + title = fmt.Sprintf("Stage %q was started", md.Stage.Name) + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_SKIPPED: + md := event.Metadata.(*model.NotificationEventStageSkipped) + title = fmt.Sprintf("Stage %q was skipped", md.Stage.Name) + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_SUCCEEDED: + md := event.Metadata.(*model.NotificationEventStageSucceeded) + title = fmt.Sprintf("Stage %q was completed successfully", md.Stage.Name) + color = slackSuccessColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_FAILED: + md := event.Metadata.(*model.NotificationEventStageFailed) + title = fmt.Sprintf("Stage %q was failed", md.Stage.Name) + text = md.Stage.StatusReason + color = slackErrorColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + + case model.NotificationEventType_EVENT_STAGE_CANCELLED: + md := event.Metadata.(*model.NotificationEventStageCancelled) + title = fmt.Sprintf("Stage %q was cancelled", md.Stage.Name) + color = slackWarnColor + generateStageEventData(md.Deployment, md.Stage, s.config.MentionedAccounts, s.config.MentionedGroups) + // TODO: Support application type of notification event. default: return slackMessage{}, false diff --git a/pkg/model/notificationevent.go b/pkg/model/notificationevent.go index 054528fce7..8ab43464b1 100644 --- a/pkg/model/notificationevent.go +++ b/pkg/model/notificationevent.go @@ -29,6 +29,8 @@ func (e NotificationEvent) Group() NotificationEventGroup { return NotificationEventGroup_EVENT_APPLICATION_HEALTH case e.Type < 400: return NotificationEventGroup_EVENT_PIPED + case e.Type < 500: + return NotificationEventGroup_EVENT_STAGE default: return NotificationEventGroup_EVENT_NONE } diff --git a/pkg/model/notificationevent.pb.go b/pkg/model/notificationevent.pb.go index 10b50ecb3f..8b4bf96675 100644 --- a/pkg/model/notificationevent.pb.go +++ b/pkg/model/notificationevent.pb.go @@ -54,6 +54,12 @@ const ( NotificationEventType_EVENT_APPLICATION_HEALTHY NotificationEventType = 200 NotificationEventType_EVENT_PIPED_STARTED NotificationEventType = 300 NotificationEventType_EVENT_PIPED_STOPPED NotificationEventType = 301 + // Stage Events + NotificationEventType_EVENT_STAGE_STARTED NotificationEventType = 400 + NotificationEventType_EVENT_STAGE_SKIPPED NotificationEventType = 401 + NotificationEventType_EVENT_STAGE_SUCCEEDED NotificationEventType = 402 + NotificationEventType_EVENT_STAGE_FAILED NotificationEventType = 403 + NotificationEventType_EVENT_STAGE_CANCELLED NotificationEventType = 404 ) // Enum value maps for NotificationEventType. @@ -74,6 +80,11 @@ var ( 200: "EVENT_APPLICATION_HEALTHY", 300: "EVENT_PIPED_STARTED", 301: "EVENT_PIPED_STOPPED", + 400: "EVENT_STAGE_STARTED", + 401: "EVENT_STAGE_SKIPPED", + 402: "EVENT_STAGE_SUCCEEDED", + 403: "EVENT_STAGE_FAILED", + 404: "EVENT_STAGE_CANCELLED", } NotificationEventType_value = map[string]int32{ "EVENT_DEPLOYMENT_TRIGGERED": 0, @@ -91,6 +102,11 @@ var ( "EVENT_APPLICATION_HEALTHY": 200, "EVENT_PIPED_STARTED": 300, "EVENT_PIPED_STOPPED": 301, + "EVENT_STAGE_STARTED": 400, + "EVENT_STAGE_SKIPPED": 401, + "EVENT_STAGE_SUCCEEDED": 402, + "EVENT_STAGE_FAILED": 403, + "EVENT_STAGE_CANCELLED": 404, } ) @@ -129,6 +145,7 @@ const ( NotificationEventGroup_EVENT_APPLICATION_SYNC NotificationEventGroup = 2 NotificationEventGroup_EVENT_APPLICATION_HEALTH NotificationEventGroup = 3 NotificationEventGroup_EVENT_PIPED NotificationEventGroup = 4 + NotificationEventGroup_EVENT_STAGE NotificationEventGroup = 5 ) // Enum value maps for NotificationEventGroup. @@ -139,6 +156,7 @@ var ( 2: "EVENT_APPLICATION_SYNC", 3: "EVENT_APPLICATION_HEALTH", 4: "EVENT_PIPED", + 5: "EVENT_STAGE", } NotificationEventGroup_value = map[string]int32{ "EVENT_NONE": 0, @@ -146,6 +164,7 @@ var ( "EVENT_APPLICATION_SYNC": 2, "EVENT_APPLICATION_HEALTH": 3, "EVENT_PIPED": 4, + "EVENT_STAGE": 5, } ) @@ -1098,6 +1117,281 @@ func (x *NotificationEventPipedStopped) GetProjectId() string { return "" } +type NotificationEventStageStarted struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + Stage *PipelineStage `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` +} + +func (x *NotificationEventStageStarted) Reset() { + *x = NotificationEventStageStarted{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_model_notificationevent_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationEventStageStarted) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationEventStageStarted) ProtoMessage() {} + +func (x *NotificationEventStageStarted) ProtoReflect() protoreflect.Message { + mi := &file_pkg_model_notificationevent_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationEventStageStarted.ProtoReflect.Descriptor instead. +func (*NotificationEventStageStarted) Descriptor() ([]byte, []int) { + return file_pkg_model_notificationevent_proto_rawDescGZIP(), []int{14} +} + +func (x *NotificationEventStageStarted) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *NotificationEventStageStarted) GetStage() *PipelineStage { + if x != nil { + return x.Stage + } + return nil +} + +type NotificationEventStageSkipped struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + Stage *PipelineStage `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` +} + +func (x *NotificationEventStageSkipped) Reset() { + *x = NotificationEventStageSkipped{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_model_notificationevent_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationEventStageSkipped) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationEventStageSkipped) ProtoMessage() {} + +func (x *NotificationEventStageSkipped) ProtoReflect() protoreflect.Message { + mi := &file_pkg_model_notificationevent_proto_msgTypes[15] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationEventStageSkipped.ProtoReflect.Descriptor instead. +func (*NotificationEventStageSkipped) Descriptor() ([]byte, []int) { + return file_pkg_model_notificationevent_proto_rawDescGZIP(), []int{15} +} + +func (x *NotificationEventStageSkipped) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *NotificationEventStageSkipped) GetStage() *PipelineStage { + if x != nil { + return x.Stage + } + return nil +} + +type NotificationEventStageSucceeded struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + Stage *PipelineStage `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` +} + +func (x *NotificationEventStageSucceeded) Reset() { + *x = NotificationEventStageSucceeded{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_model_notificationevent_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationEventStageSucceeded) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationEventStageSucceeded) ProtoMessage() {} + +func (x *NotificationEventStageSucceeded) ProtoReflect() protoreflect.Message { + mi := &file_pkg_model_notificationevent_proto_msgTypes[16] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationEventStageSucceeded.ProtoReflect.Descriptor instead. +func (*NotificationEventStageSucceeded) Descriptor() ([]byte, []int) { + return file_pkg_model_notificationevent_proto_rawDescGZIP(), []int{16} +} + +func (x *NotificationEventStageSucceeded) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *NotificationEventStageSucceeded) GetStage() *PipelineStage { + if x != nil { + return x.Stage + } + return nil +} + +type NotificationEventStageFailed struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + Stage *PipelineStage `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` +} + +func (x *NotificationEventStageFailed) Reset() { + *x = NotificationEventStageFailed{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_model_notificationevent_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationEventStageFailed) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationEventStageFailed) ProtoMessage() {} + +func (x *NotificationEventStageFailed) ProtoReflect() protoreflect.Message { + mi := &file_pkg_model_notificationevent_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationEventStageFailed.ProtoReflect.Descriptor instead. +func (*NotificationEventStageFailed) Descriptor() ([]byte, []int) { + return file_pkg_model_notificationevent_proto_rawDescGZIP(), []int{17} +} + +func (x *NotificationEventStageFailed) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *NotificationEventStageFailed) GetStage() *PipelineStage { + if x != nil { + return x.Stage + } + return nil +} + +type NotificationEventStageCancelled struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Deployment *Deployment `protobuf:"bytes,1,opt,name=deployment,proto3" json:"deployment,omitempty"` + Stage *PipelineStage `protobuf:"bytes,2,opt,name=stage,proto3" json:"stage,omitempty"` +} + +func (x *NotificationEventStageCancelled) Reset() { + *x = NotificationEventStageCancelled{} + if protoimpl.UnsafeEnabled { + mi := &file_pkg_model_notificationevent_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NotificationEventStageCancelled) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NotificationEventStageCancelled) ProtoMessage() {} + +func (x *NotificationEventStageCancelled) ProtoReflect() protoreflect.Message { + mi := &file_pkg_model_notificationevent_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NotificationEventStageCancelled.ProtoReflect.Descriptor instead. +func (*NotificationEventStageCancelled) Descriptor() ([]byte, []int) { + return file_pkg_model_notificationevent_proto_rawDescGZIP(), []int{18} +} + +func (x *NotificationEventStageCancelled) GetDeployment() *Deployment { + if x != nil { + return x.Deployment + } + return nil +} + +func (x *NotificationEventStageCancelled) GetStage() *PipelineStage { + if x != nil { + return x.Stage + } + return nil +} + var File_pkg_model_notificationevent_proto protoreflect.FileDescriptor var file_pkg_model_notificationevent_proto_rawDesc = []byte{ @@ -1277,50 +1571,106 @@ var file_pkg_model_notificationevent_proto_rawDesc = []byte{ 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, - 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x2a, 0xf0, 0x03, 0x0a, 0x15, + 0x52, 0x09, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x49, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x1d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, - 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, - 0x52, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, - 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x45, - 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, - 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, - 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, - 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x4f, 0x4c, 0x4c, 0x49, 0x4e, 0x47, 0x5f, 0x42, - 0x41, 0x43, 0x4b, 0x10, 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, - 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, - 0x44, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, - 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, - 0x10, 0x05, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, - 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, - 0x10, 0x06, 0x12, 0x22, 0x0a, 0x1e, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, - 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x52, - 0x4f, 0x56, 0x41, 0x4c, 0x10, 0x07, 0x12, 0x23, 0x0a, 0x1f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, - 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, - 0x45, 0x52, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, - 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0x09, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, - 0x59, 0x4e, 0x43, 0x45, 0x44, 0x10, 0x64, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x56, 0x45, 0x4e, 0x54, - 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x55, 0x54, - 0x5f, 0x4f, 0x46, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x65, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x56, - 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, - 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x59, 0x10, 0xc8, 0x01, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, - 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, - 0x44, 0x10, 0xac, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x49, - 0x50, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0xad, 0x02, 0x2a, 0x89, - 0x01, 0x0a, 0x16, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, - 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, - 0x5f, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x44, 0x10, 0x04, 0x42, 0x25, 0x5a, 0x23, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x2d, 0x63, 0x64, - 0x2f, 0x70, 0x69, 0x70, 0x65, 0x63, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x53, 0x74, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x3b, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, + 0x22, 0x92, 0x01, 0x0a, 0x1d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x67, 0x65, 0x53, 0x6b, 0x69, 0x70, 0x70, + 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x44, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, + 0x02, 0x10, 0x01, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, + 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, + 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, + 0x74, 0x61, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, + 0x73, 0x74, 0x61, 0x67, 0x65, 0x22, 0x94, 0x01, 0x0a, 0x1f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x67, 0x65, + 0x53, 0x75, 0x63, 0x63, 0x65, 0x65, 0x64, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x50, 0x69, + 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x22, 0x91, 0x01, 0x0a, + 0x1c, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x53, 0x74, 0x61, 0x67, 0x65, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x3b, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, + 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, + 0x22, 0x94, 0x01, 0x0a, 0x1f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x67, 0x65, 0x43, 0x61, 0x6e, 0x63, 0x65, + 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x3b, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x08, 0xfa, 0x42, 0x05, + 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x12, 0x34, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x50, 0x69, 0x70, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x2a, 0xf5, 0x04, 0x0a, 0x15, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, + 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, + 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x1d, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, + 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x02, 0x12, 0x21, + 0x0a, 0x1d, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x52, 0x4f, 0x4c, 0x4c, 0x49, 0x4e, 0x47, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x10, + 0x03, 0x12, 0x1e, 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, + 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, + 0x04, 0x12, 0x1b, 0x0a, 0x17, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, + 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x12, 0x1e, + 0x0a, 0x1a, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x06, 0x12, 0x22, + 0x0a, 0x1e, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x57, 0x41, 0x49, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x52, 0x4f, 0x56, 0x41, 0x4c, + 0x10, 0x07, 0x12, 0x23, 0x0a, 0x1f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, + 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x52, 0x49, 0x47, 0x47, 0x45, 0x52, 0x5f, 0x46, + 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x52, + 0x54, 0x45, 0x44, 0x10, 0x09, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, + 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x45, + 0x44, 0x10, 0x64, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, + 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x4f, 0x46, 0x5f, + 0x53, 0x59, 0x4e, 0x43, 0x10, 0x65, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x48, 0x45, 0x41, 0x4c, + 0x54, 0x48, 0x59, 0x10, 0xc8, 0x01, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x50, 0x49, 0x50, 0x45, 0x44, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, 0x44, 0x10, 0xac, 0x02, + 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x44, 0x5f, + 0x53, 0x54, 0x4f, 0x50, 0x50, 0x45, 0x44, 0x10, 0xad, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x52, 0x54, 0x45, + 0x44, 0x10, 0x90, 0x03, 0x12, 0x18, 0x0a, 0x13, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, + 0x41, 0x47, 0x45, 0x5f, 0x53, 0x4b, 0x49, 0x50, 0x50, 0x45, 0x44, 0x10, 0x91, 0x03, 0x12, 0x1a, + 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x53, 0x55, + 0x43, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, 0x92, 0x03, 0x12, 0x17, 0x0a, 0x12, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, + 0x10, 0x93, 0x03, 0x12, 0x1a, 0x0a, 0x15, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, + 0x47, 0x45, 0x5f, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x94, 0x03, 0x2a, + 0x9a, 0x01, 0x0a, 0x16, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x44, 0x45, 0x50, 0x4c, 0x4f, 0x59, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, + 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, + 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, + 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x41, 0x50, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x48, 0x45, 0x41, 0x4c, 0x54, 0x48, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x56, + 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x49, 0x50, 0x45, 0x44, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, 0x45, + 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x41, 0x47, 0x45, 0x10, 0x05, 0x42, 0x25, 0x5a, 0x23, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x2d, + 0x63, 0x64, 0x2f, 0x70, 0x69, 0x70, 0x65, 0x63, 0x64, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1336,7 +1686,7 @@ func file_pkg_model_notificationevent_proto_rawDescGZIP() []byte { } var file_pkg_model_notificationevent_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_pkg_model_notificationevent_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_pkg_model_notificationevent_proto_msgTypes = make([]protoimpl.MessageInfo, 19) var file_pkg_model_notificationevent_proto_goTypes = []interface{}{ (NotificationEventType)(0), // 0: model.NotificationEventType (NotificationEventGroup)(0), // 1: model.NotificationEventGroup @@ -1354,30 +1704,46 @@ var file_pkg_model_notificationevent_proto_goTypes = []interface{}{ (*NotificationEventApplicationOutOfSync)(nil), // 13: model.NotificationEventApplicationOutOfSync (*NotificationEventPipedStarted)(nil), // 14: model.NotificationEventPipedStarted (*NotificationEventPipedStopped)(nil), // 15: model.NotificationEventPipedStopped - (*Deployment)(nil), // 16: model.Deployment - (*Application)(nil), // 17: model.Application - (*ApplicationSyncState)(nil), // 18: model.ApplicationSyncState + (*NotificationEventStageStarted)(nil), // 16: model.NotificationEventStageStarted + (*NotificationEventStageSkipped)(nil), // 17: model.NotificationEventStageSkipped + (*NotificationEventStageSucceeded)(nil), // 18: model.NotificationEventStageSucceeded + (*NotificationEventStageFailed)(nil), // 19: model.NotificationEventStageFailed + (*NotificationEventStageCancelled)(nil), // 20: model.NotificationEventStageCancelled + (*Deployment)(nil), // 21: model.Deployment + (*Application)(nil), // 22: model.Application + (*ApplicationSyncState)(nil), // 23: model.ApplicationSyncState + (*PipelineStage)(nil), // 24: model.PipelineStage } var file_pkg_model_notificationevent_proto_depIdxs = []int32{ - 16, // 0: model.NotificationEventDeploymentTriggered.deployment:type_name -> model.Deployment - 16, // 1: model.NotificationEventDeploymentPlanned.deployment:type_name -> model.Deployment - 16, // 2: model.NotificationEventDeploymentStarted.deployment:type_name -> model.Deployment - 16, // 3: model.NotificationEventDeploymentApproved.deployment:type_name -> model.Deployment - 16, // 4: model.NotificationEventDeploymentRollingBack.deployment:type_name -> model.Deployment - 16, // 5: model.NotificationEventDeploymentSucceeded.deployment:type_name -> model.Deployment - 16, // 6: model.NotificationEventDeploymentFailed.deployment:type_name -> model.Deployment - 16, // 7: model.NotificationEventDeploymentCancelled.deployment:type_name -> model.Deployment - 16, // 8: model.NotificationEventDeploymentWaitApproval.deployment:type_name -> model.Deployment - 17, // 9: model.NotificationEventDeploymentTriggerFailed.application:type_name -> model.Application - 17, // 10: model.NotificationEventApplicationSynced.application:type_name -> model.Application - 18, // 11: model.NotificationEventApplicationSynced.state:type_name -> model.ApplicationSyncState - 17, // 12: model.NotificationEventApplicationOutOfSync.application:type_name -> model.Application - 18, // 13: model.NotificationEventApplicationOutOfSync.state:type_name -> model.ApplicationSyncState - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 21, // 0: model.NotificationEventDeploymentTriggered.deployment:type_name -> model.Deployment + 21, // 1: model.NotificationEventDeploymentPlanned.deployment:type_name -> model.Deployment + 21, // 2: model.NotificationEventDeploymentStarted.deployment:type_name -> model.Deployment + 21, // 3: model.NotificationEventDeploymentApproved.deployment:type_name -> model.Deployment + 21, // 4: model.NotificationEventDeploymentRollingBack.deployment:type_name -> model.Deployment + 21, // 5: model.NotificationEventDeploymentSucceeded.deployment:type_name -> model.Deployment + 21, // 6: model.NotificationEventDeploymentFailed.deployment:type_name -> model.Deployment + 21, // 7: model.NotificationEventDeploymentCancelled.deployment:type_name -> model.Deployment + 21, // 8: model.NotificationEventDeploymentWaitApproval.deployment:type_name -> model.Deployment + 22, // 9: model.NotificationEventDeploymentTriggerFailed.application:type_name -> model.Application + 22, // 10: model.NotificationEventApplicationSynced.application:type_name -> model.Application + 23, // 11: model.NotificationEventApplicationSynced.state:type_name -> model.ApplicationSyncState + 22, // 12: model.NotificationEventApplicationOutOfSync.application:type_name -> model.Application + 23, // 13: model.NotificationEventApplicationOutOfSync.state:type_name -> model.ApplicationSyncState + 21, // 14: model.NotificationEventStageStarted.deployment:type_name -> model.Deployment + 24, // 15: model.NotificationEventStageStarted.stage:type_name -> model.PipelineStage + 21, // 16: model.NotificationEventStageSkipped.deployment:type_name -> model.Deployment + 24, // 17: model.NotificationEventStageSkipped.stage:type_name -> model.PipelineStage + 21, // 18: model.NotificationEventStageSucceeded.deployment:type_name -> model.Deployment + 24, // 19: model.NotificationEventStageSucceeded.stage:type_name -> model.PipelineStage + 21, // 20: model.NotificationEventStageFailed.deployment:type_name -> model.Deployment + 24, // 21: model.NotificationEventStageFailed.stage:type_name -> model.PipelineStage + 21, // 22: model.NotificationEventStageCancelled.deployment:type_name -> model.Deployment + 24, // 23: model.NotificationEventStageCancelled.stage:type_name -> model.PipelineStage + 24, // [24:24] is the sub-list for method output_type + 24, // [24:24] is the sub-list for method input_type + 24, // [24:24] is the sub-list for extension type_name + 24, // [24:24] is the sub-list for extension extendee + 0, // [0:24] is the sub-list for field type_name } func init() { file_pkg_model_notificationevent_proto_init() } @@ -1556,6 +1922,66 @@ func file_pkg_model_notificationevent_proto_init() { return nil } } + file_pkg_model_notificationevent_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationEventStageStarted); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_model_notificationevent_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationEventStageSkipped); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_model_notificationevent_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationEventStageSucceeded); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_model_notificationevent_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationEventStageFailed); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_pkg_model_notificationevent_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NotificationEventStageCancelled); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1563,7 +1989,7 @@ func file_pkg_model_notificationevent_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_pkg_model_notificationevent_proto_rawDesc, NumEnums: 2, - NumMessages: 14, + NumMessages: 19, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/model/notificationevent.pb.validate.go b/pkg/model/notificationevent.pb.validate.go index 3abace0ac9..77d1b47fab 100644 --- a/pkg/model/notificationevent.pb.validate.go +++ b/pkg/model/notificationevent.pb.validate.go @@ -2174,3 +2174,918 @@ var _ interface { Cause() error ErrorName() string } = NotificationEventPipedStoppedValidationError{} + +// Validate checks the field values on NotificationEventStageStarted with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *NotificationEventStageStarted) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on NotificationEventStageStarted with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// NotificationEventStageStartedMultiError, or nil if none found. +func (m *NotificationEventStageStarted) ValidateAll() error { + return m.validate(true) +} + +func (m *NotificationEventStageStarted) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetDeployment() == nil { + err := NotificationEventStageStartedValidationError{ + field: "Deployment", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetDeployment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageStartedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageStartedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeployment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageStartedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStage() == nil { + err := NotificationEventStageStartedValidationError{ + field: "Stage", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageStartedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageStartedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageStartedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return NotificationEventStageStartedMultiError(errors) + } + + return nil +} + +// NotificationEventStageStartedMultiError is an error wrapping multiple +// validation errors returned by NotificationEventStageStarted.ValidateAll() +// if the designated constraints aren't met. +type NotificationEventStageStartedMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m NotificationEventStageStartedMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m NotificationEventStageStartedMultiError) AllErrors() []error { return m } + +// NotificationEventStageStartedValidationError is the validation error +// returned by NotificationEventStageStarted.Validate if the designated +// constraints aren't met. +type NotificationEventStageStartedValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NotificationEventStageStartedValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NotificationEventStageStartedValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NotificationEventStageStartedValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NotificationEventStageStartedValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NotificationEventStageStartedValidationError) ErrorName() string { + return "NotificationEventStageStartedValidationError" +} + +// Error satisfies the builtin error interface +func (e NotificationEventStageStartedValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNotificationEventStageStarted.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NotificationEventStageStartedValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NotificationEventStageStartedValidationError{} + +// Validate checks the field values on NotificationEventStageSkipped with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *NotificationEventStageSkipped) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on NotificationEventStageSkipped with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// NotificationEventStageSkippedMultiError, or nil if none found. +func (m *NotificationEventStageSkipped) ValidateAll() error { + return m.validate(true) +} + +func (m *NotificationEventStageSkipped) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetDeployment() == nil { + err := NotificationEventStageSkippedValidationError{ + field: "Deployment", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetDeployment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageSkippedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageSkippedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeployment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageSkippedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStage() == nil { + err := NotificationEventStageSkippedValidationError{ + field: "Stage", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageSkippedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageSkippedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageSkippedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return NotificationEventStageSkippedMultiError(errors) + } + + return nil +} + +// NotificationEventStageSkippedMultiError is an error wrapping multiple +// validation errors returned by NotificationEventStageSkipped.ValidateAll() +// if the designated constraints aren't met. +type NotificationEventStageSkippedMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m NotificationEventStageSkippedMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m NotificationEventStageSkippedMultiError) AllErrors() []error { return m } + +// NotificationEventStageSkippedValidationError is the validation error +// returned by NotificationEventStageSkipped.Validate if the designated +// constraints aren't met. +type NotificationEventStageSkippedValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NotificationEventStageSkippedValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NotificationEventStageSkippedValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NotificationEventStageSkippedValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NotificationEventStageSkippedValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NotificationEventStageSkippedValidationError) ErrorName() string { + return "NotificationEventStageSkippedValidationError" +} + +// Error satisfies the builtin error interface +func (e NotificationEventStageSkippedValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNotificationEventStageSkipped.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NotificationEventStageSkippedValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NotificationEventStageSkippedValidationError{} + +// Validate checks the field values on NotificationEventStageSucceeded with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *NotificationEventStageSucceeded) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on NotificationEventStageSucceeded with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// NotificationEventStageSucceededMultiError, or nil if none found. +func (m *NotificationEventStageSucceeded) ValidateAll() error { + return m.validate(true) +} + +func (m *NotificationEventStageSucceeded) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetDeployment() == nil { + err := NotificationEventStageSucceededValidationError{ + field: "Deployment", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetDeployment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageSucceededValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageSucceededValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeployment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageSucceededValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStage() == nil { + err := NotificationEventStageSucceededValidationError{ + field: "Stage", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageSucceededValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageSucceededValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageSucceededValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return NotificationEventStageSucceededMultiError(errors) + } + + return nil +} + +// NotificationEventStageSucceededMultiError is an error wrapping multiple +// validation errors returned by NotificationEventStageSucceeded.ValidateAll() +// if the designated constraints aren't met. +type NotificationEventStageSucceededMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m NotificationEventStageSucceededMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m NotificationEventStageSucceededMultiError) AllErrors() []error { return m } + +// NotificationEventStageSucceededValidationError is the validation error +// returned by NotificationEventStageSucceeded.Validate if the designated +// constraints aren't met. +type NotificationEventStageSucceededValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NotificationEventStageSucceededValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NotificationEventStageSucceededValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NotificationEventStageSucceededValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NotificationEventStageSucceededValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NotificationEventStageSucceededValidationError) ErrorName() string { + return "NotificationEventStageSucceededValidationError" +} + +// Error satisfies the builtin error interface +func (e NotificationEventStageSucceededValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNotificationEventStageSucceeded.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NotificationEventStageSucceededValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NotificationEventStageSucceededValidationError{} + +// Validate checks the field values on NotificationEventStageFailed with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *NotificationEventStageFailed) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on NotificationEventStageFailed with the +// rules defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// NotificationEventStageFailedMultiError, or nil if none found. +func (m *NotificationEventStageFailed) ValidateAll() error { + return m.validate(true) +} + +func (m *NotificationEventStageFailed) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetDeployment() == nil { + err := NotificationEventStageFailedValidationError{ + field: "Deployment", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetDeployment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageFailedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageFailedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeployment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageFailedValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStage() == nil { + err := NotificationEventStageFailedValidationError{ + field: "Stage", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageFailedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageFailedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageFailedValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return NotificationEventStageFailedMultiError(errors) + } + + return nil +} + +// NotificationEventStageFailedMultiError is an error wrapping multiple +// validation errors returned by NotificationEventStageFailed.ValidateAll() if +// the designated constraints aren't met. +type NotificationEventStageFailedMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m NotificationEventStageFailedMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m NotificationEventStageFailedMultiError) AllErrors() []error { return m } + +// NotificationEventStageFailedValidationError is the validation error returned +// by NotificationEventStageFailed.Validate if the designated constraints +// aren't met. +type NotificationEventStageFailedValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NotificationEventStageFailedValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NotificationEventStageFailedValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NotificationEventStageFailedValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NotificationEventStageFailedValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NotificationEventStageFailedValidationError) ErrorName() string { + return "NotificationEventStageFailedValidationError" +} + +// Error satisfies the builtin error interface +func (e NotificationEventStageFailedValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNotificationEventStageFailed.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NotificationEventStageFailedValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NotificationEventStageFailedValidationError{} + +// Validate checks the field values on NotificationEventStageCancelled with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *NotificationEventStageCancelled) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on NotificationEventStageCancelled with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// NotificationEventStageCancelledMultiError, or nil if none found. +func (m *NotificationEventStageCancelled) ValidateAll() error { + return m.validate(true) +} + +func (m *NotificationEventStageCancelled) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetDeployment() == nil { + err := NotificationEventStageCancelledValidationError{ + field: "Deployment", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetDeployment()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageCancelledValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageCancelledValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetDeployment()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageCancelledValidationError{ + field: "Deployment", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if m.GetStage() == nil { + err := NotificationEventStageCancelledValidationError{ + field: "Stage", + reason: "value is required", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetStage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, NotificationEventStageCancelledValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, NotificationEventStageCancelledValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetStage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return NotificationEventStageCancelledValidationError{ + field: "Stage", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return NotificationEventStageCancelledMultiError(errors) + } + + return nil +} + +// NotificationEventStageCancelledMultiError is an error wrapping multiple +// validation errors returned by NotificationEventStageCancelled.ValidateAll() +// if the designated constraints aren't met. +type NotificationEventStageCancelledMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m NotificationEventStageCancelledMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m NotificationEventStageCancelledMultiError) AllErrors() []error { return m } + +// NotificationEventStageCancelledValidationError is the validation error +// returned by NotificationEventStageCancelled.Validate if the designated +// constraints aren't met. +type NotificationEventStageCancelledValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e NotificationEventStageCancelledValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e NotificationEventStageCancelledValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e NotificationEventStageCancelledValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e NotificationEventStageCancelledValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e NotificationEventStageCancelledValidationError) ErrorName() string { + return "NotificationEventStageCancelledValidationError" +} + +// Error satisfies the builtin error interface +func (e NotificationEventStageCancelledValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sNotificationEventStageCancelled.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = NotificationEventStageCancelledValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = NotificationEventStageCancelledValidationError{} diff --git a/pkg/model/notificationevent.proto b/pkg/model/notificationevent.proto index db791e4e5d..19eb9f77a8 100644 --- a/pkg/model/notificationevent.proto +++ b/pkg/model/notificationevent.proto @@ -41,6 +41,13 @@ enum NotificationEventType { EVENT_PIPED_STARTED = 300; EVENT_PIPED_STOPPED = 301; + + // Stage Events + EVENT_STAGE_STARTED = 400; + EVENT_STAGE_SKIPPED = 401; + EVENT_STAGE_SUCCEEDED = 402; + EVENT_STAGE_FAILED = 403; + EVENT_STAGE_CANCELLED = 404; } enum NotificationEventGroup { @@ -49,6 +56,7 @@ enum NotificationEventGroup { EVENT_APPLICATION_SYNC = 2; EVENT_APPLICATION_HEALTH = 3; EVENT_PIPED = 4; + EVENT_STAGE = 5; } message NotificationEventDeploymentTriggered { @@ -139,3 +147,28 @@ message NotificationEventPipedStopped { string version = 3; string project_id = 4 [(validate.rules).string.min_len = 1]; } + +message NotificationEventStageStarted { + Deployment deployment = 1 [(validate.rules).message.required = true]; + PipelineStage stage = 2 [(validate.rules).message.required = true]; +} + +message NotificationEventStageSkipped { + Deployment deployment = 1 [(validate.rules).message.required = true]; + PipelineStage stage = 2 [(validate.rules).message.required = true]; +} + +message NotificationEventStageSucceeded { + Deployment deployment = 1 [(validate.rules).message.required = true]; + PipelineStage stage = 2 [(validate.rules).message.required = true]; +} + +message NotificationEventStageFailed { + Deployment deployment = 1 [(validate.rules).message.required = true]; + PipelineStage stage = 2 [(validate.rules).message.required = true]; +} + +message NotificationEventStageCancelled { + Deployment deployment = 1 [(validate.rules).message.required = true]; + PipelineStage stage = 2 [(validate.rules).message.required = true]; +} diff --git a/pkg/model/notificationevent_test.go b/pkg/model/notificationevent_test.go index b1b80d95ce..a7c425848b 100644 --- a/pkg/model/notificationevent_test.go +++ b/pkg/model/notificationevent_test.go @@ -48,8 +48,13 @@ func TestGroup(t *testing.T) { want: NotificationEventGroup_EVENT_PIPED, }, { - name: "returns EVENT_NONE for type >= 400", - typ: 400, + name: "returns EVENT_NONE for type < 500", + typ: 499, + want: NotificationEventGroup_EVENT_STAGE, + }, + { + name: "returns EVENT_NONE for type >= 500", + typ: 500, want: NotificationEventGroup_EVENT_NONE, }, } diff --git a/web/model/notificationevent_pb.d.ts b/web/model/notificationevent_pb.d.ts index 59c04b728b..748d6c8ca1 100644 --- a/web/model/notificationevent_pb.d.ts +++ b/web/model/notificationevent_pb.d.ts @@ -453,6 +453,136 @@ export namespace NotificationEventPipedStopped { } } +export class NotificationEventStageStarted extends jspb.Message { + getDeployment(): pkg_model_deployment_pb.Deployment | undefined; + setDeployment(value?: pkg_model_deployment_pb.Deployment): NotificationEventStageStarted; + hasDeployment(): boolean; + clearDeployment(): NotificationEventStageStarted; + + getStage(): pkg_model_deployment_pb.PipelineStage | undefined; + setStage(value?: pkg_model_deployment_pb.PipelineStage): NotificationEventStageStarted; + hasStage(): boolean; + clearStage(): NotificationEventStageStarted; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotificationEventStageStarted.AsObject; + static toObject(includeInstance: boolean, msg: NotificationEventStageStarted): NotificationEventStageStarted.AsObject; + static serializeBinaryToWriter(message: NotificationEventStageStarted, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotificationEventStageStarted; + static deserializeBinaryFromReader(message: NotificationEventStageStarted, reader: jspb.BinaryReader): NotificationEventStageStarted; +} + +export namespace NotificationEventStageStarted { + export type AsObject = { + deployment?: pkg_model_deployment_pb.Deployment.AsObject, + stage?: pkg_model_deployment_pb.PipelineStage.AsObject, + } +} + +export class NotificationEventStageSkipped extends jspb.Message { + getDeployment(): pkg_model_deployment_pb.Deployment | undefined; + setDeployment(value?: pkg_model_deployment_pb.Deployment): NotificationEventStageSkipped; + hasDeployment(): boolean; + clearDeployment(): NotificationEventStageSkipped; + + getStage(): pkg_model_deployment_pb.PipelineStage | undefined; + setStage(value?: pkg_model_deployment_pb.PipelineStage): NotificationEventStageSkipped; + hasStage(): boolean; + clearStage(): NotificationEventStageSkipped; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotificationEventStageSkipped.AsObject; + static toObject(includeInstance: boolean, msg: NotificationEventStageSkipped): NotificationEventStageSkipped.AsObject; + static serializeBinaryToWriter(message: NotificationEventStageSkipped, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotificationEventStageSkipped; + static deserializeBinaryFromReader(message: NotificationEventStageSkipped, reader: jspb.BinaryReader): NotificationEventStageSkipped; +} + +export namespace NotificationEventStageSkipped { + export type AsObject = { + deployment?: pkg_model_deployment_pb.Deployment.AsObject, + stage?: pkg_model_deployment_pb.PipelineStage.AsObject, + } +} + +export class NotificationEventStageSucceeded extends jspb.Message { + getDeployment(): pkg_model_deployment_pb.Deployment | undefined; + setDeployment(value?: pkg_model_deployment_pb.Deployment): NotificationEventStageSucceeded; + hasDeployment(): boolean; + clearDeployment(): NotificationEventStageSucceeded; + + getStage(): pkg_model_deployment_pb.PipelineStage | undefined; + setStage(value?: pkg_model_deployment_pb.PipelineStage): NotificationEventStageSucceeded; + hasStage(): boolean; + clearStage(): NotificationEventStageSucceeded; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotificationEventStageSucceeded.AsObject; + static toObject(includeInstance: boolean, msg: NotificationEventStageSucceeded): NotificationEventStageSucceeded.AsObject; + static serializeBinaryToWriter(message: NotificationEventStageSucceeded, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotificationEventStageSucceeded; + static deserializeBinaryFromReader(message: NotificationEventStageSucceeded, reader: jspb.BinaryReader): NotificationEventStageSucceeded; +} + +export namespace NotificationEventStageSucceeded { + export type AsObject = { + deployment?: pkg_model_deployment_pb.Deployment.AsObject, + stage?: pkg_model_deployment_pb.PipelineStage.AsObject, + } +} + +export class NotificationEventStageFailed extends jspb.Message { + getDeployment(): pkg_model_deployment_pb.Deployment | undefined; + setDeployment(value?: pkg_model_deployment_pb.Deployment): NotificationEventStageFailed; + hasDeployment(): boolean; + clearDeployment(): NotificationEventStageFailed; + + getStage(): pkg_model_deployment_pb.PipelineStage | undefined; + setStage(value?: pkg_model_deployment_pb.PipelineStage): NotificationEventStageFailed; + hasStage(): boolean; + clearStage(): NotificationEventStageFailed; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotificationEventStageFailed.AsObject; + static toObject(includeInstance: boolean, msg: NotificationEventStageFailed): NotificationEventStageFailed.AsObject; + static serializeBinaryToWriter(message: NotificationEventStageFailed, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotificationEventStageFailed; + static deserializeBinaryFromReader(message: NotificationEventStageFailed, reader: jspb.BinaryReader): NotificationEventStageFailed; +} + +export namespace NotificationEventStageFailed { + export type AsObject = { + deployment?: pkg_model_deployment_pb.Deployment.AsObject, + stage?: pkg_model_deployment_pb.PipelineStage.AsObject, + } +} + +export class NotificationEventStageCancelled extends jspb.Message { + getDeployment(): pkg_model_deployment_pb.Deployment | undefined; + setDeployment(value?: pkg_model_deployment_pb.Deployment): NotificationEventStageCancelled; + hasDeployment(): boolean; + clearDeployment(): NotificationEventStageCancelled; + + getStage(): pkg_model_deployment_pb.PipelineStage | undefined; + setStage(value?: pkg_model_deployment_pb.PipelineStage): NotificationEventStageCancelled; + hasStage(): boolean; + clearStage(): NotificationEventStageCancelled; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): NotificationEventStageCancelled.AsObject; + static toObject(includeInstance: boolean, msg: NotificationEventStageCancelled): NotificationEventStageCancelled.AsObject; + static serializeBinaryToWriter(message: NotificationEventStageCancelled, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): NotificationEventStageCancelled; + static deserializeBinaryFromReader(message: NotificationEventStageCancelled, reader: jspb.BinaryReader): NotificationEventStageCancelled; +} + +export namespace NotificationEventStageCancelled { + export type AsObject = { + deployment?: pkg_model_deployment_pb.Deployment.AsObject, + stage?: pkg_model_deployment_pb.PipelineStage.AsObject, + } +} + export enum NotificationEventType { EVENT_DEPLOYMENT_TRIGGERED = 0, EVENT_DEPLOYMENT_PLANNED = 1, @@ -469,6 +599,11 @@ export enum NotificationEventType { EVENT_APPLICATION_HEALTHY = 200, EVENT_PIPED_STARTED = 300, EVENT_PIPED_STOPPED = 301, + EVENT_STAGE_STARTED = 400, + EVENT_STAGE_SKIPPED = 401, + EVENT_STAGE_SUCCEEDED = 402, + EVENT_STAGE_FAILED = 403, + EVENT_STAGE_CANCELLED = 404, } export enum NotificationEventGroup { EVENT_NONE = 0, @@ -476,4 +611,5 @@ export enum NotificationEventGroup { EVENT_APPLICATION_SYNC = 2, EVENT_APPLICATION_HEALTH = 3, EVENT_PIPED = 4, + EVENT_STAGE = 5, } diff --git a/web/model/notificationevent_pb.js b/web/model/notificationevent_pb.js index 60253e7d70..25614530a4 100644 --- a/web/model/notificationevent_pb.js +++ b/web/model/notificationevent_pb.js @@ -42,6 +42,11 @@ goog.exportSymbol('proto.model.NotificationEventDeploymentWaitApproval', null, g goog.exportSymbol('proto.model.NotificationEventGroup', null, global); goog.exportSymbol('proto.model.NotificationEventPipedStarted', null, global); goog.exportSymbol('proto.model.NotificationEventPipedStopped', null, global); +goog.exportSymbol('proto.model.NotificationEventStageCancelled', null, global); +goog.exportSymbol('proto.model.NotificationEventStageFailed', null, global); +goog.exportSymbol('proto.model.NotificationEventStageSkipped', null, global); +goog.exportSymbol('proto.model.NotificationEventStageStarted', null, global); +goog.exportSymbol('proto.model.NotificationEventStageSucceeded', null, global); goog.exportSymbol('proto.model.NotificationEventType', null, global); /** * Generated by JsPbCodeGenerator. @@ -337,6 +342,111 @@ if (goog.DEBUG && !COMPILED) { */ proto.model.NotificationEventPipedStopped.displayName = 'proto.model.NotificationEventPipedStopped'; } +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.model.NotificationEventStageStarted = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.model.NotificationEventStageStarted, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.model.NotificationEventStageStarted.displayName = 'proto.model.NotificationEventStageStarted'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.model.NotificationEventStageSkipped = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.model.NotificationEventStageSkipped, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.model.NotificationEventStageSkipped.displayName = 'proto.model.NotificationEventStageSkipped'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.model.NotificationEventStageSucceeded = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.model.NotificationEventStageSucceeded, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.model.NotificationEventStageSucceeded.displayName = 'proto.model.NotificationEventStageSucceeded'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.model.NotificationEventStageFailed = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.model.NotificationEventStageFailed, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.model.NotificationEventStageFailed.displayName = 'proto.model.NotificationEventStageFailed'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.model.NotificationEventStageCancelled = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.model.NotificationEventStageCancelled, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.model.NotificationEventStageCancelled.displayName = 'proto.model.NotificationEventStageCancelled'; +} /** * List of repeated fields within this message type. @@ -3846,6 +3956,1016 @@ proto.model.NotificationEventPipedStopped.prototype.setProjectId = function(valu }; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.model.NotificationEventStageStarted.prototype.toObject = function(opt_includeInstance) { + return proto.model.NotificationEventStageStarted.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.model.NotificationEventStageStarted} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageStarted.toObject = function(includeInstance, msg) { + var f, obj = { + deployment: (f = msg.getDeployment()) && pkg_model_deployment_pb.Deployment.toObject(includeInstance, f), + stage: (f = msg.getStage()) && pkg_model_deployment_pb.PipelineStage.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.model.NotificationEventStageStarted} + */ +proto.model.NotificationEventStageStarted.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.model.NotificationEventStageStarted; + return proto.model.NotificationEventStageStarted.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.model.NotificationEventStageStarted} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.model.NotificationEventStageStarted} + */ +proto.model.NotificationEventStageStarted.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pkg_model_deployment_pb.Deployment; + reader.readMessage(value,pkg_model_deployment_pb.Deployment.deserializeBinaryFromReader); + msg.setDeployment(value); + break; + case 2: + var value = new pkg_model_deployment_pb.PipelineStage; + reader.readMessage(value,pkg_model_deployment_pb.PipelineStage.deserializeBinaryFromReader); + msg.setStage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.model.NotificationEventStageStarted.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.model.NotificationEventStageStarted.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.model.NotificationEventStageStarted} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageStarted.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDeployment(); + if (f != null) { + writer.writeMessage( + 1, + f, + pkg_model_deployment_pb.Deployment.serializeBinaryToWriter + ); + } + f = message.getStage(); + if (f != null) { + writer.writeMessage( + 2, + f, + pkg_model_deployment_pb.PipelineStage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Deployment deployment = 1; + * @return {?proto.model.Deployment} + */ +proto.model.NotificationEventStageStarted.prototype.getDeployment = function() { + return /** @type{?proto.model.Deployment} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.Deployment, 1)); +}; + + +/** + * @param {?proto.model.Deployment|undefined} value + * @return {!proto.model.NotificationEventStageStarted} returns this +*/ +proto.model.NotificationEventStageStarted.prototype.setDeployment = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageStarted} returns this + */ +proto.model.NotificationEventStageStarted.prototype.clearDeployment = function() { + return this.setDeployment(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageStarted.prototype.hasDeployment = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PipelineStage stage = 2; + * @return {?proto.model.PipelineStage} + */ +proto.model.NotificationEventStageStarted.prototype.getStage = function() { + return /** @type{?proto.model.PipelineStage} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.PipelineStage, 2)); +}; + + +/** + * @param {?proto.model.PipelineStage|undefined} value + * @return {!proto.model.NotificationEventStageStarted} returns this +*/ +proto.model.NotificationEventStageStarted.prototype.setStage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageStarted} returns this + */ +proto.model.NotificationEventStageStarted.prototype.clearStage = function() { + return this.setStage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageStarted.prototype.hasStage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.model.NotificationEventStageSkipped.prototype.toObject = function(opt_includeInstance) { + return proto.model.NotificationEventStageSkipped.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.model.NotificationEventStageSkipped} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageSkipped.toObject = function(includeInstance, msg) { + var f, obj = { + deployment: (f = msg.getDeployment()) && pkg_model_deployment_pb.Deployment.toObject(includeInstance, f), + stage: (f = msg.getStage()) && pkg_model_deployment_pb.PipelineStage.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.model.NotificationEventStageSkipped} + */ +proto.model.NotificationEventStageSkipped.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.model.NotificationEventStageSkipped; + return proto.model.NotificationEventStageSkipped.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.model.NotificationEventStageSkipped} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.model.NotificationEventStageSkipped} + */ +proto.model.NotificationEventStageSkipped.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pkg_model_deployment_pb.Deployment; + reader.readMessage(value,pkg_model_deployment_pb.Deployment.deserializeBinaryFromReader); + msg.setDeployment(value); + break; + case 2: + var value = new pkg_model_deployment_pb.PipelineStage; + reader.readMessage(value,pkg_model_deployment_pb.PipelineStage.deserializeBinaryFromReader); + msg.setStage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.model.NotificationEventStageSkipped.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.model.NotificationEventStageSkipped.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.model.NotificationEventStageSkipped} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageSkipped.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDeployment(); + if (f != null) { + writer.writeMessage( + 1, + f, + pkg_model_deployment_pb.Deployment.serializeBinaryToWriter + ); + } + f = message.getStage(); + if (f != null) { + writer.writeMessage( + 2, + f, + pkg_model_deployment_pb.PipelineStage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Deployment deployment = 1; + * @return {?proto.model.Deployment} + */ +proto.model.NotificationEventStageSkipped.prototype.getDeployment = function() { + return /** @type{?proto.model.Deployment} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.Deployment, 1)); +}; + + +/** + * @param {?proto.model.Deployment|undefined} value + * @return {!proto.model.NotificationEventStageSkipped} returns this +*/ +proto.model.NotificationEventStageSkipped.prototype.setDeployment = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageSkipped} returns this + */ +proto.model.NotificationEventStageSkipped.prototype.clearDeployment = function() { + return this.setDeployment(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageSkipped.prototype.hasDeployment = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PipelineStage stage = 2; + * @return {?proto.model.PipelineStage} + */ +proto.model.NotificationEventStageSkipped.prototype.getStage = function() { + return /** @type{?proto.model.PipelineStage} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.PipelineStage, 2)); +}; + + +/** + * @param {?proto.model.PipelineStage|undefined} value + * @return {!proto.model.NotificationEventStageSkipped} returns this +*/ +proto.model.NotificationEventStageSkipped.prototype.setStage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageSkipped} returns this + */ +proto.model.NotificationEventStageSkipped.prototype.clearStage = function() { + return this.setStage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageSkipped.prototype.hasStage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.model.NotificationEventStageSucceeded.prototype.toObject = function(opt_includeInstance) { + return proto.model.NotificationEventStageSucceeded.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.model.NotificationEventStageSucceeded} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageSucceeded.toObject = function(includeInstance, msg) { + var f, obj = { + deployment: (f = msg.getDeployment()) && pkg_model_deployment_pb.Deployment.toObject(includeInstance, f), + stage: (f = msg.getStage()) && pkg_model_deployment_pb.PipelineStage.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.model.NotificationEventStageSucceeded} + */ +proto.model.NotificationEventStageSucceeded.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.model.NotificationEventStageSucceeded; + return proto.model.NotificationEventStageSucceeded.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.model.NotificationEventStageSucceeded} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.model.NotificationEventStageSucceeded} + */ +proto.model.NotificationEventStageSucceeded.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pkg_model_deployment_pb.Deployment; + reader.readMessage(value,pkg_model_deployment_pb.Deployment.deserializeBinaryFromReader); + msg.setDeployment(value); + break; + case 2: + var value = new pkg_model_deployment_pb.PipelineStage; + reader.readMessage(value,pkg_model_deployment_pb.PipelineStage.deserializeBinaryFromReader); + msg.setStage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.model.NotificationEventStageSucceeded.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.model.NotificationEventStageSucceeded.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.model.NotificationEventStageSucceeded} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageSucceeded.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDeployment(); + if (f != null) { + writer.writeMessage( + 1, + f, + pkg_model_deployment_pb.Deployment.serializeBinaryToWriter + ); + } + f = message.getStage(); + if (f != null) { + writer.writeMessage( + 2, + f, + pkg_model_deployment_pb.PipelineStage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Deployment deployment = 1; + * @return {?proto.model.Deployment} + */ +proto.model.NotificationEventStageSucceeded.prototype.getDeployment = function() { + return /** @type{?proto.model.Deployment} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.Deployment, 1)); +}; + + +/** + * @param {?proto.model.Deployment|undefined} value + * @return {!proto.model.NotificationEventStageSucceeded} returns this +*/ +proto.model.NotificationEventStageSucceeded.prototype.setDeployment = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageSucceeded} returns this + */ +proto.model.NotificationEventStageSucceeded.prototype.clearDeployment = function() { + return this.setDeployment(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageSucceeded.prototype.hasDeployment = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PipelineStage stage = 2; + * @return {?proto.model.PipelineStage} + */ +proto.model.NotificationEventStageSucceeded.prototype.getStage = function() { + return /** @type{?proto.model.PipelineStage} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.PipelineStage, 2)); +}; + + +/** + * @param {?proto.model.PipelineStage|undefined} value + * @return {!proto.model.NotificationEventStageSucceeded} returns this +*/ +proto.model.NotificationEventStageSucceeded.prototype.setStage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageSucceeded} returns this + */ +proto.model.NotificationEventStageSucceeded.prototype.clearStage = function() { + return this.setStage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageSucceeded.prototype.hasStage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.model.NotificationEventStageFailed.prototype.toObject = function(opt_includeInstance) { + return proto.model.NotificationEventStageFailed.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.model.NotificationEventStageFailed} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageFailed.toObject = function(includeInstance, msg) { + var f, obj = { + deployment: (f = msg.getDeployment()) && pkg_model_deployment_pb.Deployment.toObject(includeInstance, f), + stage: (f = msg.getStage()) && pkg_model_deployment_pb.PipelineStage.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.model.NotificationEventStageFailed} + */ +proto.model.NotificationEventStageFailed.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.model.NotificationEventStageFailed; + return proto.model.NotificationEventStageFailed.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.model.NotificationEventStageFailed} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.model.NotificationEventStageFailed} + */ +proto.model.NotificationEventStageFailed.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pkg_model_deployment_pb.Deployment; + reader.readMessage(value,pkg_model_deployment_pb.Deployment.deserializeBinaryFromReader); + msg.setDeployment(value); + break; + case 2: + var value = new pkg_model_deployment_pb.PipelineStage; + reader.readMessage(value,pkg_model_deployment_pb.PipelineStage.deserializeBinaryFromReader); + msg.setStage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.model.NotificationEventStageFailed.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.model.NotificationEventStageFailed.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.model.NotificationEventStageFailed} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageFailed.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDeployment(); + if (f != null) { + writer.writeMessage( + 1, + f, + pkg_model_deployment_pb.Deployment.serializeBinaryToWriter + ); + } + f = message.getStage(); + if (f != null) { + writer.writeMessage( + 2, + f, + pkg_model_deployment_pb.PipelineStage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Deployment deployment = 1; + * @return {?proto.model.Deployment} + */ +proto.model.NotificationEventStageFailed.prototype.getDeployment = function() { + return /** @type{?proto.model.Deployment} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.Deployment, 1)); +}; + + +/** + * @param {?proto.model.Deployment|undefined} value + * @return {!proto.model.NotificationEventStageFailed} returns this +*/ +proto.model.NotificationEventStageFailed.prototype.setDeployment = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageFailed} returns this + */ +proto.model.NotificationEventStageFailed.prototype.clearDeployment = function() { + return this.setDeployment(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageFailed.prototype.hasDeployment = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PipelineStage stage = 2; + * @return {?proto.model.PipelineStage} + */ +proto.model.NotificationEventStageFailed.prototype.getStage = function() { + return /** @type{?proto.model.PipelineStage} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.PipelineStage, 2)); +}; + + +/** + * @param {?proto.model.PipelineStage|undefined} value + * @return {!proto.model.NotificationEventStageFailed} returns this +*/ +proto.model.NotificationEventStageFailed.prototype.setStage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageFailed} returns this + */ +proto.model.NotificationEventStageFailed.prototype.clearStage = function() { + return this.setStage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageFailed.prototype.hasStage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.model.NotificationEventStageCancelled.prototype.toObject = function(opt_includeInstance) { + return proto.model.NotificationEventStageCancelled.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.model.NotificationEventStageCancelled} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageCancelled.toObject = function(includeInstance, msg) { + var f, obj = { + deployment: (f = msg.getDeployment()) && pkg_model_deployment_pb.Deployment.toObject(includeInstance, f), + stage: (f = msg.getStage()) && pkg_model_deployment_pb.PipelineStage.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.model.NotificationEventStageCancelled} + */ +proto.model.NotificationEventStageCancelled.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.model.NotificationEventStageCancelled; + return proto.model.NotificationEventStageCancelled.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.model.NotificationEventStageCancelled} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.model.NotificationEventStageCancelled} + */ +proto.model.NotificationEventStageCancelled.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new pkg_model_deployment_pb.Deployment; + reader.readMessage(value,pkg_model_deployment_pb.Deployment.deserializeBinaryFromReader); + msg.setDeployment(value); + break; + case 2: + var value = new pkg_model_deployment_pb.PipelineStage; + reader.readMessage(value,pkg_model_deployment_pb.PipelineStage.deserializeBinaryFromReader); + msg.setStage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.model.NotificationEventStageCancelled.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.model.NotificationEventStageCancelled.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.model.NotificationEventStageCancelled} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.model.NotificationEventStageCancelled.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDeployment(); + if (f != null) { + writer.writeMessage( + 1, + f, + pkg_model_deployment_pb.Deployment.serializeBinaryToWriter + ); + } + f = message.getStage(); + if (f != null) { + writer.writeMessage( + 2, + f, + pkg_model_deployment_pb.PipelineStage.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Deployment deployment = 1; + * @return {?proto.model.Deployment} + */ +proto.model.NotificationEventStageCancelled.prototype.getDeployment = function() { + return /** @type{?proto.model.Deployment} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.Deployment, 1)); +}; + + +/** + * @param {?proto.model.Deployment|undefined} value + * @return {!proto.model.NotificationEventStageCancelled} returns this +*/ +proto.model.NotificationEventStageCancelled.prototype.setDeployment = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageCancelled} returns this + */ +proto.model.NotificationEventStageCancelled.prototype.clearDeployment = function() { + return this.setDeployment(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageCancelled.prototype.hasDeployment = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional PipelineStage stage = 2; + * @return {?proto.model.PipelineStage} + */ +proto.model.NotificationEventStageCancelled.prototype.getStage = function() { + return /** @type{?proto.model.PipelineStage} */ ( + jspb.Message.getWrapperField(this, pkg_model_deployment_pb.PipelineStage, 2)); +}; + + +/** + * @param {?proto.model.PipelineStage|undefined} value + * @return {!proto.model.NotificationEventStageCancelled} returns this +*/ +proto.model.NotificationEventStageCancelled.prototype.setStage = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.model.NotificationEventStageCancelled} returns this + */ +proto.model.NotificationEventStageCancelled.prototype.clearStage = function() { + return this.setStage(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.model.NotificationEventStageCancelled.prototype.hasStage = function() { + return jspb.Message.getField(this, 2) != null; +}; + + /** * @enum {number} */ @@ -3864,7 +4984,12 @@ proto.model.NotificationEventType = { EVENT_APPLICATION_OUT_OF_SYNC: 101, EVENT_APPLICATION_HEALTHY: 200, EVENT_PIPED_STARTED: 300, - EVENT_PIPED_STOPPED: 301 + EVENT_PIPED_STOPPED: 301, + EVENT_STAGE_STARTED: 400, + EVENT_STAGE_SKIPPED: 401, + EVENT_STAGE_SUCCEEDED: 402, + EVENT_STAGE_FAILED: 403, + EVENT_STAGE_CANCELLED: 404 }; /** @@ -3875,7 +5000,8 @@ proto.model.NotificationEventGroup = { EVENT_DEPLOYMENT: 1, EVENT_APPLICATION_SYNC: 2, EVENT_APPLICATION_HEALTH: 3, - EVENT_PIPED: 4 + EVENT_PIPED: 4, + EVENT_STAGE: 5 }; goog.object.extend(exports, proto.model);