Skip to content

Commit

Permalink
Bug 1720974 - move balrog behavior to payload instead of scope. r=rel…
Browse files Browse the repository at this point in the history
…eng-reviewers,ahal,bhearsum DONTBUILD

Balrogscript already supports specifying the task behavior via
task.payload.behavior:
https://github.com/mozilla-releng/scriptworker-scripts/blob/6707ccf227e080d13e4a6e22f6df0f6ff69089a3/balrogscript/src/balrogscript/task.py#L27-L45

Let's make that the default, and deprecate using scopes.

Differential Revision: https://phabricator.services.mozilla.com/D120126
  • Loading branch information
escapewindow committed Jul 19, 2021
1 parent f1245b6 commit 4c1513a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
10 changes: 2 additions & 8 deletions taskcluster/taskgraph/transforms/scriptworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,12 @@

from __future__ import absolute_import, print_function, unicode_literals

from taskgraph.util.scriptworker import (
get_balrog_action_scope,
get_balrog_server_scope,
)
from taskgraph.util.scriptworker import get_balrog_server_scope


def add_balrog_scopes(config, jobs):
for job in jobs:
worker = job["worker"]

server_scope = get_balrog_server_scope(config)
action_scope = get_balrog_action_scope(config, action=worker["balrog-action"])
job["scopes"] = [server_scope, action_scope]
job["scopes"] = [server_scope]

yield job
26 changes: 17 additions & 9 deletions taskcluster/taskgraph/transforms/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,14 +1052,20 @@ def build_balrog_payload(config, task, task_def):
if "b" in release_config["version"]:
beta_number = release_config["version"].split("b")[-1]

task_def["payload"] = {
"behavior": worker["balrog-action"],
}

if (
worker["balrog-action"] == "submit-locale"
or worker["balrog-action"] == "v2-submit-locale"
):
task_def["payload"] = {
"upstreamArtifacts": worker["upstream-artifacts"],
"suffixes": worker["suffixes"],
}
task_def["payload"].update(
{
"upstreamArtifacts": worker["upstream-artifacts"],
"suffixes": worker["suffixes"],
}
)
else:
for prop in (
"archive-domain",
Expand All @@ -1081,11 +1087,13 @@ def build_balrog_payload(config, task, task_def):
"beta-number": beta_number,
}
)
task_def["payload"] = {
"build_number": release_config["build_number"],
"product": worker["product"],
"version": release_config["version"],
}
task_def["payload"].update(
{
"build_number": release_config["build_number"],
"product": worker["product"],
"version": release_config["version"],
}
)
for prop in (
"blob-suffix",
"complete-mar-filename-pattern",
Expand Down
6 changes: 0 additions & 6 deletions taskcluster/taskgraph/util/scriptworker.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,6 @@ def get_phase_from_target_method(config, alias_to_tasks_map, alias_to_phase_map)
return alias_to_phase_map["default"]


@with_scope_prefix
def get_balrog_action_scope(config, action="submit"):
assert action in BALROG_ACTIONS
return "balrog:action:{}".format(action)


get_signing_cert_scope = functools.partial(
get_scope_from_project,
alias_to_project_map=SIGNING_SCOPE_ALIAS_TO_PROJECT,
Expand Down

0 comments on commit 4c1513a

Please sign in to comment.