submitqueue: remove updateHEAD function

This is already done during the Run() function
This commit is contained in:
Florian Klink 2019-11-25 17:42:58 +01:00
parent 266c27d1d0
commit ad27d963f2
2 changed files with 0 additions and 24 deletions

View file

@ -1,7 +1,6 @@
package frontend package frontend
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
@ -61,23 +60,10 @@ func MakeFrontend(runner *submitqueue.Runner) *Frontend {
router.SetHTMLTemplate(tmpl) router.SetHTMLTemplate(tmpl)
router.GET("/submit-queue.json", func(c *gin.Context) { 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) c.JSON(http.StatusOK, submitQueue)
}) })
router.GET("/", func(c *gin.Context) { 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{ c.HTML(http.StatusOK, "submit-queue.tmpl.html", gin.H{
"series": submitQueue.Series, "series": submitQueue.Series,
"projectName": submitQueue.ProjectName, "projectName": submitQueue.ProjectName,

View file

@ -53,16 +53,6 @@ func (s *SubmitQueue) LoadSeries(log *logrus.Logger) error {
return nil 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? // TODO: clear submit queue tag if missing +1/+2?
// IsAutoSubmittable returns true if a given Serie has all the necessary flags set // IsAutoSubmittable returns true if a given Serie has all the necessary flags set