Bug 1728471 - Produce MSIX packages with Mozilla's Microsoft Partner Centre identity values for the Microsoft Store. r=bhearsum

Some of these values can be computed from the relevant packages and
various defaults, but the logic is sufficiently complicated that I
would prefer to have the values come directly from the YAML
configuration file.  This is breaking new ground: now some
configuration depends on the `package-format`.

The existing packages like `target.installer.msix` that are signed
with the "Mozilla Corporation" key for enterprise customers have
package family name like `Mozilla.MozillaFirefox`.  The new packages
that are unsigned for the Microsoft Store are named like
`target.store.msix` and have package family name like
`Mozilla.Firefox`.  This allows the two to coexist on a single system,
which is most flexible and may prove useful.

Differential Revision: https://phabricator.services.mozilla.com/D128431
This commit is contained in:
Nick Alexander 2021-10-16 02:48:15 +00:00
parent ab6e2fc68d
commit a80aa30af6
3 changed files with 166 additions and 39 deletions

View File

@ -46,22 +46,48 @@ job-template:
- repackage/base.py
- repackage/win64-aarch64_sfx_stub.py
- repackage/win64_signed.py
package-formats: [msix]
package-formats: [msix, msix-store]
fetches:
toolchain:
- linux64-msix-packaging
msix:
channel:
by-release-type:
nightly.*: nightly
beta.*:
by-shipping-product:
devedition: aurora
default: beta
release.*: official
esr.*: official
default: nightly
by-shipping-product:
devedition: aurora
default:
by-release-type:
beta.*: beta
release.*: official
esr.*: official
default: nightly
identity-name:
by-shipping-product:
devedition:
by-package-format:
msix: MozillaFirefoxDevedition
msix-store: FirefoxDevedition
default:
by-package-format:
msix:
by-release-type:
beta.*: MozillaFirefoxBeta
release.*: MozillaFirefox
esr.*: MozillaFirefox
default: MozillaFirefoxNightly
msix-store:
by-release-type:
beta.*: FirefoxBeta
release.*: Firefox
esr.*: Firefox
default: FirefoxNightly
publisher:
by-level:
"3": "CN=Mozilla Corporation, OU=Firefox Engineering Operations, O=Mozilla Corporation, L=Mountain View, S=California, C=US"
default: "CN=Mozilla Fake SPC"
by-package-format:
msix:
by-level:
"3": "CN=Mozilla Corporation, OU=Firefox Engineering Operations, O=Mozilla Corporation, L=Mountain View, S=California, C=US"
default: "CN=Mozilla Fake SPC"
msix-store: "CN=082E9164-EE6C-4EC8-B62C-441FAE7BEFA1"
publisher-display-name:
by-package-format:
msix: "Mozilla Corporation"
msix-store: "Mozilla"

View File

@ -48,22 +48,48 @@ job-template:
- repackage/base.py
- repackage/win64-aarch64_sfx_stub.py
- repackage/win64_signed.py
package-formats: [msix]
package-formats: [msix, msix-store]
fetches:
toolchain:
- linux64-msix-packaging
msix:
channel:
by-release-type:
nightly.*: nightly
beta.*:
by-shipping-product:
devedition: aurora
default: beta
release.*: official
esr.*: official
default: nightly
by-shipping-product:
devedition: aurora
default:
by-release-type:
beta.*: beta
release.*: official
esr.*: official
default: nightly
identity-name:
by-shipping-product:
devedition:
by-package-format:
msix: MozillaFirefoxDevedition
msix-store: FirefoxDevedition
default:
by-package-format:
msix:
by-release-type:
beta.*: MozillaFirefoxBeta
release.*: MozillaFirefox
esr.*: MozillaFirefox
default: MozillaFirefoxNightly
msix-store:
by-release-type:
beta.*: FirefoxBeta
release.*: Firefox
esr.*: Firefox
default: FirefoxNightly
publisher:
by-level:
"3": "CN=Mozilla Corporation, OU=Firefox Engineering Operations, O=Mozilla Corporation, L=Mountain View, S=California, C=US"
default: "CN=Mozilla Fake SPC"
by-package-format:
msix:
by-level:
"3": "CN=Mozilla Corporation, OU=Firefox Engineering Operations, O=Mozilla Corporation, L=Mountain View, S=California, C=US"
default: "CN=Mozilla Fake SPC"
msix-store: "CN=082E9164-EE6C-4EC8-B62C-441FAE7BEFA1"
publisher-display-name:
by-package-format:
msix: "Mozilla Corporation"
msix-store: "Mozilla"

View File

@ -49,10 +49,36 @@ packaging_description_schema = schema.extend(
),
Optional("msix"): {
Optional("channel"): optionally_keyed_by(
"level", "build-platform", "release-type", "shipping-product", str
"package-format",
"level",
"build-platform",
"release-type",
"shipping-product",
str,
),
Optional("identity-name"): optionally_keyed_by(
"package-format",
"level",
"build-platform",
"release-type",
"shipping-product",
str,
),
Optional("publisher"): optionally_keyed_by(
"level", "build-platform", "release-type", "shipping-product", str
"package-format",
"level",
"build-platform",
"release-type",
"shipping-product",
str,
),
Optional("publisher-display-name"): optionally_keyed_by(
"package-format",
"level",
"build-platform",
"release-type",
"shipping-product",
str,
),
},
# All l10n jobs use mozharness
@ -121,10 +147,14 @@ PACKAGE_FORMATS = {
"msix",
"--channel",
"{msix-channel}",
"--arch",
"{architecture}",
"--publisher",
"{msix-publisher}",
"--publisher-display-name",
"{msix-publisher-display-name}",
"--identity-name",
"{msix-identity-name}",
"--arch",
"{architecture}",
# For langpacks. Ignored if directory does not exist.
"--distribution-dir",
"{fetch-dir}/distribution",
@ -137,6 +167,31 @@ PACKAGE_FORMATS = {
},
"output": "target.installer.msix",
},
"msix-store": {
"args": [
"msix",
"--channel",
"{msix-channel}",
"--publisher",
"{msix-publisher}",
"--publisher-display-name",
"{msix-publisher-display-name}",
"--identity-name",
"{msix-identity-name}",
"--arch",
"{architecture}",
# For langpacks. Ignored if directory does not exist.
"--distribution-dir",
"{fetch-dir}/distribution",
"--verbose",
"--makeappx",
"{fetch-dir}/msix-packaging/makemsix",
],
"inputs": {
"input": "target{archive_format}",
},
"output": "target.store.msix",
},
"dmg": {
"args": ["dmg"],
"inputs": {
@ -193,17 +248,18 @@ def copy_in_useful_magic(config, jobs):
for job in jobs:
dep = job["primary-dependency"]
job["build-platform"] = dep.attributes.get("build_platform")
job["shipping-product"] = dep.attributes.get("shipping_product")
yield job
@transforms.add
def handle_keyed_by(config, jobs):
"""Resolve fields that can be keyed by platform, etc."""
"""Resolve fields that can be keyed by platform, etc, but not `msix.*` fields that can be keyed by
`package-format`. Such fields are handled specially below.
"""
fields = [
"mozharness.config",
"package-formats",
"msix.channel",
"msix.publisher",
]
for job in jobs:
job = copy.deepcopy(job) # don't overwrite dict values here
@ -351,13 +407,32 @@ def make_job_description(config, jobs):
"version_display": config.params["version"],
"mar-channel-id": attributes["mar-channel-id"],
}
# Allow us to replace args a well, but specifying things expanded in mozharness
# Without breaking .format and without allowing unknown through
# Allow us to replace `args` as well, but specifying things expanded in mozharness
# without breaking .format and without allowing unknown through.
substs.update({name: f"{{{name}}}" for name in MOZHARNESS_EXPANSIONS})
for msix_key in ("channel", "publisher"):
# Turn `msix.channel` into `msix-channel` and `msix.publisher`
# into `msix-publisher`.
value = job.get("msix", {}).get(msix_key)
# We need to resolve `msix.*` values keyed by `package-format` for each format, not
# just once, so we update a temporary copy just for extracting these values.
temp_job = copy.deepcopy(job)
for msix_key in (
"channel",
"identity-name",
"publisher",
"publisher-display-name",
):
resolve_keyed_by(
item=temp_job,
field=f"msix.{msix_key}",
item_name="?",
**{
"package-format": format,
"release-type": config.params["release_type"],
"level": config.params["level"],
},
)
# Turn `msix.channel` into `msix-channel`, etc.
value = temp_job.get("msix", {}).get(msix_key)
if value:
substs.update(
{f"msix-{msix_key}": value},