summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/issue_label_test.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-10 16:44:02 +0800
committerGitHub <noreply@github.com>2023-04-10 16:44:02 +0800
commit4e3348135723dfc03dcc91b196b5da6f20b8a4ea (patch)
tree8734e1d537d93243dd6ba478b9f2890cc8ac0d89 /routers/web/repo/issue_label_test.go
parentbb6c670cff1a081d9f5f8bdb3dc91abe5d9e35b9 (diff)
downloadgitea-4e3348135723dfc03dcc91b196b5da6f20b8a4ea.tar.gz
gitea-4e3348135723dfc03dcc91b196b5da6f20b8a4ea.zip
Make label templates have consistent behavior and priority (#23749)
Fix https://github.com/go-gitea/gitea/issues/23715 Other related PRs: * #23717 * #23716 * #23719 This PR is different from others, it tries to resolve the problem fundamentally (and brings more benefits) Although it looks like some more lines are added, actually many new lines are for tests. ---- Before, the code was just "guessing" the file type and try to parse them. <details> ![image](https://user-images.githubusercontent.com/2114189/228002245-57d58e27-1078-4da9-bf42-5bc0b264c6ce.png) </details> This PR: * Always remember the original option file names, and always use correct parser for them. * Another benefit is that we can sort the Label Templates now (before there was a map, its key order is undefined) ![image](https://user-images.githubusercontent.com/2114189/228002432-931b9f18-3908-484b-a36b-04760c9ad132.png)
Diffstat (limited to 'routers/web/repo/issue_label_test.go')
-rw-r--r--routers/web/repo/issue_label_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/issue_label_test.go b/routers/web/repo/issue_label_test.go
index a62d2afaa8..c24fe898b6 100644
--- a/routers/web/repo/issue_label_test.go
+++ b/routers/web/repo/issue_label_test.go
@@ -10,6 +10,7 @@ import (
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/unittest"
+ "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/test"
"code.gitea.io/gitea/modules/web"
"code.gitea.io/gitea/services/forms"
@@ -30,6 +31,7 @@ func int64SliceToCommaSeparated(a []int64) string {
func TestInitializeLabels(t *testing.T) {
unittest.PrepareTestEnv(t)
+ assert.NoError(t, repository.LoadRepoConfig())
ctx := test.MockContext(t, "user2/repo1/labels/initialize")
test.LoadUser(t, ctx, 2)
test.LoadRepo(t, ctx, 2)