submitqueue: keep all series around

Introduce submitqueue.IsAutoSubmittable using a new
serie.FilterAllChangesets function, and skip over non-auto-submittable
series during rebase.

This allows better inspection on why other series are ignored by the
queue.
This commit is contained in:
Florian Klink 2019-11-18 17:52:34 +01:00
parent c117dcf1af
commit 08b969ea0b
2 changed files with 29 additions and 18 deletions

View file

@ -69,6 +69,17 @@ func (s *Serie) CheckIntegrity() error {
return nil
}
// FilterAllChangesets applies a filter function on all of the changesets in the series.
// returns true if it returns true for all changesets, false otherwise
func (s *Serie) FilterAllChangesets(f func(c *gerrit.Changeset) bool) bool {
for _, changeset := range s.ChangeSets {
if f(changeset) == false {
return false
}
}
return true
}
func (s *Serie) String() string {
var sb strings.Builder
sb.WriteString(fmt.Sprintf("Serie[%d]", len(s.ChangeSets)))