From f66f5a235e7d74c29b951316f73001126a056734 Mon Sep 17 00:00:00 2001
From: Justin Wood <Callek@gmail.com>
Date: Thu, 18 Jun 2020 19:57:20 +0000
Subject: [PATCH] Bug 1646588 - Add esr78 support. r=aki

Differential Revision: https://phabricator.services.mozilla.com/D79731
---
 .cron.yml                                     |  7 +++++
 taskcluster/ci/build/windows-mingw.yml        |  8 ++---
 taskcluster/ci/config.yml                     | 28 ++++++++++++++++-
 taskcluster/ci/cron-bouncer-check/kind.yml    |  2 +-
 taskcluster/ci/l10n-bump/kind.yml             |  2 +-
 .../ci/release-balrog-scheduling/kind.yml     |  2 ++
 .../ci/release-bouncer-aliases/kind.yml       |  1 +
 taskcluster/ci/release-bouncer-sub/kind.yml   |  1 +
 taskcluster/ci/release-snap-push/kind.yml     |  1 +
 .../kind.yml                                  |  4 +--
 .../ci/release-update-verify-config/kind.yml  |  1 +
 .../ci/release-update-verify-next/kind.yml    |  2 +-
 taskcluster/ci/repackage-l10n/kind.yml        |  2 +-
 taskcluster/ci/repackage/kind.yml             |  2 +-
 taskcluster/docs/parameters.rst               |  2 +-
 taskcluster/taskgraph/decision.py             |  5 ++++
 taskcluster/taskgraph/target_tasks.py         | 30 +++++++++++++++++++
 .../transforms/update_verify_config.py        |  4 +--
 taskcluster/taskgraph/util/attributes.py      |  1 +
 taskcluster/taskgraph/util/scriptworker.py    |  6 ++++
 20 files changed, 96 insertions(+), 15 deletions(-)

diff --git a/.cron.yml b/.cron.yml
index 28c846a79b791..39dae4a170a6a 100644
--- a/.cron.yml
+++ b/.cron.yml
@@ -141,6 +141,7 @@ jobs:
           - mozilla-beta
           - mozilla-release
           - mozilla-esr68
+          - mozilla-esr78
       when:
           - {hour: 10, minute: 0}
 
@@ -178,6 +179,7 @@ jobs:
           - mozilla-beta
           - mozilla-release
           - mozilla-esr68
+          - mozilla-esr78
       when:
           by-project:
               # No default branch
@@ -193,6 +195,9 @@ jobs:
               mozilla-esr68:
                   - {hour: 7, minute: 0}
                   - {hour: 19, minute: 0}
+              mozilla-esr78:
+                  - {hour: 7, minute: 0}
+                  - {hour: 19, minute: 0}
 
     - name: periodic-update
       job:
@@ -204,6 +209,7 @@ jobs:
           - mozilla-beta
           - mozilla-release
           - mozilla-esr68
+          - mozilla-esr78
       when:
           - {weekday: 'Monday', hour: 10, minute: 0}
           - {weekday: 'Thursday', hour: 10, minute: 0}
@@ -259,6 +265,7 @@ jobs:
           - mozilla-central
           - mozilla-beta
           - mozilla-esr68
+          # no mozilla-esr78
       when:
           - {minute: 45}
 
diff --git a/taskcluster/ci/build/windows-mingw.yml b/taskcluster/ci/build/windows-mingw.yml
index 5848505c60e30..cb84f8f4156db 100644
--- a/taskcluster/ci/build/windows-mingw.yml
+++ b/taskcluster/ci/build/windows-mingw.yml
@@ -34,7 +34,7 @@ win32-mingwclang/opt:
             - builds/releng_base_windows_32_mingw_builds.py
             - builds/releng_sub_windows_configs/32_mingwclang.py
         mozconfig-variant: mingwclang
-    run-on-projects: ['mozilla-central', 'mozilla-esr68']
+    run-on-projects: ['mozilla-central', 'mozilla-esr68', 'mozilla-esr78']
     fetches:
         toolchain:
             - mingw32-rust
@@ -67,7 +67,7 @@ win32-mingwclang/debug:
             - builds/releng_base_windows_32_mingw_builds.py
             - builds/releng_sub_windows_configs/32_mingwclang.py
         mozconfig-variant: mingwclang-debug
-    run-on-projects: ['mozilla-central', 'mozilla-esr68']
+    run-on-projects: ['mozilla-central', 'mozilla-esr68', 'mozilla-esr78']
     fetches:
         toolchain:
             - mingw32-rust
@@ -100,7 +100,7 @@ win64-mingwclang/opt:
             - builds/releng_base_windows_64_mingw_builds.py
             - builds/releng_sub_windows_configs/64_mingwclang.py
         mozconfig-variant: mingwclang
-    run-on-projects: ['mozilla-central', 'mozilla-esr68']
+    run-on-projects: ['mozilla-central', 'mozilla-esr68', 'mozilla-esr78']
     fetches:
         toolchain:
             - mingw32-rust
@@ -133,7 +133,7 @@ win64-mingwclang/debug:
             - builds/releng_base_windows_64_mingw_builds.py
             - builds/releng_sub_windows_configs/64_mingwclang.py
         mozconfig-variant: mingwclang-debug
-    run-on-projects: ['mozilla-central', 'mozilla-esr68']
+    run-on-projects: ['mozilla-central', 'mozilla-esr68', 'mozilla-esr78']
     fetches:
         toolchain:
             - mingw32-rust
diff --git a/taskcluster/ci/config.yml b/taskcluster/ci/config.yml
index 0ba931f4b1162..fc7d156c0fcb1 100644
--- a/taskcluster/ci/config.yml
+++ b/taskcluster/ci/config.yml
@@ -311,6 +311,19 @@ merge-automation:
             from-branch: 'release'
             to-repo: 'https://hg.mozilla.org/releases/mozilla-esr68'
             to-branch: 'esr68'
+        release-to-esr78:
+            fetch-version-from: "browser/config/version.txt"
+            version-files: []
+            replacements:
+                - - "build/mozconfig.common"
+                  - "# Enable enforcing that add-ons are signed by the trusted root"
+                  - "# Disable enforcing that add-ons are signed by the trusted root"
+            merge-old-head: false
+            base-tag: "FIREFOX_ESR_{major_version}_BASE"
+            from-repo: 'https://hg.mozilla.org/releases/mozilla-release'
+            from-branch: 'release'
+            to-repo: 'https://hg.mozilla.org/releases/mozilla-esr78'
+            to-branch: 'esr78'
         bump-central:
             fetch-version-from: "browser/config/version.txt"
             version-files:
@@ -359,6 +372,19 @@ merge-automation:
             merge-old-head: false
             to-repo: 'https://hg.mozilla.org/releases/mozilla-esr68'
             to-branch: 'esr68'
+        bump-esr78:
+            fetch-version-from: "browser/config/version.txt"
+            version-files:
+                - filename: "config/milestone.txt"
+                  version-bump: "minor"
+                - filename: "browser/config/version.txt"
+                  version-bump: "minor"
+                - filename: "browser/config/version_display.txt"
+                  version-bump: "minor"
+            replacements: []
+            merge-old-head: false
+            to-repo: 'https://hg.mozilla.org/releases/mozilla-esr78'
+            to-branch: 'esr78'
 
 scriptworker:
     # See additional configuration in taskcluster/taskgraph/util/scriptworker.py
@@ -375,7 +401,7 @@ partner-urls:
                         by-release-level:
                             production: 'git@github.com:mozilla-partners/repack-manifests.git'
                             staging: 'git@github.com:moz-releng-automation-stage/repack-manifests.git'
-                    esr(60|68):
+                    esr.*:
                         by-release-level:
                             production: 'git@github.com:mozilla-partners/esr-repack-manifests.git'
                             staging: 'git@github.com:moz-releng-automation-stage/esr-repack-manifests.git'
diff --git a/taskcluster/ci/cron-bouncer-check/kind.yml b/taskcluster/ci/cron-bouncer-check/kind.yml
index bfe918639b2eb..22c8cb72d25c0 100644
--- a/taskcluster/ci/cron-bouncer-check/kind.yml
+++ b/taskcluster/ci/cron-bouncer-check/kind.yml
@@ -54,7 +54,7 @@ jobs:
                     mozilla-beta: LATEST_FIREFOX_RELEASED_DEVEL_VERSION
                     mozilla-release: LATEST_FIREFOX_VERSION
                     mozilla-esr68: FIREFOX_ESR
-                    # mozilla-esrXX: FIREFOX_ESR_NEXT
+                    mozilla-esr78: FIREFOX_ESR_NEXT
                     default: LATEST_FIREFOX_DEVEL_VERSION
             products-url: https://product-details.mozilla.org/1.0/firefox_versions.json
         treeherder:
diff --git a/taskcluster/ci/l10n-bump/kind.yml b/taskcluster/ci/l10n-bump/kind.yml
index ca80a5d4e1b42..ab58453994f8e 100644
--- a/taskcluster/ci/l10n-bump/kind.yml
+++ b/taskcluster/ci/l10n-bump/kind.yml
@@ -28,7 +28,7 @@ job-defaults:
                 default: https://hg.mozilla.org/mozilla-central
         l10n-bump-info:
             by-release-type:
-                esr.*:
+                esr68:
                     name: Fennec l10n changesets
                     path: mobile/locales/l10n-changesets.json
                     version-path: mobile/android/config/version-files/release/version.txt
diff --git a/taskcluster/ci/release-balrog-scheduling/kind.yml b/taskcluster/ci/release-balrog-scheduling/kind.yml
index bde454b659d0f..e72feb157e1a4 100644
--- a/taskcluster/ci/release-balrog-scheduling/kind.yml
+++ b/taskcluster/ci/release-balrog-scheduling/kind.yml
@@ -36,12 +36,14 @@ jobs:
                             beta: [32]
                             release: [145]
                             esr68: [882]
+                            esr78: [3820]
                             default: []
                     staging:
                         by-release-type:
                             beta: [32]
                             release: [145]
                             esr68: [875]
+                            esr78: [887]
                             default: []
             background-rate:
                 by-release-type:
diff --git a/taskcluster/ci/release-bouncer-aliases/kind.yml b/taskcluster/ci/release-bouncer-aliases/kind.yml
index a74564affa11b..86f43ff25108b 100644
--- a/taskcluster/ci/release-bouncer-aliases/kind.yml
+++ b/taskcluster/ci/release-bouncer-aliases/kind.yml
@@ -66,6 +66,7 @@ jobs:
                     firefox-esr-latest: installer
                     firefox-esr-msi-latest-ssl: msi
                     firefox-esr-pkg-latest-ssl: pkg
+                mozilla-esr78:
                     # ... these point to the newer branch
                     firefox-esr-next-latest-ssl: installer-ssl
                     firefox-esr-next-latest: installer
diff --git a/taskcluster/ci/release-bouncer-sub/kind.yml b/taskcluster/ci/release-bouncer-sub/kind.yml
index fa21588272942..6650db9c99c17 100644
--- a/taskcluster/ci/release-bouncer-sub/kind.yml
+++ b/taskcluster/ci/release-bouncer-sub/kind.yml
@@ -44,6 +44,7 @@ jobs:
             by-release-type:
                 default: ['complete-mar', 'installer', 'installer-ssl', 'partial-mar', 'stub-installer', 'msi', 'pkg']
                 esr68: ['complete-mar', 'installer', 'installer-ssl', 'partial-mar', 'msi', 'pkg']
+                esr78: ['complete-mar', 'installer', 'installer-ssl', 'partial-mar', 'msi', 'pkg']
         shipping-product: firefox
         treeherder:
             platform: firefox-release/opt
diff --git a/taskcluster/ci/release-snap-push/kind.yml b/taskcluster/ci/release-snap-push/kind.yml
index a349bec7170bf..7c1a94c231b02 100644
--- a/taskcluster/ci/release-snap-push/kind.yml
+++ b/taskcluster/ci/release-snap-push/kind.yml
@@ -31,6 +31,7 @@ job-defaults:
                 beta: beta
                 release: candidate
                 esr68: esr/stable
+                esr78: esr/candidate
                 default: mock
 
 jobs:
diff --git a/taskcluster/ci/release-update-verify-config-next/kind.yml b/taskcluster/ci/release-update-verify-config-next/kind.yml
index eaf8eb90cfa80..c323f846cf5d0 100644
--- a/taskcluster/ci/release-update-verify-config-next/kind.yml
+++ b/taskcluster/ci/release-update-verify-config-next/kind.yml
@@ -13,7 +13,7 @@ transforms:
 job-defaults:
     name: update-verify-config-next
     run-on-projects: []  # to make sure this never runs as part of CI
-    run-on-releases: [esr68]
+    run-on-releases: [esr68, esr78]
     shipping-phase: promote
     worker-type: b-linux
     worker:
@@ -52,7 +52,7 @@ job-defaults:
         updater-platform: linux-x86_64
         product: firefox
         channel: "esr-localtest-next"
-        include-version: esr68-next
+        include-version: esr78-next
         last-watershed: "52.0esr"
 
 jobs:
diff --git a/taskcluster/ci/release-update-verify-config/kind.yml b/taskcluster/ci/release-update-verify-config/kind.yml
index ac51df5a0dcaf..eb3c5f9fa7828 100644
--- a/taskcluster/ci/release-update-verify-config/kind.yml
+++ b/taskcluster/ci/release-update-verify-config/kind.yml
@@ -62,6 +62,7 @@ job-defaults:
                         default: "56.0b3"
                 release(-rc)?: "72.0.2"
                 esr68: "68.0esr"
+                esr78: "78.0esr"
                 default: "default"
 
 jobs:
diff --git a/taskcluster/ci/release-update-verify-next/kind.yml b/taskcluster/ci/release-update-verify-next/kind.yml
index b34cf1fe197d5..13a29e50dc8e1 100644
--- a/taskcluster/ci/release-update-verify-next/kind.yml
+++ b/taskcluster/ci/release-update-verify-next/kind.yml
@@ -20,7 +20,7 @@ transforms:
 job-defaults:
     name: update-verify-next
     run-on-projects: []  # to make sure this never runs as part of CI
-    run-on-releases: [esr68]
+    run-on-releases: [esr68, esr78]
     shipping-phase: promote
     worker-type: b-linux
     worker:
diff --git a/taskcluster/ci/repackage-l10n/kind.yml b/taskcluster/ci/repackage-l10n/kind.yml
index 7d678561d2b47..1efc0948a693c 100644
--- a/taskcluster/ci/repackage-l10n/kind.yml
+++ b/taskcluster/ci/repackage-l10n/kind.yml
@@ -59,7 +59,7 @@ job-template:
                     - repackage/win64_signed.py
     package-formats:
         by-release-type:
-            esr(60|68):
+            esr.*:
                 by-build-platform:
                     linux.*: [mar]
                     linux4\b.*: [mar]
diff --git a/taskcluster/ci/repackage/kind.yml b/taskcluster/ci/repackage/kind.yml
index 77910647db16b..1ac5993d88abd 100644
--- a/taskcluster/ci/repackage/kind.yml
+++ b/taskcluster/ci/repackage/kind.yml
@@ -69,7 +69,7 @@ job-template:
                     - repackage/win64_signed.py
     package-formats:
         by-release-type:
-            esr(60|68):
+            esr.*:
                 by-build-platform:
                     linux.*: [mar]
                     linux4\b.*: [mar]
diff --git a/taskcluster/docs/parameters.rst b/taskcluster/docs/parameters.rst
index 08db6c67b0552..6eb9b140ed786 100644
--- a/taskcluster/docs/parameters.rst
+++ b/taskcluster/docs/parameters.rst
@@ -164,7 +164,7 @@ Release Promotion
    Specify the next version for version bump tasks.
 
 ``release_type``
-   The type of release being promoted. One of "nightly", "beta", "esr68", "release-rc", or "release".
+   The type of release being promoted. One of "nightly", "beta", "esr68", "esr78", "release-rc", or "release".
 
 ``release_eta``
    The time and date when a release is scheduled to live. This value is passed to Balrog.
diff --git a/taskcluster/taskgraph/decision.py b/taskcluster/taskgraph/decision.py
index e24eb86d2be39..669d745cc83d9 100644
--- a/taskcluster/taskgraph/decision.py
+++ b/taskcluster/taskgraph/decision.py
@@ -92,6 +92,11 @@ PER_PROJECT_PARAMETERS = {
         'release_type': 'esr68',
     },
 
+    'mozilla-esr78': {
+        'target_tasks_method': 'mozilla_esr78_tasks',
+        'release_type': 'esr78',
+    },
+
     'comm-central': {
         'target_tasks_method': 'default',
         'release_type': 'nightly',
diff --git a/taskcluster/taskgraph/target_tasks.py b/taskcluster/taskgraph/target_tasks.py
index 713e2ece9f842..b8ae530d9eada 100644
--- a/taskcluster/taskgraph/target_tasks.py
+++ b/taskcluster/taskgraph/target_tasks.py
@@ -361,6 +361,36 @@ def target_tasks_mozilla_esr68(full_task_graph, parameters, graph_config):
     return [l for l, t in six.iteritems(full_task_graph.tasks) if filter(t)]
 
 
+@_target_task('mozilla_esr78_tasks')
+def target_tasks_mozilla_esr78(full_task_graph, parameters, graph_config):
+    """Select the set of tasks required for a promotable beta or release build
+    of desktop, plus android CI. The candidates build process involves a pipeline
+    of builds and signing, but does not include beetmover or balrog jobs."""
+
+    def filter(task):
+        if not filter_release_tasks(task, parameters):
+            return False
+
+        if not standard_filter(task, parameters):
+            return False
+
+        platform = task.attributes.get('build_platform')
+
+        # Android is not built on esr78.
+        if platform and 'android' in platform:
+            return False
+
+        test_platform = task.attributes.get('test_platform')
+
+        # Don't run QuantumRender tests on esr78.
+        if test_platform and '-qr/' in test_platform:
+            return False
+
+        return True
+
+    return [l for l, t in six.iteritems(full_task_graph.tasks) if filter(t)]
+
+
 @_target_task('promote_desktop')
 def target_tasks_promote_desktop(full_task_graph, parameters, graph_config):
     """Select the superset of tasks required to promote a beta or release build
diff --git a/taskcluster/taskgraph/transforms/update_verify_config.py b/taskcluster/taskgraph/transforms/update_verify_config.py
index bcb4a4d9bd0f2..d7c125e1cd2ba 100644
--- a/taskcluster/taskgraph/transforms/update_verify_config.py
+++ b/taskcluster/taskgraph/transforms/update_verify_config.py
@@ -33,8 +33,8 @@ INCLUDE_VERSION_REGEXES = {
     "devedition_hack": r"'^((?!58\.0b1$)\d+\.\d+(b\d+)?)$'",
     # Same as nonbeta, except for the esr suffix
     "esr": r"'^\d+\.\d+(\.\d+)?esr$'",
-    # Previous esr versions, for update testing before we update users to esr68
-    "esr68-next": r"'^(52|60)+\.\d+(\.\d+)?esr$'",
+    # Previous esr versions, for update testing before we update users to esr78
+    "esr78-next": r"'^(52|60|68)+\.\d+(\.\d+)?esr$'",
 }
 
 MAR_CHANNEL_ID_OVERRIDE_REGEXES = {
diff --git a/taskcluster/taskgraph/util/attributes.py b/taskcluster/taskgraph/util/attributes.py
index e21355a478345..7c91c44ed79cb 100644
--- a/taskcluster/taskgraph/util/attributes.py
+++ b/taskcluster/taskgraph/util/attributes.py
@@ -20,6 +20,7 @@ RELEASE_PROJECTS = {
     'mozilla-beta',
     'mozilla-release',
     'mozilla-esr68',
+    'mozilla-esr78',
     'comm-central',
     'comm-beta',
     'comm-esr68',
diff --git a/taskcluster/taskgraph/util/scriptworker.py b/taskcluster/taskgraph/util/scriptworker.py
index cee7a12789b50..0737f74208f4b 100644
--- a/taskcluster/taskgraph/util/scriptworker.py
+++ b/taskcluster/taskgraph/util/scriptworker.py
@@ -58,6 +58,7 @@ SIGNING_SCOPE_ALIAS_TO_PROJECT = [[
         'mozilla-beta',
         'mozilla-release',
         'mozilla-esr68',
+        'mozilla-esr78',
         'comm-beta',
         'comm-esr68',
     ])
@@ -95,6 +96,7 @@ BEETMOVER_SCOPE_ALIAS_TO_PROJECT = [[
         'mozilla-beta',
         'mozilla-release',
         'mozilla-esr68',
+        'mozilla-esr78',
         'comm-beta',
         'comm-esr68',
     ])
@@ -144,6 +146,10 @@ BALROG_SCOPE_ALIAS_TO_PROJECT = [[
     'esr68', set([
         'mozilla-esr68',
     ])
+], [
+    'esr78', set([
+        'mozilla-esr78',
+    ])
 ]]
 
 """Map the balrog scope aliases to the actual scopes.
-- 
GitLab