diff --git a/.taskcluster.yml b/.taskcluster.yml index 10887004d..b3734e417 100644 --- a/.taskcluster.yml +++ b/.taskcluster.yml @@ -99,6 +99,7 @@ tasks: MOBILE_HEAD_REV: ${head_rev} MOBILE_TRIGGERED_BY: ${user} SCHEDULER_ID: ${scheduler_id} + SHORT_HEAD_BRANCH: ${short_head_branch} TASK_ID: ${decision_task_id} TASKS_PRIORITY: ${tasks_priority} TRUST_LEVEL: ${trust_level} diff --git a/automation/taskcluster/decision_task.py b/automation/taskcluster/decision_task.py index 4a0c81c36..70b98443d 100644 --- a/automation/taskcluster/decision_task.py +++ b/automation/taskcluster/decision_task.py @@ -31,6 +31,7 @@ BUILDER = TaskBuilder( task_id=os.environ.get('TASK_ID'), repo_url=REPO_URL, git_ref=os.environ.get('MOBILE_HEAD_BRANCH'), + short_head_branch=os.environ.get('SHORT_HEAD_BRANCH'), commit=COMMIT, owner="fenix-eng-notifications@mozilla.com", source='{}/raw/{}/.taskcluster.yml'.format(REPO_URL, COMMIT), diff --git a/automation/taskcluster/lib/tasks.py b/automation/taskcluster/lib/tasks.py index 783b6137c..c091ffe29 100644 --- a/automation/taskcluster/lib/tasks.py +++ b/automation/taskcluster/lib/tasks.py @@ -18,12 +18,23 @@ _OFFICIAL_REPO_URL = 'https://github.com/mozilla-mobile/fenix' class TaskBuilder(object): def __init__( - self, task_id, repo_url, git_ref, commit, owner, source, scheduler_id, date_string, - tasks_priority='lowest', trust_level=1 + self, + task_id, + repo_url, + git_ref, + short_head_branch, + commit, + owner, + source, + scheduler_id, + date_string, + tasks_priority='lowest', + trust_level=1 ): self.task_id = task_id self.repo_url = repo_url self.git_ref = git_ref + self.short_head_branch = short_head_branch self.commit = commit self.owner = owner self.source = source @@ -130,7 +141,7 @@ class TaskBuilder(object): def _craft_branch_routes(self, variant): routes = [] - if self.repo_url == _OFFICIAL_REPO_URL and self.git_ref == 'refs/heads/master': + if self.repo_url == _OFFICIAL_REPO_URL and self.short_head_branch == 'master': architecture, build_type, product = \ _get_architecture_and_build_type_and_product_from_variant(variant) product = convert_camel_case_into_kebab_case(product) @@ -138,17 +149,18 @@ class TaskBuilder(object): routes = [ 'index.project.mobile.fenix.branch.{}.revision.{}.{}.{}'.format( - self.git_ref, self.commit, product, postfix + self.short_head_branch, self.commit, product, postfix ), 'index.project.mobile.fenix.branch.{}.latest.{}.{}'.format( - self.git_ref, product, postfix + self.short_head_branch, product, postfix ), 'index.project.mobile.fenix.branch.{}.pushdate.{}.{}.{}.revision.{}.{}.{}'.format( - self.git_ref, self.date.year, self.date.month, self.date.day, self.commit, - product, postfix + self.short_head_branch, self.date.year, self.date.month, self.date.day, + self.commit, product, postfix ), 'index.project.mobile.fenix.branch.{}.pushdate.{}.{}.{}.latest.{}.{}'.format( - self.git_ref. self.date.year, self.date.month, self.date.day, product, postfix + self.short_head_branch. self.date.year, self.date.month, self.date.day, + product, postfix ), ] return routes