cbuildbot: Improve argument handling schedule scheduling paygen tryjobs.
When scheduling payloads tryjobs, there are a couple of odd behaviors.
1) We don't normally add a CL # as part of the job, so there is no need
to warn that no CL # was specified.
2) If --channel isn't used, the job will run, but do nothing useful. We
should expect a --channel argument when scheduling a payloads build.
So.... now we do these things.
BUG=chromium:357734
TEST=Ran existing tests + schduled paygen runs manually.
Change-Id: Ia49c86ce06e5d8956716f6c13d64732f2ad3f004
Reviewed-on: https://chromium-review.googlesource.com/200304
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index e28ebaf..67ac550 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -1372,7 +1372,8 @@
if options.local:
cros_build_lib.Die('Cannot specify both --remote and --local')
- if not options.buildbot and not patches:
+ # options.channels is a convenient way to detect payloads builds.
+ if not options.buildbot and not options.channels and not patches:
prompt = ('No patches were provided; are you sure you want to just '
'run a remote build of %s?' % (
options.branch if options.branch else 'ToT'))
@@ -1529,10 +1530,16 @@
cros_build_lib.Error('No such configuraton target: "%s".', arg)
continue
- if options.channels and build_config.build_type != constants.PAYLOADS_TYPE:
+ is_payloads_build = build_config.build_type == constants.PAYLOADS_TYPE
+
+ if options.channels and not is_payloads_build:
cros_build_lib.Die('--channel must only be used with a payload config,'
' not target (%s).' % arg)
+ if not options.channels and is_payloads_build:
+ cros_build_lib.Die('payload configs (%s) require --channel to do anything'
+ ' useful.' % arg)
+
# The --version option is not compatible with an external target unless the
# --buildbot option is specified. More correctly, only "paladin versions"
# will work with external targets, and those are only used with --buildbot.