0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-07-19 10:41:01 +02:00

Fix job status aggregation logic (#35000)

For a run (assume 2 jobs) that has a failed job and a waiting job, the
run status should be waiting, **as the run is not done yet.**

Related #34823
This commit is contained in:
NorthRealm 2025-07-18 02:12:02 +08:00 committed by GitHub
parent 8ee96039aa
commit 39f145ae72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -187,10 +187,10 @@ func AggregateJobStatus(jobs []*ActionRunJob) Status {
return StatusCancelled
case hasRunning:
return StatusRunning
case hasFailure:
return StatusFailure
case hasWaiting:
return StatusWaiting
case hasFailure:
return StatusFailure
case hasBlocked:
return StatusBlocked
default:

View File

@ -64,7 +64,7 @@ func TestAggregateJobStatus(t *testing.T) {
{[]Status{StatusFailure, StatusSuccess}, StatusFailure},
{[]Status{StatusFailure, StatusSkipped}, StatusFailure},
{[]Status{StatusFailure, StatusCancelled}, StatusCancelled},
{[]Status{StatusFailure, StatusWaiting}, StatusFailure},
{[]Status{StatusFailure, StatusWaiting}, StatusWaiting},
{[]Status{StatusFailure, StatusRunning}, StatusRunning},
{[]Status{StatusFailure, StatusBlocked}, StatusFailure},