From 1f8570eb2de6051a733d86ece8d127099fa25992 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 7 Mar 2023 16:07:35 +0100 Subject: dashboard: support obsolete KernelRepo entries There are cases when a previously fuzzed tree was obsoleted and can no longer be polled for commits. At the same time, we still want to display short repo aliases in bug reportings and on the dashboard. --- dashboard/app/api.go | 3 +++ dashboard/app/app_test.go | 6 ++++++ dashboard/app/config.go | 3 +++ 3 files changed, 12 insertions(+) diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 9451d2dc9..95150fd9e 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -231,6 +231,9 @@ func apiCommitPoll(c context.Context, ns string, r *http.Request, payload []byte ReportEmail: reportEmail(c, ns), } for _, repo := range config.Namespaces[ns].Repos { + if repo.Obsolete { + continue + } resp.Repos = append(resp.Repos, dashapi.Repo{ URL: repo.URL, Branch: repo.Branch, diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go index cd14f9d32..f772ceab7 100644 --- a/dashboard/app/app_test.go +++ b/dashboard/app/app_test.go @@ -82,6 +82,12 @@ var testConfig = &GlobalConfig{ Maintainers: []string{"maintainers@repo10.org", "bugs@repo10.org"}, }, }, + { + URL: "git://github.com/google/syzkaller", + Branch: "old_master", + Alias: "repo10alias", + Obsolete: true, + }, }, Managers: map[string]ConfigManager{ "special-obsoleting": { diff --git a/dashboard/app/config.go b/dashboard/app/config.go index 60b511238..f9623c6a8 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -194,6 +194,9 @@ type KernelRepo struct { ReportingPriority int // CC for all bugs reported on this repo. CC CCConfig + // This repository is no longer active and should not be polled for commits. + // It will only be used to display kernel aliases for older crashes. + Obsolete bool } type CCConfig struct { -- cgit mrf-deployment