mirror of
https://github.com/go-gitea/gitea.git
synced 2025-12-15 21:45:35 +08:00
Extract from #34531 ## Move Commit status state to a standalone package Move the state from `structs` to `commitstatus` package. It also introduce `CommitStatusStates` so that the combine function could be used from UI and API logic. ## Combined commit status Changed This PR will follow Github's combined commit status. Before this PR, every commit status could be a combined one. According to https://docs.github.com/en/rest/commits/statuses?apiVersion=2022-11-28#get-the-combined-status-for-a-specific-reference > Additionally, a combined state is returned. The state is one of: > failure if any of the contexts report as error or failure > pending if there are no statuses or a context is pending > success if the latest status for all contexts is success This PR will follow that rule and remove the `NoBetterThan` logic. This also fixes the inconsistent between UI and API. In the API convert package, it has implemented this which is different from the UI. It also fixed the missing `URL` and `CommitURL` in the API. ## `CalcCommitStatus` return nil if there is no commit statuses The behavior of `CalcCommitStatus` is changed. If the parameter commit statuses is empty, it will return nil. The reference places should check the returned value themselves. |
||
|---|---|---|
| .. | ||
| activity.go | ||
| attachment.go | ||
| convert.go | ||
| git_commit_test.go | ||
| git_commit.go | ||
| issue_comment.go | ||
| issue_test.go | ||
| issue.go | ||
| main_test.go | ||
| mirror.go | ||
| notification.go | ||
| package.go | ||
| pull_review_test.go | ||
| pull_review.go | ||
| pull_test.go | ||
| pull.go | ||
| release_test.go | ||
| release.go | ||
| repository.go | ||
| secret.go | ||
| status.go | ||
| user_test.go | ||
| user.go | ||
| utils_test.go | ||
| utils.go | ||
| wiki.go | ||