mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1524358 - get commit message locally, rather than from task parameters r=tomprince
Differential Revision: https://phabricator.services.mozilla.com/D18288 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
0a44f01f62
commit
c8fe0990f8
@ -13,7 +13,7 @@
|
||||
# - cron tasks - See taskcluster/taskgraph/cron/decision.py
|
||||
# {
|
||||
# tasks_for: 'cron',
|
||||
# push: {revision, pushlog_id, pushdate, owner, comment}
|
||||
# push: {revision, pushlog_id, pushdate, owner}
|
||||
# repository: {url, project, level},
|
||||
# cron: {task_id, job_name, job_symbol, quoted_args},
|
||||
# now,
|
||||
@ -191,7 +191,6 @@ tasks:
|
||||
GECKO_HEAD_REPOSITORY: '${repoUrl}'
|
||||
GECKO_HEAD_REF: '${push.revision}'
|
||||
GECKO_HEAD_REV: '${push.revision}'
|
||||
GECKO_COMMIT_MSG: {$if: 'tasks_for != "action"', then: '${push.comment}'}
|
||||
HG_STORE_PATH: /builds/worker/checkouts/hg-store
|
||||
TASKCLUSTER_CACHES: /builds/worker/checkouts
|
||||
# someday, these will be provided by the worker - Bug 1492664
|
||||
@ -240,7 +239,6 @@ tasks:
|
||||
--pushlog-id='${push.pushlog_id}'
|
||||
--pushdate='${push.pushdate}'
|
||||
--project='${repository.project}'
|
||||
--message="$GECKO_COMMIT_MSG"
|
||||
--owner='${ownerEmail}'
|
||||
--level='${repository.level}'
|
||||
--base-repository="$GECKO_BASE_REPOSITORY"
|
||||
|
@ -149,9 +149,6 @@ class MachCommands(MachCommandBase):
|
||||
@CommandArgument('--comm-head-rev',
|
||||
required=False,
|
||||
help='Commit revision to use from head comm-* repository')
|
||||
@CommandArgument('--message',
|
||||
required=True,
|
||||
help='Commit message to be parsed. Example: "try: -b do -p all -u all"')
|
||||
@CommandArgument('--project',
|
||||
required=True,
|
||||
help='Project to use for creating task graph. Example: --project=try')
|
||||
|
@ -59,7 +59,6 @@ def make_decision_task(params, root, symbol, arguments=[]):
|
||||
'pushlog_id': push_info['pushid'],
|
||||
'pushdate': push_info['pushdate'],
|
||||
'owner': 'cron',
|
||||
'comment': '',
|
||||
},
|
||||
'cron': {
|
||||
'task_id': os.environ.get('TASK_ID', '<cron task id>'),
|
||||
|
@ -20,7 +20,7 @@ from .parameters import Parameters, get_version, get_app_version
|
||||
from .taskgraph import TaskGraph
|
||||
from .try_option_syntax import parse_message
|
||||
from .util.schema import validate_schema, Schema
|
||||
from taskgraph.util.hg import get_hg_revision_branch
|
||||
from taskgraph.util.hg import get_hg_revision_branch, get_hg_commit_message
|
||||
from taskgraph.util.partials import populate_release_history
|
||||
from taskgraph.util.yaml import load_yaml
|
||||
from voluptuous import Required, Optional
|
||||
@ -193,7 +193,6 @@ def get_decision_parameters(config, options):
|
||||
'head_repository',
|
||||
'head_rev',
|
||||
'head_ref',
|
||||
'message',
|
||||
'project',
|
||||
'pushlog_id',
|
||||
'pushdate',
|
||||
@ -222,6 +221,7 @@ def get_decision_parameters(config, options):
|
||||
parameters['build_number'] = 1
|
||||
parameters['version'] = get_version(product_dir)
|
||||
parameters['app_version'] = get_app_version(product_dir)
|
||||
parameters['message'] = get_hg_commit_message(GECKO)
|
||||
parameters['hg_branch'] = get_hg_revision_branch(GECKO, revision=parameters['head_rev'])
|
||||
parameters['next_version'] = None
|
||||
parameters['release_type'] = ''
|
||||
|
@ -87,8 +87,9 @@ class TestGetDecisionParameters(unittest.TestCase):
|
||||
self.assertEqual(params['owner'], 'ffxbld@noreply.mozilla.org')
|
||||
|
||||
@patch('taskgraph.decision.get_hg_revision_branch')
|
||||
def test_try_options(self, _):
|
||||
self.options['message'] = 'try: -b do -t all'
|
||||
@patch('taskgraph.decision.get_hg_commit_message')
|
||||
def test_try_options(self, mock_get_hg_commit_message, _):
|
||||
mock_get_hg_commit_message.return_value = 'try: -b do -t all'
|
||||
self.options['project'] = 'try'
|
||||
with MockedOpen({self.ttc_file: None}):
|
||||
params = decision.get_decision_parameters(FAKE_GRAPH_CONFIG, self.options)
|
||||
|
@ -47,8 +47,12 @@ def get_hg_revision_branch(root, revision):
|
||||
], cwd=root)
|
||||
|
||||
|
||||
# For these functions, we assume that run-task has correctly checked out the
|
||||
# revision indicated by GECKO_HEAD_REF, so all that remains is to see what the
|
||||
# current revision is. Mercurial refers to that as `.`.
|
||||
def get_hg_commit_message(root):
|
||||
return subprocess.check_output(['hg', 'log', '-r', '.', '-T', '{desc}'], cwd=root)
|
||||
|
||||
|
||||
def calculate_head_rev(root):
|
||||
# we assume that run-task has correctly checked out the revision indicated by
|
||||
# GECKO_HEAD_REF, so all that remains is to see what the current revision is.
|
||||
# Mercurial refers to that as `.`.
|
||||
return subprocess.check_output(['hg', 'log', '-r', '.', '-T', '{node}'], cwd=root)
|
||||
|
Loading…
Reference in New Issue
Block a user