Skip to content

Update Combine method to treat warnings as failures and adjust tests#37048

Merged
silverwind merged 8 commits intogo-gitea:mainfrom
bircni:fix/treat-warning-as-failure
Mar 31, 2026
Merged

Update Combine method to treat warnings as failures and adjust tests#37048
silverwind merged 8 commits intogo-gitea:mainfrom
bircni:fix/treat-warning-as-failure

Conversation

@bircni
Copy link
Copy Markdown
Member

@bircni bircni commented Mar 30, 2026

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".

#37042 (comment)

fixes #37042

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 30, 2026
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 30, 2026
@bircni
Copy link
Copy Markdown
Member Author

bircni commented Mar 30, 2026

@silverwind is your e2e test flaky or did I destroy smth? I don't get it

@silverwind
Copy link
Copy Markdown
Member

https://github.com/go-gitea/gitea/actions/runs/23770856049/job/69261752202 looks like a timing issue, yeah not your fault.

@bircni bircni marked this pull request as ready for review March 31, 2026 11:58
@silverwind silverwind requested a review from Copilot March 31, 2026 12:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores Gitea’s pre-1.25 behavior for combined commit statuses by treating warning as a merge-blocking failure, addressing required-check workflows where upstream systems map test failures to “warning”.

Changes:

  • Update CommitStatusStates.Combine() to treat warning as failure.
  • Adjust unit tests for commit-status combining and commit-status calculation to match the new semantics.
  • Update an integration test sequence so the final stored summary state remains success after iterating through states.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
modules/commitstatus/commit_status.go Changes combined-status logic so warning now yields failure.
modules/commitstatus/commit_status_test.go Updates Combine() expectations to reflect warningfailure.
models/git/commit_status_test.go Updates CalcCommitStatus expectation when a warning is present.
tests/integration/pull_status_test.go Reorders status updates so the final combined summary remains success after iterating through warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Nicolas <bircni@icloud.com>
@silverwind
Copy link
Copy Markdown
Member

https://github.com/go-gitea/gitea/actions/runs/23770856049/job/69261752202 looks like a timing issue, yeah not your fault.

#37053 shoul fix it.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 31, 2026
@silverwind
Copy link
Copy Markdown
Member

Does this fix #37042? If yes, add a reference in the PR description.

@bircni bircni requested a review from wxiaoguang March 31, 2026 13:34
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 31, 2026
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 31, 2026
@silverwind silverwind enabled auto-merge (squash) March 31, 2026 15:59
@silverwind silverwind merged commit 4747dd6 into go-gitea:main Mar 31, 2026
26 checks passed
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 31, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 31, 2026
@jpraet
Copy link
Copy Markdown
Member

jpraet commented Apr 1, 2026

Will this be backported to 1.25?

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Apr 1, 2026

1.26 is very close, but I guess if someone wants to backport, do it. Could instruct Copilot to do it in case of merge conflict.

@jpraet jpraet added the backport/v1.25 This PR should be backported to Gitea 1.25 label Apr 1, 2026
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Apr 1, 2026
…o-gitea#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".**


go-gitea#37042 (comment)

fixes go-gitea#37042

---------

Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Apr 1, 2026
@bircni bircni deleted the fix/treat-warning-as-failure branch April 1, 2026 18:18
lunny pushed a commit that referenced this pull request Apr 1, 2026
…37048) (#37075)

Backport #37048 by @bircni

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".**

#37042 (comment)

fixes #37042

Signed-off-by: Nicolas <bircni@icloud.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 1, 2026
* origin/main:
  Update JS dependencies and misc tweaks (go-gitea#37064)
  Redirect to the only OAuth2 provider when no other login methods and fix various problems (go-gitea#36901)
  Show workflow link (go-gitea#37070)
  Remove leftover `webpackChunkName` comments from codeeditor (go-gitea#37062)
  Update Go dependencies (go-gitea#36781)
  Add webhook name field to improve webhook identification (go-gitea#37025) (go-gitea#37040)
  Upgrade `go-git` to v5.17.2 (go-gitea#37060)
  Replace Monaco with CodeMirror (go-gitea#36764)
  Update Combine method to treat warnings as failures and adjust tests (go-gitea#37048)
  Raise minimum Node.js version to 22.18.0 (go-gitea#37058)
  Update golangci-lint to v2.11.4 (go-gitea#37059)
  Upgrade `golang.org/x/image` to v0.38.0 (go-gitea#37054)

# Conflicts:
#	web_src/css/themes/theme-gitea-dark.css
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 2, 2026
* main:
  Fix NuGet package upload error handling (go-gitea#37074)
  Desaturate dark theme background colors (go-gitea#37056)
  Update JS dependencies and misc tweaks (go-gitea#37064)
  Redirect to the only OAuth2 provider when no other login methods and fix various problems (go-gitea#36901)
  Show workflow link (go-gitea#37070)
  Remove leftover `webpackChunkName` comments from codeeditor (go-gitea#37062)
  Update Go dependencies (go-gitea#36781)
  Add webhook name field to improve webhook identification (go-gitea#37025) (go-gitea#37040)
  Upgrade `go-git` to v5.17.2 (go-gitea#37060)
  Replace Monaco with CodeMirror (go-gitea#36764)
  Update Combine method to treat warnings as failures and adjust tests (go-gitea#37048)
  Raise minimum Node.js version to 22.18.0 (go-gitea#37058)
  Update golangci-lint to v2.11.4 (go-gitea#37059)
  Upgrade `golang.org/x/image` to v0.38.0 (go-gitea#37054)
  Increase e2e test timeouts on CI to fix flaky tests (go-gitea#37053)
  Refactor "org teams" page and help new users to "add member" to an org (go-gitea#37051)
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 2, 2026
* origin/main: (192 commits)
  Fix NuGet package upload error handling (go-gitea#37074)
  Desaturate dark theme background colors (go-gitea#37056)
  Update JS dependencies and misc tweaks (go-gitea#37064)
  Redirect to the only OAuth2 provider when no other login methods and fix various problems (go-gitea#36901)
  Show workflow link (go-gitea#37070)
  Remove leftover `webpackChunkName` comments from codeeditor (go-gitea#37062)
  Update Go dependencies (go-gitea#36781)
  Add webhook name field to improve webhook identification (go-gitea#37025) (go-gitea#37040)
  Upgrade `go-git` to v5.17.2 (go-gitea#37060)
  Replace Monaco with CodeMirror (go-gitea#36764)
  Update Combine method to treat warnings as failures and adjust tests (go-gitea#37048)
  Raise minimum Node.js version to 22.18.0 (go-gitea#37058)
  Update golangci-lint to v2.11.4 (go-gitea#37059)
  Upgrade `golang.org/x/image` to v0.38.0 (go-gitea#37054)
  Increase e2e test timeouts on CI to fix flaky tests (go-gitea#37053)
  Refactor "org teams" page and help new users to "add member" to an org (go-gitea#37051)
  Refactor issue sidebar and fix various problems (go-gitea#37045)
  Add tests for pull request's content_version in API (go-gitea#37044)
  Enable concurrent vitest execution (go-gitea#36998)
  Fix theme discovery and Vite dev server in dev mode (go-gitea#37033)
  ...

# Conflicts:
#	templates/user/dashboard/feeds.tmpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/done All backports for this PR have been created backport/v1.25 This PR should be backported to Gitea 1.25 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Required check with status warning no longer blocks PR merging

6 participants