mirror of https://github.com/go-gitea/gitea.git
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 | ||
| activitypub.go | ||
| admin_user.go | ||
| attachment.go | ||
| cron.go | ||
| doc.go | ||
| fork.go | ||
| git_blob.go | ||
| git_hook.go | ||
| hook.go | ||
| issue.go | ||
| issue_comment.go | ||
| issue_label.go | ||
| issue_milestone.go | ||
| issue_reaction.go | ||
| issue_stopwatch.go | ||
| issue_test.go | ||
| issue_tracked_time.go | ||
| lfs_lock.go | ||
| mirror.go | ||
| miscellaneous.go | ||
| nodeinfo.go | ||
| notifications.go | ||
| org.go | ||
| org_member.go | ||
| org_team.go | ||
| package.go | ||
| pull.go | ||
| pull_review.go | ||
| release.go | ||
| repo.go | ||
| repo_actions.go | ||
| repo_branch.go | ||
| repo_collaborator.go | ||
| repo_commit.go | ||
| repo_compare.go | ||
| repo_file.go | ||
| repo_key.go | ||
| repo_note.go | ||
| repo_refs.go | ||
| repo_tag.go | ||
| repo_topic.go | ||
| repo_tree.go | ||
| repo_watch.go | ||
| repo_wiki.go | ||
| secret.go | ||
| settings.go | ||
| status.go | ||
| task.go | ||
| user.go | ||
| user_app.go | ||
| user_email.go | ||
| user_gpgkey.go | ||
| user_key.go | ||
| variable.go | ||
| visible_type.go | ||