From ad27d963f2d9bbe7876077b849af2d8bc2f9959d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 25 Nov 2019 17:42:58 +0100 Subject: [PATCH] submitqueue: remove updateHEAD function This is already done during the Run() function --- frontend/frontend.go | 14 -------------- submitqueue/submitqueue.go | 10 ---------- 2 files changed, 24 deletions(-) diff --git a/frontend/frontend.go b/frontend/frontend.go index 46cd59f78..1f6e74452 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -1,7 +1,6 @@ package frontend import ( - "fmt" "io/ioutil" "net/http" @@ -61,23 +60,10 @@ func MakeFrontend(runner *submitqueue.Runner) *Frontend { router.SetHTMLTemplate(tmpl) router.GET("/submit-queue.json", func(c *gin.Context) { - - // FIXME: do this periodically - err := submitQueue.UpdateHEAD() - if err != nil { - c.AbortWithError(http.StatusBadGateway, fmt.Errorf("unable to update HEAD")) - } c.JSON(http.StatusOK, submitQueue) }) router.GET("/", func(c *gin.Context) { - // FIXME: do this periodically - - err := submitQueue.UpdateHEAD() - if err != nil { - c.AbortWithError(http.StatusBadGateway, fmt.Errorf("unable to update HEAD")) - } - c.HTML(http.StatusOK, "submit-queue.tmpl.html", gin.H{ "series": submitQueue.Series, "projectName": submitQueue.ProjectName, diff --git a/submitqueue/submitqueue.go b/submitqueue/submitqueue.go index 0b6114343..2676e237d 100644 --- a/submitqueue/submitqueue.go +++ b/submitqueue/submitqueue.go @@ -53,16 +53,6 @@ func (s *SubmitQueue) LoadSeries(log *logrus.Logger) error { return nil } -// UpdateHEAD updates the HEAD field with the commit ID of the current HEAD -func (s *SubmitQueue) UpdateHEAD() error { - HEAD, err := s.gerrit.GetHEAD(s.ProjectName, s.BranchName) - if err != nil { - return err - } - s.HEAD = HEAD - return nil -} - // TODO: clear submit queue tag if missing +1/+2? // IsAutoSubmittable returns true if a given Serie has all the necessary flags set