Skip to content

Commit

Permalink
feat(bitrise): support new 'artifact_prefix' task config
Browse files Browse the repository at this point in the history
  • Loading branch information
ahal committed Apr 11, 2024
1 parent ea2fd03 commit 59bef3e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/mozilla_taskgraph/worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"tag", description="The tag of the commit running the build."
): str,
},
Optional(
"artifact_prefix",
description="Directory prefix to store artifacts. Set this to 'public' "
"to create public artifacts.",
): str,
},
Extra: object,
},
Expand Down Expand Up @@ -129,7 +134,9 @@ def normref(ref, type="heads"):
"branch_dest_repo_owner", config.params["base_repository"]
)

task_def["payload"] = {"build_params": build_params}
payload = task_def["payload"] = {"build_params": build_params}
if bitrise.get("artifact_prefix"):
payload["artifact_prefix"] = bitrise["artifact_prefix"]


@payload_builder(
Expand Down
26 changes: 26 additions & 0 deletions test/test_worker_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,32 @@
},
id="environments",
),
pytest.param(
{
"bitrise": {
"artifact_prefix": "public",
"app": "some-app",
"workflows": ["bar"],
}
},
{},
{
"payload": {
"artifact_prefix": "public",
"build_params": {
"branch": "default",
"branch_repo_owner": "http://example.com/head/repo",
"commit_hash": "abcdef",
},
},
"scopes": [
"foo:bitrise:app:some-app",
"foo:bitrise:workflow:bar",
],
"tags": {"worker-implementation": "scriptworker"},
},
id="artifact prefix",
),
),
)
def test_build_bitrise_payload(
Expand Down

0 comments on commit 59bef3e

Please sign in to comment.