cbuildbot: Allow commandline override of the CQ gerrit query.

In the process, remove GerritHelper.GrabChangesReadyForCommit,
moving bits to appropriate places, moving involved tests to the
appropriate place (primarily moving _FilterNonCrosProjects testing
out of unrelated gerrit_helper_unittest, into validation_pool_unittest),
and fixing outstanding pylint complaints/issues while I'm in there.

Note: _FilterNonCrosProjects unittest was overhauled to cover the
various edgecases, and _FilterNonCrosProjects itself was simplified
in light of current Manifest class api.

BUG=None
TEST=cbuildbot --remote --debug mario-paladin --buildbot -g 27778
TEST=cbuildbot --remote --debug mario-paladin --buildbot -g 27778 \
     --bootstrap-args="--cq-gerrit-query 'is:open AND -project:chromiumos/chromite'"

Change-Id: I535f0ed1de47de9d929f9fe5fafe600bd61a6553
Reviewed-on: https://gerrit.chromium.org/gerrit/27778
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index f1487cc..eb331f5 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -887,6 +887,14 @@
   group.add_remote_option('--version', dest='force_version', default=None,
                           help='Used with manifest logic.  Forces use of this '
                                'version rather than create or get latest.')
+  group.add_remote_option('--cq-gerrit-query', dest='cq_gerrit_override',
+                          default=None,
+                          help=
+      "If given, this gerrit query will be used to find what patches to test, "
+      "rather than the normal 'CommitReady=2 AND Verified=1 AND CodeReview=2' "
+      "query it defaults to.  Use with care- note additionally this setting "
+      "only has an effect if the buildbot target is a cq target, and we're "
+      "in buildbot mode.")
 
   parser.add_option_group(group)