From 24f5a642af3aa1627bbff977f0a101907a02c69f Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 9 Dec 2021 13:49:16 +0300 Subject: gerrit: Use a Gerrit label instead of hashtag for autosubmit This moves to using a Gerrit label ('Autosubmit') with boolean values for determining whether a developer wants to have a change automatically submitted. See also https://cl.tvl.fyi/c/depot/+/4172 --- submitqueue/runner.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'submitqueue') diff --git a/submitqueue/runner.go b/submitqueue/runner.go index 0d8bcce2e1f2..6e4a54a71bb9 100644 --- a/submitqueue/runner.go +++ b/submitqueue/runner.go @@ -20,26 +20,24 @@ type Runner struct { wipSerie *gerrit.Serie logger *log.Logger gerrit *gerrit.Client - submitQueueTag string // the tag used to submit something to the submit queue } // NewRunner creates a new Runner struct -func NewRunner(logger *log.Logger, gerrit *gerrit.Client, submitQueueTag string) *Runner { +func NewRunner(logger *log.Logger, gerrit *gerrit.Client) *Runner { return &Runner{ - logger: logger, - gerrit: gerrit, - submitQueueTag: submitQueueTag, + logger: logger, + gerrit: gerrit, } } // isAutoSubmittable determines if something could be autosubmitted, potentially requiring a rebase // for this, it needs to: -// * have the auto-submit label +// * have the "Autosubmit" label set to +1 // * have gerrit's 'submittable' field set to true // it doesn't check if the series is rebased on HEAD func (r *Runner) isAutoSubmittable(s *gerrit.Serie) bool { for _, c := range s.ChangeSets { - if c.Submittable != true || !c.HasTag(r.submitQueueTag) { + if c.Submittable != true || !c.IsAutosubmit() { return false } } -- cgit 1.4.1