gitea/services/actions
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
..
auth.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
auth_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
cleanup.go Fix ephemeral runner deletion (#34447) 2025-05-20 15:42:31 +00:00
clear_tasks.go Add workflow_job webhook (#33694) 2025-03-11 10:40:38 -07:00
commit_status.go Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +00:00
context.go Fix possible panic (#34508) 2025-05-22 12:59:42 +00:00
context_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
init.go Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946) 2024-12-23 09:59:16 +00:00
init_test.go Move some Actions related functions from `routers` to `services` (#33280) 2025-01-15 21:34:30 +08:00
interface.go Actions Runner rest api (#33873) 2025-04-18 15:22:41 +00:00
job_emitter.go Add workflow_job webhook (#33694) 2025-03-11 10:40:38 -07:00
job_emitter_test.go Improve the handling of `jobs.<job_id>.if` (#31070) 2024-05-27 14:15:34 +08:00
notifier.go Refactor functions to reduce repopath expose (#33892) 2025-03-16 03:14:56 +00:00
notifier_helper.go Use run-name and evaluate workflow variables (#34301) 2025-05-20 02:24:10 +00:00
rerun.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
rerun_test.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
schedule_tasks.go Add workflow_job webhook (#33694) 2025-03-11 10:40:38 -07:00
task.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
variables.go Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
workflow.go Add "View workflow file" to Actions list page (#34538) 2025-05-28 20:30:00 +08:00