summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-10-09 00:16:06 +0200
committerGitHub <noreply@github.com>2023-10-08 22:16:06 +0000
commit5bf367f90415c178669f4c0d7a9c9b9fbbcd601d (patch)
treed8ca8def51bf1ad7471302b722a95221d4ef3cae /models
parent0c2a3f4cdcc18f5b00b043a50d8f947e11cf604d (diff)
downloadgitea-5bf367f90415c178669f4c0d7a9c9b9fbbcd601d.tar.gz
gitea-5bf367f90415c178669f4c0d7a9c9b9fbbcd601d.zip
Restore warning commit status (#27504)
Partial revert of https://github.com/go-gitea/gitea/pull/25839. This commit status is used by a number of external integrations, so I think we should not remove it (See https://github.com/go-gitea/gitea/pull/25839#issuecomment-1729002077). This is a rare case where an existing migration needed to be alterted to avoid data loss. --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'models')
-rw-r--r--models/git/commit_status_test.go4
-rw-r--r--models/migrations/v1_21/v266.go3
2 files changed, 4 insertions, 3 deletions
diff --git a/models/git/commit_status_test.go b/models/git/commit_status_test.go
index a86941a0fe..2197433b3e 100644
--- a/models/git/commit_status_test.go
+++ b/models/git/commit_status_test.go
@@ -31,6 +31,10 @@ func TestGetCommitStatuses(t *testing.T) {
assert.Equal(t, structs.CommitStatusPending, statuses[0].State)
assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[0].APIURL(db.DefaultContext))
+ assert.Equal(t, "cov/awesomeness", statuses[1].Context)
+ assert.Equal(t, structs.CommitStatusWarning, statuses[1].State)
+ assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[1].APIURL(db.DefaultContext))
+
assert.Equal(t, "cov/awesomeness", statuses[2].Context)
assert.Equal(t, structs.CommitStatusSuccess, statuses[2].State)
assert.Equal(t, "https://try.gitea.io/api/v1/repos/user2/repo1/statuses/1234123412341234123412341234123412341234", statuses[2].APIURL(db.DefaultContext))
diff --git a/models/migrations/v1_21/v266.go b/models/migrations/v1_21/v266.go
index df85286c89..79a5f5e14c 100644
--- a/models/migrations/v1_21/v266.go
+++ b/models/migrations/v1_21/v266.go
@@ -18,9 +18,6 @@ func ReduceCommitStatus(x *xorm.Engine) error {
if _, err := sess.Exec(`UPDATE commit_status SET state='pending' WHERE state='running'`); err != nil {
return err
}
- if _, err := sess.Exec(`UPDATE commit_status SET state='failure' WHERE state='warning'`); err != nil {
- return err
- }
return sess.Commit()
}