From 4e5820c0c41b0c979471b66497f055f5631dfd65 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 29 Dec 2025 13:07:53 +0100 Subject: dashboard/app: wire more admin handlers Make it possible 3 more admin handlers that look useful for future and safe. Now that we don't deploy the app from local machines, it's problematic to call them without this wiring. Remove one old handler that we don't need anymore. --- dashboard/app/admin.go | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'dashboard/app/admin.go') diff --git a/dashboard/app/admin.go b/dashboard/app/admin.go index 9ff871776..14fd7c2dc 100644 --- a/dashboard/app/admin.go +++ b/dashboard/app/admin.go @@ -226,33 +226,6 @@ func updateBugReporting(c context.Context, w http.ResponseWriter, r *http.Reques }) } -// updateBugTitles adds missing MergedTitles/AltTitles to bugs. -// This can be used to migrate datastore to the new scheme introduced: -// by commit fd1036219797 ("dashboard/app: merge duplicate crashes"). -func updateBugTitles(c context.Context, w http.ResponseWriter, r *http.Request) error { - if accessLevel(c, r) != AccessAdmin { - return fmt.Errorf("admin only") - } - var keys []*db.Key - if err := foreachBug(c, nil, func(bug *Bug, key *db.Key) error { - if len(bug.MergedTitles) == 0 || len(bug.AltTitles) == 0 { - keys = append(keys, key) - } - return nil - }); err != nil { - return err - } - log.Warningf(c, "fetched %v bugs for update", len(keys)) - return updateBatch(c, keys, func(_ *db.Key, bug *Bug) { - if len(bug.MergedTitles) == 0 { - bug.MergedTitles = []string{bug.Title} - } - if len(bug.AltTitles) == 0 { - bug.AltTitles = []string{bug.Title} - } - }) -} - // updateCrashPriorities regenerates priorities for crashes. // This has become necessary after the "dashboard: support per-Manager priority" commit. // For now, the method only considers the crashes referenced from bug origin. @@ -406,10 +379,6 @@ func updateBatch[T any](c context.Context, keys []*db.Key, transform func(key *d // Prevent warnings about dead code. var ( _ = dropNamespace - _ = updateBugReporting - _ = updateBugTitles - _ = restartFailedBisections - _ = setMissingBugFields _ = adminSendEmail _ = updateHeadReproLevel _ = updateCrashPriorities -- cgit mrf-deployment