Skip to content

Commit db7796a

Browse files
Merge pull request #499 from zakisk/add-missing-status-in-stash
fix: Added Missing Statuses for Commit Build Status in Bitbucket Server (Stash)
2 parents cfa3f80 + 8160e49 commit db7796a

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

scm/driver/stash/repo.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,14 @@ func convertFromState(from scm.State) string {
580580
return "INPROGRESS"
581581
case scm.StateSuccess:
582582
return "SUCCESSFUL"
583-
default:
583+
case scm.StateFailure:
584584
return "FAILED"
585+
case scm.StateCanceled:
586+
return "CANCELLED"
587+
case scm.StateUnknown:
588+
return "UNKNOWN"
589+
default:
590+
return "UNKNOWN"
585591
}
586592
}
587593

scm/driver/stash/repo_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,11 @@ func TestConvertFromState(t *testing.T) {
564564
}{
565565
{
566566
src: scm.StateCanceled,
567-
dst: "FAILED",
567+
dst: "CANCELLED",
568568
},
569569
{
570570
src: scm.StateError,
571-
dst: "FAILED",
571+
dst: "UNKNOWN",
572572
},
573573
{
574574
src: scm.StateFailure,
@@ -588,7 +588,7 @@ func TestConvertFromState(t *testing.T) {
588588
},
589589
{
590590
src: scm.StateUnknown,
591-
dst: "FAILED",
591+
dst: "UNKNOWN",
592592
},
593593
}
594594
for _, test := range tests {

0 commit comments

Comments
 (0)