Skip to content
Draft
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
1 change: 1 addition & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ try:
release-promotion:
products:
- 'devedition'
- 'enterprise-firefox'
- 'fennec'
- 'firefox'
- 'firefox-android'
Expand Down
31 changes: 23 additions & 8 deletions taskcluster/gecko_taskgraph/actions/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from types import FunctionType

from mozbuild.util import memoize
from mozilla_repo_urls import parse
from taskgraph import create
from taskgraph.config import load_graph_config
from taskgraph.parameters import Parameters
Expand Down Expand Up @@ -168,13 +169,17 @@ def action_builder(parameters, graph_config, decision_task_id):
return None

# gather up the common decision-task-supplied data for this action
repo_param = "{}head_repository".format(
base_repo_param = "{}base_repository".format(
graph_config["project-repo-param-prefix"]
)
head_repo_param = "{}head_repository".format(
graph_config["project-repo-param-prefix"]
)
repository = {
"url": parameters[repo_param],
"url": parameters[head_repo_param],
"project": parameters["project"],
"level": parameters["level"],
"base_url": parameters[base_repo_param],
}

revision = parameters[
Expand Down Expand Up @@ -236,10 +241,15 @@ def action_builder(parameters, graph_config, decision_task_id):
if "/" in permission:
raise Exception("`/` is not allowed in action names; use `-`")

if parameters["tasks_for"].startswith("github-pull-request"):
hookId = f"in-tree-pr-action-{level}-{permission}/{tcyml_hash}"
else:
hookId = f"in-tree-action-{level}-{permission}/{tcyml_hash}"

rv.update({
"kind": "hook",
"hookGroupId": f"project-{trustDomain}",
"hookId": f"in-tree-action-{level}-{permission}/{tcyml_hash}",
"hookId": hookId,
"hookPayload": {
# provide the decision-task parameters as context for triggerHook
"decision": {
Expand Down Expand Up @@ -312,15 +322,20 @@ def sanity_check_task_scope(callback, parameters, graph_config):
else:
raise Exception(f"No action with cb_name {callback}")

repo_param = "{}head_repository".format(graph_config["project-repo-param-prefix"])
head_repository = parameters[repo_param]
expected_scope = f"assume:repo:{head_repository[8:]}:action:{action.permission}"
base_repo_param = "{}base_repository".format(graph_config["project-repo-param-prefix"])
parsed_base_url = parse(parameters[base_repo_param])
head_repo_param = "{}head_repository".format(graph_config["project-repo-param-prefix"])
parsed_head_url = parse(parameters[head_repo_param])
action_scope = f"assume:{parsed_head_url.taskcluster_role_prefix}:action:{action.permission}"
pr_action_scope = f"assume:{parsed_base_url.taskcluster_role_prefix}:pr-action:{action.permission}"

# the scope should appear literally; no need for a satisfaction check. The use of
# get_current_scopes here calls the auth service through the Taskcluster Proxy, giving
# the precise scopes available to this task.
if expected_scope not in taskcluster.get_current_scopes():
raise Exception(f"Expected task scope {expected_scope} for this action")
if not set((action_scope, pr_action_scope)) & set(taskcluster.get_current_scopes()):
raise ValueError(
f"Expected task scope {action_scope} or {pr_action_scope} for this action"
)


def trigger_action_callback(
Expand Down
3 changes: 3 additions & 0 deletions taskcluster/gecko_taskgraph/target_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@ def filter(task):
):
return False

if task.attributes.get("shipping_product") not in (None, "enterprise-firefox"):
return False

build_platform = task.attributes.get("build_platform")
build_type = task.attributes.get("build_type")
shippable = task.attributes.get("shippable", False)
Expand Down
22 changes: 16 additions & 6 deletions taskcluster/gecko_taskgraph/util/taskgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,30 @@
Tools for interacting with existing taskgraphs.
"""

from taskcluster import TaskclusterRestFailure
from taskgraph.util.taskcluster import find_task_id, get_artifact


def find_decision_task(parameters, graph_config):
"""Given the parameters for this action, find the taskId of the decision
task"""
head_rev_param = "{}head_rev".format(graph_config["project-repo-param-prefix"])
return find_task_id(
"{}.v2.{}.revision.{}.taskgraph.decision".format(
graph_config["trust-domain"],
parameters["project"],
parameters[head_rev_param],
try:
return find_task_id(
"{}.v2.{}.revision.{}.taskgraph.decision".format(
graph_config["trust-domain"],
parameters["project"],
parameters[head_rev_param],
)
)
except TaskclusterRestFailure:
return find_task_id(
"{}.v2.{}-pr.revision.{}.taskgraph.decision".format(
graph_config["trust-domain"],
parameters["project"],
parameters[head_rev_param],
)
)
)


def find_existing_tasks(previous_graph_ids):
Expand Down
5 changes: 2 additions & 3 deletions taskcluster/kinds/build/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ linux64-enterprise-shippable/opt:
enable-build-signing: true
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
shipping-product: enterprise-firefox
treeherder:
platform: linux64-enterprise-shippable/opt
symbol: Bpgo(Bent)
Expand Down Expand Up @@ -114,7 +114,6 @@ linux64-enterprise/opt:
attributes:
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
treeherder:
platform: linux64-enterprise/opt
symbol: Bent
Expand Down Expand Up @@ -1875,7 +1874,7 @@ linux64-aarch64-enterprise-shippable/opt:
enable-full-crashsymbols: true
skip-verify-test-packaging: true
shipping-phase: build
shipping-product: firefox
shipping-product: enterprise-firefox
treeherder:
platform: linux64-aarch64-enterprise-shippable/opt
symbol: Bpgo(Bent)
Expand Down
3 changes: 1 addition & 2 deletions taskcluster/kinds/build/macosx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ macosx64-enterprise-shippable/opt:
enable-build-signing: true
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
shipping-product: enterprise-firefox
treeherder:
platform: osx-cross-enterprise-shippable/opt
symbol: Bpgo(Bent)
Expand Down Expand Up @@ -256,7 +256,6 @@ macosx64-enterprise/opt:
enable-build-signing: true
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
treeherder:
platform: osx-cross-enterprise/opt
symbol: Bent
Expand Down
3 changes: 1 addition & 2 deletions taskcluster/kinds/build/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ win64-enterprise-shippable/opt:
enable-build-signing: true
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
shipping-product: enterprise-firefox
treeherder:
platform: windows2012-64-enterprise-shippable/opt
symbol: Bpgo(Bent)
Expand Down Expand Up @@ -541,7 +541,6 @@ win64-enterprise/opt:
enable-build-signing: true
enable-full-crashsymbols: true
shipping-phase: build
shipping-product: firefox
treeherder:
platform: windows2012-64-enterprise/opt
symbol: Bent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ tasks:
from-deps:
group-by: partner-repack-ids
copy-attributes: true
shipping-product: firefox
shipping-product: enterprise-firefox
# TODO: shipping-phase: promote
copy-repack-ids: true
2 changes: 1 addition & 1 deletion taskcluster/kinds/enterprise-repack-mac-signing/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ tasks:
enterprise-repack-mac-signing:
from-deps:
group-by: partner-repack-ids
shipping-product: firefox
shipping-product: enterprise-firefox
# TODO: shipping-phase: promote
repacks-per-chunk: 1
2 changes: 1 addition & 1 deletion taskcluster/kinds/enterprise-repack/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ task-defaults:
in-tree: "partner-repack"
chain-of-trust: true
max-run-time: 7200
shipping-product: firefox
shipping-product: enterprise-firefox
shipping-phase: build
run:
using: mozharness
Expand Down