gitea/modules
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
..
actions Add "View workflow file" to Actions list page (#34538) 2025-05-28 20:30:00 +08:00
activitypub Enable tenv and testifylint rules (#32852) 2024-12-15 10:41:29 +00:00
analyze Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
assetfs Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
auth Refactor some tests (#34580) 2025-06-03 01:26:19 +00:00
avatar Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
badge Add flat-square action badge style (#34062) 2025-04-01 09:42:10 +00:00
base Add material icons for file list (#33837) 2025-03-10 15:57:17 +08:00
cache Add cache for common package queries (#22491) 2025-04-13 09:40:36 +00:00
cachegroup Cache GPG keys, emails and users when list commits (#34086) 2025-04-09 16:34:38 +00:00
charset Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
commitstatus Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +00:00
container
csv Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
dump Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
emoji Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
eventsource Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
fileicon support the open-icon of folder (#34168) 2025-04-28 19:51:32 -07:00
generate
git Fix some trivial problems (#34579) 2025-06-02 15:22:43 +00:00
gitrepo Refactor Branch struct in package modules/git (#33980) 2025-04-02 17:31:32 +00:00
globallock Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
graceful Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
gtprof enable staticcheck QFxxxx rules (#34064) 2025-03-29 17:32:28 -04:00
hcaptcha
highlight Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
hostmatcher
htmlutil Refactor HTMLFormat, update chroma render, fix js error (#33136) 2025-01-08 03:44:32 +00:00
httpcache Refactor cache-control (#33861) 2025-03-13 07:04:50 +08:00
httplib Make public URL generation configurable (#34250) 2025-04-22 06:49:37 +08:00
indexer Refactor some tests (#34580) 2025-06-03 01:26:19 +00:00
issue/template Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
json Fix some migration and repo name problems (#33986) 2025-03-24 20:26:58 -07:00
label Validate hex colors when creating/editing labels (#34623) 2025-06-07 11:25:08 +03:00
lfs Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
lfstransfer Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
log Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
markup Valid email address should only start with alphanumeric (#28174) 2025-04-20 19:18:14 +08:00
mcaptcha
metrics feat: add label 'state' to metric 'gitea_users' (#34326) 2025-05-07 18:00:53 +00:00
migration remove context from retry downloader (#33871) 2025-03-14 00:28:57 +00:00
nosql Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
optional Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
options
packages Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
paginator Only use prev and next buttons for pagination on user dashboard (#33981) 2025-03-23 19:52:43 +00:00
pprof
private Fix a bug when uploading file via lfs ssh command (#34408) 2025-05-09 16:17:08 +00:00
process Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
proxy
proxyprotocol Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
public Refactor cache-control (#33861) 2025-03-13 07:04:50 +08:00
queue Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
recaptcha
references Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
regexplru Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
repository Performance optimization for tags synchronization (#34355) 2025-05-22 13:54:42 -07:00
reqctx Add material icons for file list (#33837) 2025-03-10 15:57:17 +08:00
secret Upgrade golangci-lint to v1.64.5 (#33654) 2025-02-21 00:05:40 +08:00
session Enforce two-factor auth (2FA: TOTP or WebAuthn) (#34187) 2025-04-28 15:31:59 -07:00
setting Refactor some tests (#34580) 2025-06-03 01:26:19 +00:00
sitemap
ssh Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
storage Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
structs Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +00:00
svg Add sub issue list support (#32940) 2024-12-24 01:54:19 +00:00
sync
system Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
tailmsg Support performance trace (#32973) 2025-01-21 18:57:07 +00:00
tempdir Uniform all temporary directories and allow customizing temp path (#32352) 2025-04-08 16:15:28 +00:00
templates Remove legacy template helper functions (#34426) 2025-05-11 01:42:21 -04:00
test Validate hex colors when creating/editing labels (#34623) 2025-06-07 11:25:08 +03:00
testlogger Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
timeutil
translation Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
turnstile
typesniffer
updatechecker Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
uri
user Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
util Fix possible panic (#34508) 2025-05-22 12:59:42 +00:00
validation Refactor some tests (#34580) 2025-06-03 01:26:19 +00:00
web Fix some trivial problems (#34579) 2025-06-02 15:22:43 +00:00
webhook Add workflow_job webhook (#33694) 2025-03-11 10:40:38 -07:00
zstd