No bug: Fix an issue where ./mach taskgraph --diff sometimes uses the wrong taskgraph schema r=ahal

It's unclear exactly what is happening, but ensuring that gecko_taskgraph is loaded immediately after being unloaded will ensure that it is always before taskcluster_taskgraph in sys.path, which avoids the issue.

Differential Revision: https://phabricator.services.mozilla.com/D163377
This commit is contained in:
Ben Hearsum 2022-11-29 21:59:07 +00:00
Родитель 5af8d4f83a
Коммит 75ae6f6158
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -397,6 +397,11 @@ def show_taskgraph(options):
if mod != __name__ and mod.split(".", 1)[0].endswith("taskgraph"):
del sys.modules[mod]
# Ensure gecko_taskgraph is ahead of taskcluster_taskgraph in sys.path.
# Without this, we may end up validating some things against the wrong
# schema.
import gecko_taskgraph # noqa
if options["diff"] == "default":
base_ref = repo.base_ref
else: