Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions src/taskgraph/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ def file_url(self, path, pretty=False):
:return str: The URL displaying the given path.
"""
if self["repository_type"] == "hg":
if path.startswith("comm/"):
path = path[len("comm/") :]
if "comm/" in path:
path = path.split("comm/")[1]
repo = self["comm_head_repository"]
rev = self["comm_head_rev"]
else:
Expand Down
19 changes: 19 additions & 0 deletions test/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,25 @@ def test_Parameters_check_extra(self):
p = Parameters(strict=False, xyz=10, **self.vals)
p.check() # should not raise

def test_Parameters_file_url_hg_comm(self):
vals = self.vals.copy()
vals["repository_type"] = "hg"

vals["comm_head_repository"] = "https://hg.mozilla.org/releases/comm-beta"
vals["comm_head_rev"] = "branch"
vals["head_repository"] = "https://hg.mozilla.org/releases/mozilla-beta"
p = Parameters(**vals)

path = (
"/builds/worker/checkouts/gecko/comm/taskcluster/kinds/"
"shippable-l10n-signing"
)
kind_path = (
"https://hg.mozilla.org/releases/comm-beta/file/branch/"
"taskcluster/kinds/shippable-l10n-signing"
)
self.assertTrue(p.file_url(path, pretty=True) == kind_path)

def test_Parameters_file_url_git_remote(self):
vals = self.vals.copy()
vals["repository_type"] = "git"
Expand Down
Loading