Bug 1252235 - Make try syntax available to mozharness from TaskCluster through an environment variable. r=armenzg

MozReview-Commit-ID: HIVIXPQXnQs

--HG--
extra : rebase_source : aa6ed39fdaa5bec568fabc562319f3a2ed4f4c47
This commit is contained in:
Chris Manchester 2016-08-29 16:33:24 -07:00
parent 619c0c8afb
commit 2c2a464982
3 changed files with 8 additions and 2 deletions

View File

@ -104,7 +104,7 @@ tasks:
--pushlog-id='{{pushlog_id}}'
--pushdate='{{pushdate}}'
--project='{{project}}'
--message='{{comment}}'
--message={{#shellquote}}{{{comment}}}{{/shellquote}}
--owner='{{owner}}'
--level='{{level}}'
--base-repository='https://hg.mozilla.org/mozilla-central'

View File

@ -174,6 +174,9 @@ def docker_worker_setup(config, test, taskdesc):
if 'actions' in mozharness:
env['MOZHARNESS_ACTIONS'] = ' '.join(mozharness['actions'])
if config.params['project'] == 'try':
env['TRY_COMMIT_MSG'] = config.params['message']
# handle some of the mozharness-specific options
if mozharness['tooltool-downloads']:

View File

@ -78,6 +78,8 @@ class TryToolsMixin(TransferMixin):
msg = None
if "try_message" in self.config and self.config["try_message"]:
msg = self.config["try_message"]
elif 'TRY_COMMIT_MSG' in os.environ:
msg = os.environ['TRY_COMMIT_MSG']
elif self._is_try():
if self.buildbot_config['sourcestamp']['changes']:
msg = self.buildbot_config['sourcestamp']['changes'][-1]['comments']
@ -154,7 +156,8 @@ class TryToolsMixin(TransferMixin):
repo_path = None
if self.buildbot_config and 'properties' in self.buildbot_config:
repo_path = self.buildbot_config['properties'].get('branch')
return self.config.get('branch', repo_path) == 'try'
return (self.config.get('branch', repo_path) == 'try' or
'TRY_COMMIT_MSG' in os.environ)
@PostScriptAction('download-and-extract')
def set_extra_try_arguments(self, action, success=None):