Skip to content
Snippets Groups Projects
Commit b480a06e authored by Aki Sasaki's avatar Aki Sasaki
Browse files

Bug 1747280 - nuke comm/ after cross-channel. r=mhentges,releng-reviewers,jmaher DONTBUILD

We clean up our Gecko clone between tasks via `hg robustcheckout --purge`, which runs `hg purge`. This is very effective, *but* it doesn't detect or clean up any nested clones.

Because we run cross-channel on Gecko workers, and because we clone `comm/` in cross-channel and haven't cleaned it up, and because `hg purge` doesn't detect or clean up nested clones, and because our current virtualenv setup code traverses the tree and can error out on `comm/` clones, let's clean up `comm/` after running cross-channel.

We'll be moving TB cross-channel to different tasks/workers in bug 1742711, and ideally we can update robustcheckout and/or `hg purge` to be able to detect and/or clean up nested clones.

Differential Revision: https://phabricator.services.mozilla.com/D134582
parent 69971535
No related merge requests found
......@@ -48,6 +48,7 @@ def get_default_config(topsrcdir, strings_path):
},
"comm-central": {
"path": topsrcdir / "comm",
"post-clobber": True,
"url": "https://hg.mozilla.org/comm-central/",
"heads": {
# This list of repositories is ordered, starting with the
......
......@@ -37,5 +37,5 @@ jobs:
using: mach
actions:
by-level:
"3": ["prep", "create", "push"]
default: ["prep", "create"]
"3": ["prep", "create", "push", "clean"]
default: ["prep", "create", "clean"]
......@@ -146,7 +146,7 @@ HGRC_PATH = Path(user_config_dir("hg")).joinpath("hgrc")
)
@CommandArgument(
"actions",
choices=("prep", "create", "push"),
choices=("prep", "create", "push", "clean"),
nargs="+",
# This help block will be poorly formatted until we fix bug 1714239
help="""
......@@ -154,6 +154,7 @@ HGRC_PATH = Path(user_config_dir("hg")).joinpath("hgrc")
"create": create the en-US strings commit an optionally create an
outgoing() patch.
"push": push the en-US strings to the quarantine repo.
"clean": clean up any sub-repos.
""",
)
def cross_channel(
......@@ -318,6 +319,11 @@ def _do_create_content(
else:
command_context.log(logging.INFO, "push", {}, "Skipping empty push.")
if "clean" in actions:
for repo_config in config.get("source", {}).values():
if repo_config.get("post-clobber", False):
_nuke_hg_repo(command_context, str(repo_config["path"]))
return status
......@@ -397,3 +403,7 @@ def _check_hg_repo(command_context, path, heads=None):
def _clone_hg_repo(command_context, url, path):
_retry_run_process(command_context, ["hg", "clone", url, str(path)])
def _nuke_hg_repo(command_context, path):
_retry_run_process(command_context, ["rm", "-rf", str(path)])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment