-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VPN-6098: Create a 'mark-as-shipped' task for Shipit integration
This task makes a call to the Shipit API to update the release's status to "shipped" once all other release tasks have successfully completed. Issue: #8945
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
--- | ||
loader: taskgraph.loader.transform:loader | ||
|
||
transforms: | ||
- taskgraph.transforms.from_deps | ||
- mozillavpn_taskgraph.transforms.set_name | ||
- mozilla_taskgraph.transforms.scriptworker.shipit.mark_as_shipped | ||
- taskgraph.transforms.task | ||
|
||
kind-dependencies: | ||
- beetmover-ship | ||
|
||
tasks: | ||
mark-as-shipped: | ||
worker-type: shipit | ||
from-deps: | ||
group-by: | ||
attribute: shipping-phase | ||
copy-attributes: true | ||
unique-kinds: false | ||
set-name: false | ||
shipit-product: | ||
by-build-type: | ||
addons/opt: mozilla-vpn-addons | ||
default: mozilla-vpn-client | ||
run-on-tasks-for: [action] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from taskgraph.transforms.base import TransformSequence | ||
from taskgraph.util.dependencies import get_primary_dependency | ||
|
||
|
||
transforms = TransformSequence() | ||
|
||
|
||
@transforms.add | ||
def set_name(config, tasks): | ||
for task in tasks: | ||
if config.kind == "mark-as-shipped": | ||
dep = get_primary_dependency(config, task) | ||
assert dep | ||
|
||
product = ( | ||
"addons" if dep.attributes["build-type"] == "addons/opt" else "client" | ||
) | ||
task["name"] = f"mark-as-shipped-{product}" | ||
|
||
yield task |