mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00: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:
		@@ -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:
 | 
			
		||||
 
 | 
			
		||||
@@ -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},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user