From a71126297ff2a2f232f433d95d40a430234754bd Mon Sep 17 00:00:00 2001 From: Rob Lemley Date: Tue, 24 Sep 2024 01:35:36 +0000 Subject: [PATCH] Bug 1905941 - Merge automation workaround for comm-central-to-beta and .gecko_rev.yml. r=dandarnell This should be fixed by adding functionality to deal with .gecko_rev.yml to Treescript. However in the interest of getting merge automation working add this workaround. There's no GECKO_HEAD_REV field in .gecko_rev.yml when comm-central-to-beta runs, so instead create a line that can be easily replaced with the correct data. Differential Revision: https://phabricator.services.mozilla.com/D221194 --HG-- extra : rebase_source : 9926068cbee7017d06a91296926d041fd3dfe6f9 extra : amend_source : f8b057b344b9f7e76dc56ab84b5d69527b2fa3d9 extra : absorb_source : be4bdd4c1dd27c18cf48248768e225a5a0a14301 --- .gecko_rev.yml | 1 + .../transforms/merge_automation.py | 18 +++++++++++++----- taskcluster/kinds/merge-automation/kind.yml | 1 + 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.gecko_rev.yml b/.gecko_rev.yml index 1057a7f2e4..454d09ff59 100644 --- a/.gecko_rev.yml +++ b/.gecko_rev.yml @@ -2,6 +2,7 @@ GECKO_BASE_REPOSITORY: https://hg.mozilla.org/mozilla-unified GECKO_HEAD_REPOSITORY: https://hg.mozilla.org/mozilla-central GECKO_HEAD_REF: default +###### ### For comm-central # GECKO_BASE_REPOSITORY: https://hg.mozilla.org/mozilla-unified diff --git a/taskcluster/comm_taskgraph/transforms/merge_automation.py b/taskcluster/comm_taskgraph/transforms/merge_automation.py index 2bf1cfafea..8209ebafdc 100644 --- a/taskcluster/comm_taskgraph/transforms/merge_automation.py +++ b/taskcluster/comm_taskgraph/transforms/merge_automation.py @@ -92,6 +92,7 @@ def get_gecko_rev_yml(repo_base_url): def get_upstream_tag(tag_regex, base_regex, repo): + print(f"get_upstream_tag: Looking for {tag_regex} or {base_regex}") base_tag_matcher = re.compile(base_regex) release_tag_matcher = re.compile(tag_regex) @@ -140,6 +141,8 @@ def pin_gecko_rev_yml(config, tasks): if "merge_config" not in config.params: break + behavior = config.params["merge_config"]["behavior"] + resolve_keyed_by( task, "worker.gecko-rev", @@ -147,7 +150,7 @@ def pin_gecko_rev_yml(config, tasks): **{ "project": config.params["project"], "release-type": config.params["release_type"], - "behavior": config.params["merge_config"]["behavior"], + "behavior": behavior, }, ) @@ -183,11 +186,16 @@ def pin_gecko_rev_yml(config, tasks): "GECKO_HEAD_REF", gecko_rev_yml["GECKO_HEAD_REF"], tag_data["tag"] ) ) - replacements.extend( - mk_gecko_rev_replacement( - "GECKO_HEAD_REV", gecko_rev_yml["GECKO_HEAD_REV"], tag_data["node"] + if behavior == "comm-central-to-beta": + replacements.append( + [".gecko_rev.yml", "######", f"GECKO_HEAD_REV: {tag_data['node']}"] + ) + else: + replacements.extend( + mk_gecko_rev_replacement( + "GECKO_HEAD_REV", gecko_rev_yml["GECKO_HEAD_REV"], tag_data["node"] + ) ) - ) merge_config["replacements"].extend(replacements) diff --git a/taskcluster/kinds/merge-automation/kind.yml b/taskcluster/kinds/merge-automation/kind.yml index 95de954846..7564142c4c 100644 --- a/taskcluster/kinds/merge-automation/kind.yml +++ b/taskcluster/kinds/merge-automation/kind.yml @@ -78,5 +78,6 @@ tasks: upstream: mozilla-esr128 tag: 'FIREFOX_{major_version}_{minor_version_plus1}(_\d+)?esr_BUILD\d' base: '(FIREFOX_ESR_{major_version}_BASE|FIREFOX_{major_version}_{minor_version}(_\d+)?)esr_BUILD\d' + default: null run-on-projects: [] expiration-policy: long