gitea/templates
Lunny Xiao 6d0b24064a
Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562)
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.
2025-06-09 04:05:33 +00:00
..
admin Fix autofocus behavior (#34397) 2025-05-08 18:26:18 +00:00
api/packages/pypi Fix links in PyPI Simple Repository API page (#30594) 2024-04-20 01:15:14 +00:00
base Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
custom Add footer extra links template (#9576) 2020-01-03 20:41:56 +02:00
devtest markup: improve code block readability and isolate copy button (#34009) 2025-04-19 05:53:39 +00:00
explore Fix span svg layout (#34185) 2025-04-13 12:44:57 +08:00
mail Remove unnecessary SanitizeHTML from code (#29575) 2024-03-04 12:02:45 +00:00
org Misc CSS fixes (#34638) 2025-06-07 19:57:07 +02:00
package refactor organization menu (#33928) 2025-04-10 12:12:55 -07:00
projects Add fullscreen mode as a more efficient operation way to view projects (#34081) 2025-04-23 13:42:22 +08:00
repo Misc CSS fixes (#34638) 2025-06-07 19:57:07 +02:00
shared Add endpoint deleting workflow run (#34337) 2025-05-13 19:18:13 +00:00
status Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
swagger Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +00:00
user Refactor commit message rendering and fix bugs (#34412) 2025-05-09 20:42:35 +08:00
webhook Fix incorrect tailwind migration (#30007) 2024-03-22 20:51:29 +01:00
home.tmpl Misc CSS fixes (#34638) 2025-06-07 19:57:07 +02:00
install.tmpl Fix various trivial frontend problems (#34263) 2025-04-24 09:11:54 +08:00
post-install.tmpl Fix various trivial frontend problems (#34263) 2025-04-24 09:11:54 +08:00