Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/mozilla_taskgraph/worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ def build_lando_payload(config, task, task_def):
if worker.get("force-dry-run"):
task_def["payload"]["dry_run"] = True

bump_files: list[str] = []
for action in worker["actions"]:
if info := action.get("android-l10n-import"):
android_l10n_import_info = dash_to_underscore(info)
Expand Down Expand Up @@ -384,6 +385,7 @@ def build_lando_payload(config, task, task_def):
bump_info = {}
bump_info["next_version"] = release_config["next_version"]
bump_info["files"] = info["bump-files"]
bump_files = info["bump-files"]
task_def["payload"]["version_bump_info"] = bump_info
actions.append("version_bump")

Expand Down Expand Up @@ -423,7 +425,13 @@ def build_lando_payload(config, task, task_def):

scopes = set(task_def.get("scopes", []))
scopes.add(f"project:releng:lando:repo:{worker['lando-repo']}")
scopes.update([f"project:releng:lando:action:{action}" for action in actions])
scopes.update(
f"project:releng:lando:action:{a}" for a in actions if a != "version_bump"
)
if "version_bump" in actions:
scopes.update(
f"project:releng:lando:action:version_bump:file:{f}" for f in bump_files
)

for matrix_room in worker.get("matrix-rooms", []):
task_def.setdefault("routes", [])
Expand Down
3 changes: 2 additions & 1 deletion test/test_worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ def test_lando_version_bump(build_payload):
},
},
"scopes": [
"project:releng:lando:action:version_bump",
"project:releng:lando:action:version_bump:file:another/file.txt",
"project:releng:lando:action:version_bump:file:foo/bar/a.txt",
"project:releng:lando:repo:testrepo",
],
"tags": {"worker-implementation": "scriptworker"},
Expand Down