Skip to content

Commit 5fabd45

Browse files
committed
rename isSuccess to isFailed
1 parent 305493c commit 5fabd45

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

ci-runner/executor/stage/cdStages.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (impl *CdStage) runCDStages(ciCdRequest *helper.CiCdTriggerEvent) (*helper.
234234
}
235235

236236
func sendCDFailureEvent(ciRequest *helper.CommonWorkflowRequest, err *helper.CdStageError) {
237-
event := adaptor.NewCdCompleteEvent(ciRequest, false).
237+
event := adaptor.NewCdCompleteEvent(ciRequest, true).
238238
WithIsArtifactUploaded(err.IsArtifactUploaded())
239239
e := helper.SendCDEvent(ciRequest, event)
240240
if e != nil {
@@ -244,7 +244,7 @@ func sendCDFailureEvent(ciRequest *helper.CommonWorkflowRequest, err *helper.CdS
244244

245245
func sendCDSuccessEvent(commonWorkflowRequest *helper.CommonWorkflowRequest, allPluginArtifacts *helper.PluginArtifacts, artifactUploaded bool) {
246246
log.Println(util.DEVTRON, " event")
247-
event := adaptor.NewCdCompleteEvent(commonWorkflowRequest, true).
247+
event := adaptor.NewCdCompleteEvent(commonWorkflowRequest, false).
248248
WithPluginArtifacts(allPluginArtifacts).
249249
WithIsArtifactUploaded(artifactUploaded)
250250
err := helper.SendCDEvent(commonWorkflowRequest, event)

ci-runner/helper/EventHelper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ type CdStageCompleteEvent struct {
449449
PluginArtifactStage string `json:"pluginArtifactStage"`
450450
PluginArtifacts *PluginArtifacts `json:"pluginArtifacts"`
451451
IsArtifactUploaded bool `json:"isArtifactUploaded"`
452-
IsSuccess bool `json:"isSuccess"`
452+
IsFailed bool `json:"isFailed"` //new flag as isFailed for backward compatibility
453453
}
454454

455455
func (event *CdStageCompleteEvent) WithPluginArtifacts(pluginArtifacts *PluginArtifacts) *CdStageCompleteEvent {

ci-runner/helper/adaptor/CiStageAdaptor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func NewCiCompleteEvent(ciRequest *helper.CommonWorkflowRequest) *helper.CiCompl
2323
return event
2424
}
2525

26-
func NewCdCompleteEvent(cdRequest *helper.CommonWorkflowRequest, isSuccess bool) *helper.CdStageCompleteEvent {
26+
func NewCdCompleteEvent(cdRequest *helper.CommonWorkflowRequest, isFailed bool) *helper.CdStageCompleteEvent {
2727
event := &helper.CdStageCompleteEvent{
2828
CiProjectDetails: cdRequest.CiProjectDetails,
2929
CdPipelineId: cdRequest.CdPipelineId,
@@ -33,7 +33,7 @@ func NewCdCompleteEvent(cdRequest *helper.CommonWorkflowRequest, isSuccess bool)
3333
TriggeredBy: cdRequest.TriggeredBy,
3434
PluginRegistryArtifactDetails: cdRequest.RegistryDestinationImageMap,
3535
PluginArtifactStage: cdRequest.PluginArtifactStage,
36-
IsSuccess: isSuccess,
36+
IsFailed: isFailed,
3737
}
3838
return event
3939
}

0 commit comments

Comments
 (0)