Skip to content

Commit

Permalink
Initial support for pinebuild (#893)
Browse files Browse the repository at this point in the history
* Add initial support for pinebuild

* Use FirefoxVersion for pinebuild.

* Fix lint warnings.

* Minor comment addition.
  • Loading branch information
gbrownmozilla committed Sep 30, 2021
1 parent b5e8b7e commit 6564be0
Show file tree
Hide file tree
Showing 16 changed files with 124 additions and 12 deletions.
6 changes: 5 additions & 1 deletion api/src/shipit_api/admin/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def add_release(body):
session = current_app.db.session
partial_updates = body.get("partial_updates")
if partial_updates == "auto":
if product not in [Product.FIREFOX.value, Product.DEVEDITION.value] or branch not in ["try", "releases/mozilla-beta", "projects/maple"]:
if product not in [Product.FIREFOX.value, Product.DEVEDITION.value, Product.PINEBUILD.value] or branch not in [
"try",
"releases/mozilla-beta",
"projects/maple",
]:
abort(400, "Partial suggestion works for automated betas only")

partial_updates = _suggest_partials(product=product, branch=branch)
Expand Down
4 changes: 4 additions & 0 deletions api/src/shipit_api/admin/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ paths:
- firefox
- fennec
- devedition
- pinebuild
- name: branch
in: query
required: true
Expand Down Expand Up @@ -714,6 +715,7 @@ components:
enum:
- android-components
- devedition
- pinebuild
- fenix
- fennec
- firefox
Expand Down Expand Up @@ -821,6 +823,7 @@ components:
enum:
- android-components
- devedition
- pinebuild
- fenix
- fennec
- firefox
Expand Down Expand Up @@ -924,6 +927,7 @@ components:
- firefox
- fennec
- devedition
- pinebuild
branch:
type: string
example: releases/mozilla-beta
Expand Down
25 changes: 20 additions & 5 deletions api/src/shipit_api/admin/product_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"FIREFOX_ESR_NEXT": str,
"LATEST_FIREFOX_DEVEL_VERSION": str,
"FIREFOX_DEVEDITION": str,
"FIREFOX_PINEBUILD": str,
"LATEST_FIREFOX_OLDER_VERSION": str,
"LATEST_FIREFOX_RELEASED_DEVEL_VERSION": str,
"LATEST_FIREFOX_VERSION": str,
Expand Down Expand Up @@ -194,6 +195,7 @@ async def fetch_l10n_data(
url_file = {
Product.FIREFOX: "browser/locales/l10n-changesets.json",
Product.DEVEDITION: "browser/locales/l10n-changesets.json",
Product.PINEBUILD: "browser/locales/l10n-changesets.json",
Product.FENNEC: "mobile/locales/l10n-changesets.json",
Product.THUNDERBIRD: "mail/locales/l10n-changesets.json",
}[Product(release.product)]
Expand Down Expand Up @@ -302,12 +304,13 @@ def get_releases(
breakpoint_version: int, products: Products, releases: typing.List[shipit_api.common.models.Release], old_product_details: ProductDetails
) -> Releases:
"""This file holds historical information about all Firefox, Firefox for
Mobile (aka Fennec), Firefox Dev Edition and Thunderbird releases we
shipped in the past.
Mobile (aka Fennec), Firefox Dev Edition, Pinebuild and Thunderbird
releases we shipped in the past.
This function will output to the following files:
- all.json
- devedition.json
- pinebuild.json
- firefox.json
- mobile_android.json
- thunderbird.json
Expand Down Expand Up @@ -413,6 +416,9 @@ def get_release_history(
if Product.DEVEDITION is product:
raise click.ClickException(f'We don\'t generate product history for "{product.value}" product.')

if Product.PINEBUILD is product:
raise click.ClickException(f'We don\'t generate product history for "{product.value}" product.')

if ProductCategory.ESR is product_category:
raise click.ClickException(f'We don\'t generate product history for "{product_category.value}" product category.')

Expand Down Expand Up @@ -517,12 +523,13 @@ def get_primary_builds(

if product is Product.FIREFOX:
firefox_versions = get_firefox_versions(releases)
# make sure that Devedition is included in the list
products = [Product.FIREFOX, Product.DEVEDITION]
# make sure that Devedition and Pinebuild are included in the list
products = [Product.FIREFOX, Product.DEVEDITION, Product.PINEBUILD]
versions = set(
[
firefox_versions["FIREFOX_NIGHTLY"],
firefox_versions["FIREFOX_DEVEDITION"],
firefox_versions["FIREFOX_PINEBUILD"],
firefox_versions["LATEST_FIREFOX_RELEASED_DEVEL_VERSION"],
firefox_versions["LATEST_FIREFOX_VERSION"],
firefox_versions["FIREFOX_ESR"],
Expand Down Expand Up @@ -620,6 +627,7 @@ def get_firefox_versions(releases: typing.List[shipit_api.common.models.Release]
"FIREFOX_ESR_NEXT": "",
"LATEST_FIREFOX_DEVEL_VERSION": "59.0b14",
"FIREFOX_DEVEDITION": "59.0b14",
"FIREFOX_PINEBUILD": "59.0b14",
"LATEST_FIREFOX_OLDER_VERSION": "3.6.28",
"LATEST_FIREFOX_RELEASED_DEVEL_VERSION": "59.0b14",
"LATEST_FIREFOX_VERSION": "58.0.2",
Expand All @@ -643,6 +651,7 @@ def get_firefox_versions(releases: typing.List[shipit_api.common.models.Release]
LATEST_FIREFOX_DEVEL_VERSION=get_latest_version(releases, Product.FIREFOX, shipit_api.common.config.BETA_BRANCH),
LATEST_FIREFOX_RELEASED_DEVEL_VERSION=get_latest_version(releases, Product.FIREFOX, shipit_api.common.config.BETA_BRANCH),
FIREFOX_DEVEDITION=get_latest_version(releases, Product.DEVEDITION, shipit_api.common.config.BETA_BRANCH),
FIREFOX_PINEBUILD=get_latest_version(releases, Product.PINEBUILD, shipit_api.common.config.BETA_BRANCH),
LATEST_FIREFOX_OLDER_VERSION=shipit_api.common.config.LATEST_FIREFOX_OLDER_VERSION,
LAST_SOFTFREEZE_DATE=shipit_api.common.config.LAST_SOFTFREEZE_DATE,
LAST_MERGE_DATE=shipit_api.common.config.LAST_MERGE_DATE,
Expand Down Expand Up @@ -714,6 +723,7 @@ def get_l10n(

for (release, locales) in releases_l10n.items():
# XXX: for some reason we didn't generate l10n for devedition in old_product_details
# XXX need anything for pinebuild here?
if Product(release.product) is Product.DEVEDITION:
continue
data[f"l10n/{release.name}.json"] = {
Expand Down Expand Up @@ -939,6 +949,7 @@ def sanity_checks(product_details: ProductDetails) -> None:
"FIREFOX_NIGHTLY",
"FIREFOX_AURORA",
"FIREFOX_DEVEDITION",
"FIREFOX_PINEBUILD",
"FIREFOX_ESR",
"FIREFOX_ESR_NEXT",
"LATEST_FIREFOX_DEVEL_VERSION",
Expand Down Expand Up @@ -1061,9 +1072,13 @@ async def rebuild(
# combine old and new data
product_details: ProductDetails = {
"all.json": get_releases(
breakpoint_version, [Product.DEVEDITION, Product.FIREFOX, Product.FENIX, Product.FENNEC, Product.THUNDERBIRD], releases, old_product_details
breakpoint_version,
[Product.DEVEDITION, Product.PINEBUILD, Product.FIREFOX, Product.FENIX, Product.FENNEC, Product.THUNDERBIRD],
releases,
old_product_details,
), # consider adding `android-components` at some point.
"devedition.json": get_releases(breakpoint_version, [Product.DEVEDITION], releases, old_product_details),
"pinebuild.json": get_releases(breakpoint_version, [Product.PINEBUILD], releases, old_product_details),
"firefox.json": get_releases(breakpoint_version, [Product.FIREFOX], releases, old_product_details),
"firefox_history_development_releases.json": get_release_history(
breakpoint_version, Product.FIREFOX, ProductCategory.DEVELOPMENT, releases, old_product_details
Expand Down
3 changes: 2 additions & 1 deletion api/src/shipit_api/admin/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
_VERSION_CLASS_PER_PRODUCT = {
Product.ANDROID_COMPONENTS: MavenVersion,
Product.DEVEDITION: DeveditionVersion,
Product.PINEBUILD: FirefoxVersion,
Product.FENIX: FenixVersion,
Product.FENNEC: FennecVersion,
Product.FIREFOX: FirefoxVersion,
Expand Down Expand Up @@ -113,7 +114,7 @@ def is_eme_free_enabled(product, version):

def product_to_appname(product):
"""Convert product name to appName"""
if product in [Product.FIREFOX.value, Product.DEVEDITION.value]:
if product in [Product.FIREFOX.value, Product.DEVEDITION.value, Product.PINEBUILD.value]:
return "browser"


Expand Down
4 changes: 3 additions & 1 deletion api/src/shipit_api/admin/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
AUTH0_AUTH_SCOPES = dict()

# releng signoff scopes
for product in ["android-components", "firefox", "fenix", "fennec", "devedition"]:
for product in ["android-components", "firefox", "fenix", "fennec", "devedition", "pinebuild"]:
scopes = {f"add_release/{product}": LDAP_GROUPS["firefox-signoff"], f"abandon_release/{product}": LDAP_GROUPS["firefox-signoff"]}
phases = []
for flavor in [product, f"{product}_rc", f"{product}_release", f"{product}_release_rc", f"{product}_beta"]:
Expand All @@ -105,9 +105,11 @@
"disable_product/firefox": LDAP_GROUPS["firefox-signoff"],
"disable_product/fennec": LDAP_GROUPS["firefox-signoff"],
"disable_product/devedition": LDAP_GROUPS["firefox-signoff"],
"disable_product/pinebuild": LDAP_GROUPS["firefox-signoff"],
"enable_product/firefox": LDAP_GROUPS["firefox-signoff"],
"enable_product/fennec": LDAP_GROUPS["firefox-signoff"],
"enable_product/devedition": LDAP_GROUPS["firefox-signoff"],
"enable_product/pinebuild": LDAP_GROUPS["firefox-signoff"],
}
)

Expand Down
7 changes: 6 additions & 1 deletion api/src/shipit_api/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# breakpoint version will be served using static files. No related
# product-details data will be generated if we decide to ship a dot release
# with major version <= BREAKPOINT_VERSION. This includes Firefox (release,
# esr, beta, devedition), Fennec and Thunderbird.
# esr, beta, devedition, pinebuild), Fennec and Thunderbird.
BREAKPOINT_VERSION = 77

# When there is only one ESR release ESR_NEXT is set to '' and ESR_CURRENT is
Expand Down Expand Up @@ -454,6 +454,11 @@
{"name": "push_devedition", "in_previous_graph_ids": True},
{"name": "ship_devedition", "in_previous_graph_ids": True},
],
"pinebuild": [
{"name": "promote_pinebuild", "in_previous_graph_ids": True},
{"name": "push_pinebuild", "in_previous_graph_ids": True},
{"name": "ship_pinebuild", "in_previous_graph_ids": True},
],
"thunderbird": [
{"name": "promote_thunderbird", "in_previous_graph_ids": True},
{"name": "push_thunderbird", "in_previous_graph_ids": True},
Expand Down
2 changes: 1 addition & 1 deletion api/src/shipit_api/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class ReleaseBase:
@property
def allow_phase_skipping(self):
# Phases can be skipped for betas and try only. The API doesn't enforce this.
return self.product in ["firefox", "devedition"] and self.project in ["try", "beta"]
return self.product in ["firefox", "devedition", "pinebuild"] and self.project in ["try", "beta"]

@property
def json(self):
Expand Down
1 change: 1 addition & 0 deletions api/src/shipit_api/common/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class Product(enum.Enum):
ANDROID_COMPONENTS = "android-components"
DEVEDITION = "devedition"
PINEBUILD = "pinebuild"
FIREFOX = "firefox"
FENIX = "fenix"
FENNEC = "fennec"
Expand Down
2 changes: 2 additions & 0 deletions api/src/shipit_api/public/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
VERSION_CLASSES = {
Product.ANDROID_COMPONENTS.value: MavenVersion,
Product.DEVEDITION.value: DeveditionVersion,
# XXX revisit when we know how pinebuild will be versioned
Product.PINEBUILD.value: FirefoxVersion,
Product.FENIX.value: FenixVersion,
Product.FENNEC.value: FennecVersion,
Product.FIREFOX.value: FirefoxVersion,
Expand Down
2 changes: 2 additions & 0 deletions api/src/shipit_api/public/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ components:
enum:
- android-components
- devedition
- pinebuild
- fenix
- fennec
- firefox
Expand Down Expand Up @@ -305,6 +306,7 @@ components:
- firefox
- fennec
- devedition
- pinebuild
branch:
type: string
example: releases/mozilla-beta
Expand Down
3 changes: 3 additions & 0 deletions api/tests/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
(
("devedition", "56.0b1", does_not_raise(), DeveditionVersion(56, 0, beta_number=1)),
(Product.DEVEDITION, "56.0b1", does_not_raise(), DeveditionVersion(56, 0, beta_number=1)),
("pinebuild", "56.0b1", does_not_raise(), FirefoxVersion(56, 0, beta_number=1)),
(Product.PINEBUILD, "56.0b1", does_not_raise(), FirefoxVersion(56, 0, beta_number=1)),
("fenix", "84.0.0-beta.2", does_not_raise(), FenixVersion(84, 0, 0, beta_number=2)),
(Product.FENIX, "84.0.0", does_not_raise(), FenixVersion(84, 0, 0)),
("fennec", "68.2b3", does_not_raise(), FennecVersion(68, 2, beta_number=3)),
Expand Down Expand Up @@ -59,6 +61,7 @@ def test_parse_version(product, version, expectation, result):
("thunderbird", "57.0", {"56.0": [], "56.0b4": [], "55.0": []}, True),
("firefox", "70.0b4", {"69.0b15": [], "69.0b16": [], "70.0b3": []}, False),
("devedition", "70.0b4", {"70.0b3": [], "70.0b1": [], "70.0b2": []}, False),
("pinebuild", "70.0b4", {"70.0b3": [], "70.0b1": [], "70.0b2": []}, False),
),
)
def test_is_rc(product, version, partial_updates, result):
Expand Down
4 changes: 2 additions & 2 deletions api/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_scopes(monkeypatch):
[
ldap_groups
for scope, ldap_groups in AUTH0_AUTH_SCOPES.items()
if "firefox" in scope or "fenix" in scope or "fennec" in scope or "devedition" in scope
if "firefox" in scope or "fenix" in scope or "fennec" in scope or "devedition" in scope or "pinebuild" in scope
]
)
assert set(firefox_ldap_groups).isdisjoint(set(tb_ldap_groups))
Expand All @@ -70,7 +70,7 @@ def test_scopes(monkeypatch):
[
ldap_groups
for scope, ldap_groups in AUTH0_AUTH_SCOPES.items()
if "firefox" in scope or "fenix" in scope or "fennec" in scope or "devedition" in scope
if "firefox" in scope or "fenix" in scope or "fennec" in scope or "devedition" in scope or "pinebuild" in scope
]
)
assert set(firefox_ldap_groups).isdisjoint(set(xpi_ldap_groups))
Expand Down
25 changes: 25 additions & 0 deletions frontend/src/configs/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@ module.exports = {
enablePartials: true,
canTogglePartials: true,
},
{
product: 'pinebuild',
prettyName: 'Firefox pinebuild',
appName: 'browser',
branches: [
{
prettyName: 'Maple Beta',
project: 'maple',
branch: 'projects/maple',
repo: 'https://hg.mozilla.org/projects/maple',
enableReleaseEta: false,
disableable: true,
},
{
prettyName: 'Try',
project: 'try',
branch: 'try',
repo: 'https://hg.mozilla.org/try',
enableReleaseEta: false,
disableable: true,
},
],
enablePartials: true,
canTogglePartials: true,
},
{
product: 'thunderbird',
prettyName: 'Thunderbird',
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/configs/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ module.exports = {
],
enablePartials: true,
},
{
product: 'pinebuild',
prettyName: 'Firefox pinebuild',
appName: 'browser',
branches: [
{
prettyName: 'Maple Beta',
project: 'maple',
branch: 'projects/maple',
repo: 'https://hg.mozilla.org/projects/maple',
enableReleaseEta: false,
disableable: true,
},
],
enablePartials: true,
},
{
product: 'thunderbird',
prettyName: 'Thunderbird',
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/configs/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,22 @@ module.exports = {
],
enablePartials: true,
},
{
product: 'pinebuild',
prettyName: 'Firefox pinebuild',
appName: 'browser',
branches: [
{
prettyName: 'Maple Beta',
project: 'maple',
branch: 'projects/maple',
repo: 'https://hg.mozilla.org/projects/maple',
enableReleaseEta: false,
disableable: true,
},
],
enablePartials: true,
},
{
product: 'thunderbird',
prettyName: 'Thunderbird',
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/configs/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,22 @@ module.exports = {
],
enablePartials: true,
},
{
product: 'pinebuild',
prettyName: 'Firefox pinebuild',
appName: 'browser',
branches: [
{
prettyName: 'Beta',
project: 'mozilla-beta',
branch: 'releases/mozilla-beta',
repo: 'https://hg.mozilla.org/releases/mozilla-beta',
enableReleaseEta: false,
disableable: true,
},
],
enablePartials: true,
},
{
product: 'thunderbird',
prettyName: 'Thunderbird',
Expand Down

0 comments on commit 6564be0

Please sign in to comment.