about summary refs log tree commit diff
path: root/submitqueue/serie.go
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-11-18T16·52+0100
committerFlorian Klink <flokli@flokli.de>2019-11-18T18·26+0100
commit08b969ea0b011374e0160bebde9bba3f3a621bd1 (patch)
treebca62cb5fe3cd7e07662d6d3fdd74c5cc3646021 /submitqueue/serie.go
parentc117dcf1af80bbd1ff4440b19fcb91df05bd191a (diff)
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.
Diffstat (limited to 'submitqueue/serie.go')
-rw-r--r--submitqueue/serie.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/submitqueue/serie.go b/submitqueue/serie.go
index b2cf4ef01c55..d4cd739cdfdd 100644
--- a/submitqueue/serie.go
+++ b/submitqueue/serie.go
@@ -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)))