diff options
author | Vincent Ambo <mail@tazj.in> | 2021-12-09T10·49+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-12-09T10·49+0300 |
commit | 24f5a642af3aa1627bbff977f0a101907a02c69f (patch) | |
tree | f1c0a6607ec9fdcdf03091fe5fbc5dabc5536a47 /submitqueue/runner.go | |
parent | c67b3ba7ea769cd747ea2f43ee6d12943d599ae0 (diff) |
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
Diffstat (limited to 'submitqueue/runner.go')
-rw-r--r-- | submitqueue/runner.go | 12 |
1 files changed, 5 insertions, 7 deletions
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 } } |