Skip to content

Commit

Permalink
VPN-6098: Create a 'mark-as-shipped' task for Shipit integration
Browse files Browse the repository at this point in the history
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
ahal committed May 15, 2024
1 parent 61a5fc4 commit c2f788a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
8 changes: 8 additions & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ workers:
implementation: beetmover-import-from-gcs-to-artifact-registry
os: scriptworker
worker-type: 'mozillavpn-{level}-beetmover'
shipit:
provisioner: scriptworker-k8s
implementation: scriptworker-shipit
os: scriptworker
worker-type: 'mozillavpn-{level}-shipit'
succeed:
provisioner: built-in
implementation: succeed
Expand All @@ -126,3 +131,6 @@ release-promotion:
- fetch
- toolchain
- toolchain-openssl

shipit:
scope-prefix: project:mozillavpn:releng:ship-it
29 changes: 29 additions & 0 deletions taskcluster/kinds/mark-as-shipped/kind.yml
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]
20 changes: 20 additions & 0 deletions taskcluster/mozillavpn_taskgraph/transforms/set_name.py
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

0 comments on commit c2f788a

Please sign in to comment.