Commit Graph

4 Commits

Author SHA1 Message Date
Mitrahsoft
d4101fda0c enhance: support running and unknown commit status states (#40396)
External CI can report any commit status state, but only the six known
states rendered an icon, so `running` or something like `stage-1` showed
nothing. `running` is now an official state rendered with the same
spinner as Actions, and any other state gets a fallback icon. The
combined status still treats both as pending.

A state longer than the 7-character column (e.g. `in_progress`) caused a
500. It now returns 422, as does an empty state. Widening the column
instead would need a migration, happy to do that in a follow-up if
preferred.

| Before | After |
| --- | --- |
| <img width="1904" height="654" alt="before"
src="https://github.com/user-attachments/assets/811c6a4e-7b5a-4919-8d86-ec586d9f9bfb"
/> | <img width="1919" height="675" alt="after"
src="https://github.com/user-attachments/assets/a088c70d-47fe-40c5-93f7-43d1bacfa77e"
/>|

Fixes: https://github.com/go-gitea/gitea/issues/39608
2026-11-19 11:28:12 +00:00
silverwind
8abda62312 test: consolidate Go tests (#39962)
Consolidate all Go tests. Coverage is identical to before. Go tests are
around 5% faster while being 7% smaller. No non-test code is touched.
2026-10-24 13:48:19 +00:00
Nicolas
4747dd68bd Update Combine method to treat warnings as failures and adjust tests (#37048)
Treat Commit Status Warnings as errors

> The root problem is that the definition of "warning" are different
across systems.
> 
> * Sometimes, "warning" is treated as "acceptable" (Gitea 1.25)
> * Sometimes, "warning" is mapped from "Result.UNSTABLE", which means
"there are test failures" and it is "failure" in Gitea
> 
> **To avoid breaking existing users, the best choice is to revert the
behavior on Gitea side: treat "warning" as "error".**


https://github.com/go-gitea/gitea/issues/37042#issuecomment-4158231611

fixes https://github.com/go-gitea/gitea/issues/37042

---------

Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-03-31 17:22:18 +00:00
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