diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-04-28 15:32:19 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-04-28 15:40:58 +0200 |
| commit | 62df2017e3b1edd786a4c737bd4ccba2b4581d88 (patch) | |
| tree | d309eb267c71f74e53d1a1f8d0c4de47320be0c6 | |
| parent | 80365ff31e13ba44fc0c5f39e38707d543ce9d8c (diff) | |
dashboard: allow duplicate tree origin labels
It's okay if several kernel repos specify the same labels. Only check
that a single label is not used for different things.
| -rw-r--r-- | dashboard/app/config.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/dashboard/app/config.go b/dashboard/app/config.go index 3e26c9464..ed258569a 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -483,8 +483,8 @@ func checkKernelRepos(ns string, config *Config, repos []KernelRepo) { if len(repos) == 0 { panic(fmt.Sprintf("no repos in namespace %q", ns)) } + introduced, reached := map[string]bool{}, map[string]bool{} aliasMap := map[string]bool{} - labelMap := map[string]bool{} canBeLabels := false for _, repo := range repos { if !vcs.CheckRepoAddress(repo.URL) { @@ -504,18 +504,21 @@ func checkKernelRepos(ns string, config *Config, repos []KernelRepo) { panic(fmt.Sprintf("%v: bad kernel repo reporting priority %v for %q", ns, prio, repo.Alias)) } checkCC(&repo.CC) - for _, label := range []string{repo.LabelIntroduced, repo.LabelReached} { - if label == "" { - continue + if repo.LabelIntroduced != "" { + introduced[repo.LabelIntroduced] = true + if reached[repo.LabelIntroduced] { + panic(fmt.Sprintf("%v: label %s is used for both introduced and reached", ns, repo.LabelIntroduced)) } - if labelMap[label] { - panic(fmt.Sprintf("%v: duplicate label %q", ns, label)) + } + if repo.LabelReached != "" { + reached[repo.LabelReached] = true + if introduced[repo.LabelReached] { + panic(fmt.Sprintf("%v: label %s is used for both introduced and reached", ns, repo.LabelReached)) } - labelMap[label] = true } canBeLabels = canBeLabels || repo.DetectMissingBackports } - if len(labelMap) > 0 { + if len(introduced)+len(reached) > 0 { canBeLabels = true } if canBeLabels && !config.FindBugOriginTrees { |
