diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2022-08-19 15:13:44 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2022-08-26 12:33:44 +0200 |
| commit | ebc0eda4c9ebdc244a33d061b052517dbf663a47 (patch) | |
| tree | bb43b76d858cbcbc53ad31e50a70e62090aa7ec6 | |
| parent | 741e7a9558cea71b96d87fb280f68346da4937e4 (diff) | |
dashboard: enabe per-namespace configuration of repro retesting
| -rw-r--r-- | dashboard/app/api.go | 11 | ||||
| -rw-r--r-- | dashboard/app/app_test.go | 1 | ||||
| -rw-r--r-- | dashboard/app/config.go | 2 | ||||
| -rw-r--r-- | dashboard/app/jobs.go | 6 |
4 files changed, 16 insertions, 4 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go index 0683802ee..7beaa8d47 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -1452,8 +1452,13 @@ func checkClient(conf *GlobalConfig, name0, secretPassword, oauthSubject string) func handleRetestRepros(w http.ResponseWriter, r *http.Request) { c := appengine.NewContext(r) - err := updateRetestReproJobs(c) - if err != nil { - log.Errorf(c, "failed to update retest repro jobs: %v", err) + for ns, cfg := range config.Namespaces { + if !cfg.RetestRepros { + continue + } + err := updateRetestReproJobs(c, ns) + if err != nil { + log.Errorf(c, "failed to update retest repro jobs for %s: %v", ns, err) + } } } diff --git a/dashboard/app/app_test.go b/dashboard/app/app_test.go index 4c1fd32ad..7d49b1575 100644 --- a/dashboard/app/app_test.go +++ b/dashboard/app/app_test.go @@ -178,6 +178,7 @@ var testConfig = &GlobalConfig{ }, }, }, + RetestRepros: true, }, // Namespaces for access level testing. "access-admin": { diff --git a/dashboard/app/config.go b/dashboard/app/config.go index a82890547..52a98beb4 100644 --- a/dashboard/app/config.go +++ b/dashboard/app/config.go @@ -82,6 +82,8 @@ type Config struct { WaitForRepro time.Duration // If set, successful fix bisections will auto-close the bug. FixBisectionAutoClose bool + // If set, dashboard will periodically request repros and revoke no longer working ones. + RetestRepros bool // Managers contains some special additional info about syz-manager instances. Managers map[string]ConfigManager // Reporting config. diff --git a/dashboard/app/jobs.go b/dashboard/app/jobs.go index d67b3cc55..2a2a241f0 100644 --- a/dashboard/app/jobs.go +++ b/dashboard/app/jobs.go @@ -248,7 +248,7 @@ func getNextJob(c context.Context, managers map[string]dashapi.ManagerJobs) (*Jo } // Ensure that for each manager there's one pending retest repro job. -func updateRetestReproJobs(c context.Context) error { +func updateRetestReproJobs(c context.Context, ns string) error { if config.Obsoleting.ReproRetestPeriod == 0 { return nil } @@ -270,6 +270,7 @@ func updateRetestReproJobs(c context.Context) error { maxLastTime := now.Add(-config.Obsoleting.ReproRetestPeriod) bugs, keys, err := loadAllBugs(c, func(query *db.Query) *db.Query { return query.Filter("Status=", BugStatusOpen). + Filter("Namespace=", ns). Filter("LastTime<", maxLastTime) }) if err != nil { @@ -590,6 +591,9 @@ func handleRetestedRepro(c context.Context, now time.Time, job *Job, jobKey *db. if err := db.Get(c, bugKey, bug); err != nil { return fmt.Errorf("failed to get bug: %v", bugKey) } + if !config.Namespaces[bug.Namespace].RetestRepros { + return nil + } // Update the crash. crash.LastReproRetest = now if len(allTitles) == 0 { |
