Skip to content

Commit

Permalink
fix: Move bitrise build parameters under a 'build_params' namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ahal committed Mar 28, 2024
1 parent 9a37d80 commit 1df4932
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/mozilla_taskgraph/worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
)
def build_bitrise_payload(config, task, task_def):
bitrise = task["worker"]["bitrise"]
build_params = task_def["payload"] = bitrise.get("build_params") or {}
build_params = bitrise.get("build_params") or {}
task_def["tags"]["worker-implementation"] = "scriptworker"

scope_prefix = config.graph_config["scriptworker"]["scope-prefix"]
Expand Down Expand Up @@ -104,6 +104,8 @@ def build_bitrise_payload(config, task, task_def):
"branch_dest_repo_owner", config.params["base_repository"]
)

task_def["payload"] = {"build_params": build_params}


@payload_builder(
"scriptworker-shipit",
Expand Down
32 changes: 19 additions & 13 deletions test/test_worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
{},
{
"payload": {
"branch": "default",
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
"build_params": {
"branch": "default",
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
},
},
"scopes": [
"foo:bitrise:app:some-app",
Expand All @@ -39,12 +41,14 @@
{"tasks_for": "github-pull-request"},
{
"payload": {
"branch": "default",
"branch_dest": "123456",
"branch_dest_repo_owner": "http://example.com/base/repo",
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
"pull_request_author": "some-owner",
"build_params": {
"branch": "default",
"branch_dest": "123456",
"branch_dest_repo_owner": "http://example.com/base/repo",
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
"pull_request_author": "some-owner",
},
},
"scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
"tags": {"worker-implementation": "scriptworker"},
Expand All @@ -62,10 +66,12 @@
},
{
"payload": {
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
"pull_request_author": "some-owner",
"tag": "some-tag",
"build_params": {
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
"pull_request_author": "some-owner",
"tag": "some-tag",
}
},
"scopes": ["foo:bitrise:app:some-app", "foo:bitrise:workflow:bar"],
"tags": {"worker-implementation": "scriptworker"},
Expand Down

0 comments on commit 1df4932

Please sign in to comment.