Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
escapewindow committed Jan 10, 2018
1 parent baa0cab commit 6ab5cd5
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions scriptworker/cot/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
log = logging.getLogger(__name__)


# XXX Remove all mach command hardcodes when all trees are 59+
DECISION_MACH_COMMANDS = ((
'./mach', 'taskgraph', 'decision'
), )
# XXX Remove all non- `action-callback` commands when we retire all trees <Fx58
ACTION_MACH_COMMANDS = ((
'./mach', 'taskgraph', 'add-tasks'
), (
Expand Down Expand Up @@ -548,14 +548,12 @@ def find_sorted_task_dependencies(task, task_name, task_id):

# bug 1396517 - Decision tasks are standalone; don't point at another task
# even if the taskGroupId doesn't match.
# XXX remove this workaround (now? once Fx59 reaches mozilla-release?)
# TODO
# XXX remove this workaround when all trees are 59+
task_type = guess_task_type(task_name, task)
if task_type in DECISION_TASK_TYPES:
parent_task_id = task_id
parent_task_type = 'decision'
else:
# TODO revisit this logic!
parent_task_id = get_parent_task_id(task) or get_decision_task_id(task)
parent_task_type = 'parent'
# make sure we deal with the decision task first, or we may populate
Expand Down Expand Up @@ -1190,7 +1188,7 @@ async def verify_parent_task_definition(chain, parent_link):
"pushlog_id": pushlog_id,
"pushdate": pushlog_info['pushes'][pushlog_id]['date'],
}
elif tasks_for == 'cron':
else:
jsone_context['cron'] = load_json_or_yaml(parent_link.task['extra']['cron'])
# I don't love these hardcodes.
jsone_context["push"] = {
Expand All @@ -1204,17 +1202,12 @@ async def verify_parent_task_definition(chain, parent_link):
log.debug(pprint.pformat(jsone_context))
rebuilt_definition = jsone.render(tmpl, jsone_context)
compare_definition = deepcopy(rebuilt_definition["tasks"][0])
# XXX ugly
# XXX remove this hack when treeherder rolls out json-e 2.5.0
# https://whatsdeployed.io/?owner=mozilla&repo=treeherder&name[]=Stage&url[]=https://treeherder.allizom.org/revision.txt&name[]=Prod&url[]=https://treeherder.mozilla.org/revision.txt
if tasks_for == 'action':
# TODO remove these two hacks when json-e is updated with
# https://github.com/taskcluster/json-e/pull/221
compare_definition['payload']['env']['ACTION_INPUT'] = parent_link.task['payload']['env']['ACTION_INPUT']
compare_definition['payload']['env']['ACTION_PARAMETERS'] = parent_link.task['payload']['env']['ACTION_PARAMETERS']
elif tasks_for == 'cron':
# TODO remove this hack when json-e is updated with
# https://github.com/taskcluster/json-e/pull/221
compare_definition['extra']['cron'] = parent_link.task['extra']['cron']
# TODO recursively remove-empty-key/value-pairs from copy of
# XXX recursively remove-empty-key/value-pairs from copy of
# parent_link.task before comparison? Or how else to fix?
if 'tags' not in compare_definition:
compare_definition['tags'] = {}
Expand Down

0 comments on commit 6ab5cd5

Please sign in to comment.