Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d428d1
branches: add esr branch support (bug 2048638)
Magnolia-Liu Jul 10, 2026
ee89511
fix linting
Magnolia-Liu Jul 14, 2026
8f3bbdf
add help text to gui
Magnolia-Liu Jul 14, 2026
53b2caa
make esr branches' category releases
Magnolia-Liu Jul 15, 2026
37378d0
add early exit when name is none
Magnolia-Liu Jul 15, 2026
5906f8f
switch esr branch category to release in tests
Magnolia-Liu Jul 15, 2026
67005e3
update regex to work with comm branches. default to mozilla for bare esr
Magnolia-Liu Jul 16, 2026
1f6ef9a
add build type = shippable to comm release, beta, and esr branches
Magnolia-Liu Jul 16, 2026
b786087
make comm replace default mozilla if thunderbird is app
Magnolia-Liu Jul 16, 2026
24e3167
fix linting
Magnolia-Liu Jul 16, 2026
3a4bd1b
make default build type opt for comm-central
Magnolia-Liu Jul 16, 2026
afd4789
add shippable tk route w build type test for comm central
Magnolia-Liu Jul 16, 2026
32615e2
catch more corner cases with bare esr
Magnolia-Liu Jul 16, 2026
8acc139
simplify help text
Magnolia-Liu Jul 16, 2026
2c22584
remove obsolete tests
Magnolia-Liu Jul 16, 2026
9de2176
fix linting
Magnolia-Liu Jul 16, 2026
94e90f0
delete claude.md
Magnolia-Liu Jul 17, 2026
98c604c
remove startswith repetition
Magnolia-Liu Jul 17, 2026
882b42c
remove old init
Magnolia-Liu Jul 17, 2026
8584fc1
remove stray init
Magnolia-Liu Jul 17, 2026
5564856
remove redundant tk-route construction for comm-central.
Magnolia-Liu Jul 17, 2026
98c748b
add esr instructions in docs
Magnolia-Liu Jul 17, 2026
549b535
fix linting
Magnolia-Liu Jul 17, 2026
fad17ec
add back comm-central shippable check
Magnolia-Liu Jul 17, 2026
c45c338
add back tk_route tests
Magnolia-Liu Jul 17, 2026
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
4 changes: 4 additions & 0 deletions docs/documentation/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ to date list of available options.

mozregression --repo mozilla-aurora

- Bisecting from a ESR branch

mozregression --repo esr140

- Bisecting inbound directly

mozregression --good 8850aa0f --bad 2a193b7f
Expand Down
18 changes: 14 additions & 4 deletions gui/mozregui/ui/intro.ui
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@
<string>Choose a build type you want.</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="repository_hint">
<property name="text">
<string>Hint: To choose an ESR branch, select target app and enter esrXXX.</string>
</property>
<property name="styleSheet">
<string notr="true">color: gray; font-size: 10px;</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="repository_label">
Expand All @@ -81,7 +91,7 @@
</property>
</widget>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="lang_label">
<property name="toolTip">
<string>enter the code of the lang you want a build for</string>
Expand All @@ -91,7 +101,7 @@
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QLineEdit" name="lang">
<property name="toolTip">
<string>Lang code such as he, ar, zh-TW</string>
Expand All @@ -101,7 +111,7 @@
</property>
</widget>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="url_label">
<property name="toolTip">
<string>enter a URL to pass to the app</string>
Expand All @@ -111,7 +121,7 @@
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="QLineEdit" name="url">
<property name="toolTip">
<string>URL such as example.org, https://mozilla.org, about:logo</string>
Expand Down
17 changes: 16 additions & 1 deletion mozregression/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from mozregression.errors import MozRegressionError

LOG = get_proxy_logger("Branches")
RE_ESR = re.compile(r"^(?:(mozilla-|comm-))?esr(\d+)$", re.I)


class Branches(object):
Expand All @@ -38,19 +39,33 @@ def set_alias(self, alias, branch_name):
self._aliases[alias] = branch_name

def get_url(self, branch_name_or_alias):
name = self.get_name(branch_name_or_alias)
try:
return self._branches[self.get_name(branch_name_or_alias)]
return self._branches[name]
except KeyError:
if RE_ESR.match(name):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is repeated a few times in this class. We could put this functionality in self._esr_match and self.is_esr_name.

url = self.DEFAULT_REPO_URL + "releases/%s" % name
return url
raise MozRegressionError("No such branch '%s'." % branch_name_or_alias)

def get_name(self, branch_name_or_alias):
if branch_name_or_alias:
match = RE_ESR.match(branch_name_or_alias)
Comment on lines +52 to +53

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit

Suggested change
if branch_name_or_alias:
match = RE_ESR.match(branch_name_or_alias)
if branch_name_or_alias and match := RE_ESR.match(branch_name_or_alias):

Then later lines can be dedented.

if match:
prefix = match.group(1)
if prefix:
return "%sesr%s" % (prefix, match.group(2))
else:
return "esr%s" % match.group(2)
return self._aliases.get(branch_name_or_alias) or branch_name_or_alias

def get_category(self, branch_name_or_alias):
name = self.get_name(branch_name_or_alias)
for cat, names in self._categories.items():
if name in names:
return cat
if name and RE_ESR.match(name):
return "releases"


def create_branches():
Expand Down
34 changes: 31 additions & 3 deletions mozregression/fetch_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,20 @@ def set_repo(self, repo):
If not set or set to None, default repos would be used (see
:meth:`get_nightly_repo` and :attr:`integration_branch`)
"""
self.repo = branches.get_name(repo) if repo else None
if repo:
name = branches.get_name(repo)
is_esr = name.startswith("esr")
Comment on lines +241 to +243

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to reverse the logic here. Handle the general case first, and then handle the esr case.

if self.app_name == "thunderbird" and is_esr:
self.repo = "comm-" + name
elif self.app_name == "firefox" and is_esr:
self.repo = "mozilla-" + name
elif is_esr:
# A bare `esr` defaults to the Firefox (`mozilla`) repository.
self.repo = "mozilla-" + name
Comment on lines +246 to +250

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - I don't think adding the check for self.app_name == "firefox" is doing anything here.

Suggested change
elif self.app_name == "firefox" and is_esr:
self.repo = "mozilla-" + name
elif is_esr:
# A bare `esr` defaults to the Firefox (`mozilla`) repository.
self.repo = "mozilla-" + name
elif is_esr:
# A bare `esr` defaults to the Firefox (`mozilla`) repository.
self.repo = "mozilla-" + name

else:
self.repo = name
else:
self.repo = None

def should_use_archive(self):
"""
Expand Down Expand Up @@ -559,11 +572,17 @@ class ThunderbirdIntegrationConfigMixin(IntegrationConfigMixin):

def tk_routes(self, push):
for build_type in self.build_types:
yield "comm.v2.{}.revision.{}.thunderbird.{}-{}".format(
yield "comm.v2.{}{}.revision.{}.thunderbird.{}-{}".format(
self.integration_branch,
(
".shippable"
if self.integration_branch != "comm-central"
or (self.integration_branch == "comm-central" and build_type == "shippable")
else ""
),
push.changeset,
_common_tk_part(self),
build_type,
"opt",
Comment thread
Magnolia-Liu marked this conversation as resolved.
)
self._inc_used_build()
return
Expand Down Expand Up @@ -675,6 +694,15 @@ def available_archs(self):
class ThunderbirdConfig(
CommonConfig, ThunderbirdNightlyConfigMixin, ThunderbirdIntegrationConfigMixin
):
BUILD_TYPES = (
"shippable",
"opt",
)
BUILD_TYPE_FALLBACKS = {
"shippable": ("opt",),
"opt": ("shippable",),
}
Comment thread
Magnolia-Liu marked this conversation as resolved.

pass


Expand Down
5 changes: 5 additions & 0 deletions tests/unit/test_branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
("mozilla-central", "mozilla-central"),
("mozilla-central", "m-c"),
("unknown", "unknown"),
("mozilla-esr140", "mozilla-esr140"),
],
)
def test_branch_name(branch, alias):
Expand All @@ -25,6 +26,7 @@ def test_branch_name(branch, alias):
("m-c", "https://hg.mozilla.org/mozilla-central"),
("m-i", "https://hg.mozilla.org/integration/mozilla-inbound"),
("mozilla-beta", "https://hg.mozilla.org/releases/mozilla-beta"),
("mozilla-esr140", "https://hg.mozilla.org/releases/mozilla-esr140"),
],
)
def test_get_urls(branch, url):
Expand Down Expand Up @@ -63,6 +65,9 @@ def test_get_url_unknown_branch():
("mozilla-beta", "releases"),
("", None),
(None, None),
("mozilla-esr140", "releases"),
("esr140", "releases"),
("comm-esr140", "releases"),
],
)
def test_get_category(name, expected):
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/test_fetch_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def test_aarch64_build_types(self):
"x86_64",
"comm-beta",
TIMESTAMP_TEST,
"comm.v2.comm-beta.revision.%s.thunderbird.linux64-opt" % CHSET,
"comm.v2.comm-beta.shippable.revision.%s.thunderbird.linux64-opt" % CHSET,
),
],
)
Expand Down Expand Up @@ -566,6 +566,15 @@ def test_tk_route(app, os, bits, processor, repo, push_date, expected):
"shippable",
"gecko.v2.mozilla-central.shippable.revision.%s.mobile.android-api-16-opt" % CHSET,
),
# thunderbird
(
"thunderbird",
"win",
32,
"x86_64",
"shippable",
"comm.v2.comm-central.shippable.revision.%s.thunderbird.win32-opt" % CHSET,
),
],
)
def test_tk_route_with_build_type(app, os, bits, processor, build_type, expected):
Expand Down
Loading