Skip to content

Commit e6dc186

Browse files
committed
add comment for CalcCommitStatus
1 parent e9b8a15 commit e6dc186

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/git/commit_status.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ func (status *CommitStatus) HideActionsURL(ctx context.Context) {
230230

231231
// CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc
232232
func CalcCommitStatus(statuses []*CommitStatus) *CommitStatus {
233+
// This function is widely used, but it is not quite right.
234+
// The bad case is: if all commits are "skipped", GitHub will return "success" as the combined status.
235+
// But here Gitea just returns the first status, which is still "skipped" in this case.
236+
// Ideally it should return something like "CommitStatusSummary" with proper aggregated state.
233237
var lastStatus *CommitStatus
234238
state := api.CommitStatusSuccess
235239
for _, status := range statuses {

0 commit comments

Comments
 (0)