Skip to content

Commit 69a4874

Browse files
committed
refactor: remove 'hgmo' template for taskgraph init
hg.mozilla.org is being decommissioned and new repos will no longer be created there. Besides, this template never worked and had a bunch of errors in it.
1 parent 0b818d4 commit 69a4874

File tree

4 files changed

+9
-231
lines changed

4 files changed

+9
-231
lines changed

src/taskgraph/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -912,16 +912,14 @@ def init_taskgraph(options):
912912

913913
if repo.tool == "git" and "github.com" in repo_url:
914914
context["repo_host"] = "github"
915-
elif repo.tool == "hg" and "hg.mozilla.org" in repo_url:
916-
context["repo_host"] = "hgmo"
917915
else:
918916
print(
919917
dedent(
920918
"""\
921919
Repository not supported!
922920
923-
Taskgraph only supports repositories hosted on Github or hg.mozilla.org.
924-
Ensure you have a remote that points to one of these locations.
921+
The `taskgraph init` command only supports repositories hosted on
922+
Github. Ensure you use a remote that points to a Github repository.
925923
"""
926924
),
927925
file=sys.stderr,

template/cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"project_name": "my-project",
33
"taskgraph_version": "{{ cookiecutter.taskgraph_version }}",
4-
"repo_host": ["github", "hgmo"],
4+
"repo_host": ["github"],
55
"repo_name": "my-repo",
66
"project_slug": "{{ cookiecutter.repo_name.lower().replace(' ', '_').replace('-', '_') }}",
77
"trust_domain": "mozilla",

template/{{cookiecutter.project_name}}/taskcluster.hgmo.yml

Lines changed: 0 additions & 225 deletions
This file was deleted.

test/test_main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,15 @@ def test_init_taskgraph(mocker, tmp_path, project_root, repo_with_upstream):
263263
oldcwd = Path.cwd()
264264
try:
265265
os.chdir(repo_root)
266-
taskgraph_main(["init", "--template", str(project_root)])
266+
ret = taskgraph_main(["init", "--template", str(project_root)])
267267
finally:
268268
os.chdir(oldcwd)
269269

270+
if repo.tool == "hg":
271+
assert ret == 1
272+
assert not (repo_root / ".taskcluster.yml").exists()
273+
return
274+
270275
# Make assertions about the repository state.
271276
expected_files = [
272277
".taskcluster.yml",

0 commit comments

Comments
 (0)