Update Combine method to treat warnings as failures and adjust tests#37048
Update Combine method to treat warnings as failures and adjust tests#37048silverwind merged 8 commits intogo-gitea:mainfrom
Conversation
…ethod and adjust corresponding tests
|
@silverwind is your e2e test flaky or did I destroy smth? I don't get it |
|
https://github.com/go-gitea/gitea/actions/runs/23770856049/job/69261752202 looks like a timing issue, yeah not your fault. |
There was a problem hiding this comment.
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 treatwarningasfailure. - 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
successafter 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 warning ⇒ failure. |
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>
#37053 shoul fix it. |
|
Does this fix #37042? If yes, add a reference in the PR description. |
|
Will this be backported to 1.25? |
|
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. |
…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>
…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>
* 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
* 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)
* 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
Treat Commit Status Warnings as errors
#37042 (comment)
fixes #37042