From 8fb65baee2106b1673998c30b150c2a09dd5c105 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 3 Mar 2026 12:37:32 +1100 Subject: [PATCH 1/6] config: add config-production-thunderbird.toml (bug 2012575) --- config-production-thunderbird.toml | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 config-production-thunderbird.toml diff --git a/config-production-thunderbird.toml b/config-production-thunderbird.toml new file mode 100644 index 0000000..c9a6e90 --- /dev/null +++ b/config-production-thunderbird.toml @@ -0,0 +1,54 @@ +[pulse] +# Those parameters can be overriden by PULSE_* environment variables +host = "pulse.mozilla.org" +port = 5671 +ssl = true +userid = "SET THIS IN PULSE_USERID ENV VARIABLE" +password = "SET THIS IN PULSE_PASSWORD ENV VARIABLE" +# The exchange is declared by the Producer. +exchange = "exchange/landoprod/pushes" +routing_key = "gitpushes" +# The Consumer declares the queue and binds it to the exchange. +heartbeat = 30 +queue = "queue/githgsyncprod/pushes" + +[sentry] +sentry_dsn = "" + +[clones] +directory = "/clones" + +############################# +# THUNDERBIRD-INFRA-TESTING # +############################# + +[[tracked_repositories]] +name = "thunderbird-infra-testing" +url = "https://github.com/thunderbird/infra-testing.git" + +# +# COMM-UNIFIED +# +# We don't sync to this repository, but we put it here first to fetch all +# references early, with the benefit of bundles. +# +[[branch_mappings]] +source_url = "https://github.com/thunderbird/infra-testing.git" +branch_pattern = "THIS_SHOULD_MATCH_NOTHING" +destination_url = "https://hg.mozilla.org/comm-unified/" +destination_branch = "NOT_A_VALID_BRANCH" + +[[branch_mappings]] +source_url = "https://github.com/thunderbird/infra-testing.git" +branch_pattern = "main" +destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/" +destination_branch = "default" + +[[tag_mappings]] +source_url = "https://github.com/thunderbird/infra-testing.git" +# (BETA|NIGHTLY)_(\d+)_(BASE|END) +tag_pattern = ".+" +destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/" +tags_destination_branch = "tags-testing" +# Default +#tag_message_suffix = "a=tagging CLOSED TREE DONTBUILD" From 4eefc99f091a5e710c4f1b5b692d3b0d35d99566 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 3 Mar 2026 12:45:37 +1100 Subject: [PATCH 2/6] tests: improve test_config_files to cover all test_config_files --- config-suite.toml | 0 tests/test_config_files.py | 25 ++++++++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 config-suite.toml diff --git a/config-suite.toml b/config-suite.toml deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_config_files.py b/tests/test_config_files.py index b4fddf3..ebf3c90 100644 --- a/tests/test_config_files.py +++ b/tests/test_config_files.py @@ -1,27 +1,26 @@ from pathlib import Path import pytest +from pydantic import ValidationError from git_hg_sync.config import Config -HERE = Path(__file__).parent +BASEDIR = Path(__file__).parent.parent @pytest.mark.parametrize( "config_file", - [ - "config-development.toml", - "config-docker.toml", - "config-production.toml", - "config-staging.toml", - ], + list(BASEDIR.glob("config-*.toml")) ) -def test_config_files(config_file: str) -> None: - config = Config.from_file(HERE / ".." / config_file) +def test_config_files(config_file: Path) -> None: + try: + config = Config.from_file(config_file) + except ValidationError as exc: + raise AssertionError(f"Syntax in {config_file}") from exc # We just do a shallow verification. What we really care is that the file could be # loaded correctly. - assert config.pulse - assert config.tracked_repositories - assert config.branch_mappings - assert config.tag_mappings + assert config.pulse, f"`pulse` section missing in {config_file}" + assert config.tracked_repositories, f"`tracked_repositories` section missing in {config_file}" + assert config.branch_mappings, f"`branch_mappings` section missing in {config_file}" + assert config.tag_mappings, f"`tag_mappings` section missing in {config_file}" From df855bf5d031a6e7c0cdbb2dda0506dbc33d2b4c Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 3 Mar 2026 14:09:49 +1100 Subject: [PATCH 3/6] config: add noop entry to fx config to pass tests --- config-production-firefox.toml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/config-production-firefox.toml b/config-production-firefox.toml index 9e31c1d..fe7a914 100644 --- a/config-production-firefox.toml +++ b/config-production-firefox.toml @@ -17,3 +17,32 @@ sentry_dsn = "" [clones] directory = "/clones" + +########### +# FIREFOX # +########### + +[[tracked_repositories]] +name = "firefox" +url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE" + + +# +# MOZILLA-UNIFIED +# +# We don't sync to this repository, but we put it here first to fetch all +# references early, with the benefit of bundles. +# +[[branch_mappings]] +source_url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE" +branch_pattern = "THIS_SHOULD_MATCH_NOTHING" +destination_url = "https://hg.mozilla.org/mozilla-unified/" +destination_branch = "NOT_A_VALID_BRANCH" + +[[tag_mappings]] +source_url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE" +tag_pattern = "THIS_SHOULD_MATCH_NOTHING" +destination_url = "https://hg.mozilla.org/mozilla-unified/" +tags_destination_branch = "NOT_A_VALID_BRANCH" +# Default +#tag_message_suffix = "a=tagging CLOSED TREE DONTBUILD" From f9c3cfd4295db023eb762d3e2c9b6438b472c9e0 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 3 Mar 2026 14:30:44 +1100 Subject: [PATCH 4/6] config: document more prod tags for thunderbird (bug 2012575) --- config-production-thunderbird.toml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config-production-thunderbird.toml b/config-production-thunderbird.toml index c9a6e90..011a9e0 100644 --- a/config-production-thunderbird.toml +++ b/config-production-thunderbird.toml @@ -46,7 +46,17 @@ destination_branch = "default" [[tag_mappings]] source_url = "https://github.com/thunderbird/infra-testing.git" -# (BETA|NIGHTLY)_(\d+)_(BASE|END) +# (NIGHTLY)_(\d+)_(BASE|END) +# (BETA)_(\d+)_(BASE|END) +# (RELEASE)_(\d+)_(BASE|END) +# tag_pattern = "^(THUNDERBIRD)_.*$" +# destination_url = "ssh://hg.mozilla.org/releases/comm-beta/" +# RELEASES +# tag_pattern = "^(THUNDERBIRD)_.*$" +# destination_url = "ssh://hg.mozilla.org/releases/comm-release/" +# ESR +# tag_pattern = "^(THUNDERBIRD)_(\\d+)(_\\d+)+esr_(BUILD\\d+|RELEASE)$" +# destination_url = "ssh://hg.mozilla.org/releases/comm-esr\\2/" tag_pattern = ".+" destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/" tags_destination_branch = "tags-testing" From c3a4d77a76b61c671dda630ce4a43795a3b1947e Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 10 Mar 2026 13:10:27 +1100 Subject: [PATCH 5/6] fixup! config: document more prod tags for thunderbird (bug 2012575) --- config-production-thunderbird.toml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/config-production-thunderbird.toml b/config-production-thunderbird.toml index 011a9e0..c94dd5d 100644 --- a/config-production-thunderbird.toml +++ b/config-production-thunderbird.toml @@ -46,17 +46,31 @@ destination_branch = "default" [[tag_mappings]] source_url = "https://github.com/thunderbird/infra-testing.git" -# (NIGHTLY)_(\d+)_(BASE|END) -# (BETA)_(\d+)_(BASE|END) -# (RELEASE)_(\d+)_(BASE|END) -# tag_pattern = "^(THUNDERBIRD)_.*$" + +# comm-central: +# tag_pattern = ".+" +# destination_url = "ssh://hg.mozilla.org/comm-central" +# tags_destination_branch = "tags-testing" + +# comm-beta: +# tag_pattern = "(^THUNDERBIRD|NIGHTLY|BETA|RELEASE)_.*$" # destination_url = "ssh://hg.mozilla.org/releases/comm-beta/" -# RELEASES -# tag_pattern = "^(THUNDERBIRD)_.*$" +# tags_destination_branch = "tags-unified" + +# comm-release: +# tag_pattern = "(^THUNDERBIRD|NIGHTLY|BETA|RELEASE)_.*$" # destination_url = "ssh://hg.mozilla.org/releases/comm-release/" -# ESR +# tags_destination_branch = "tags-unified" + +# comm-esrXXX # tag_pattern = "^(THUNDERBIRD)_(\\d+)(_\\d+)+esr_(BUILD\\d+|RELEASE)$" # destination_url = "ssh://hg.mozilla.org/releases/comm-esr\\2/" +# tags_destination_branch = "tags-unified" +# ... +# tag_pattern = "^ESR_(\\d+)_BASE$" +# destination_url = "ssh://hg.mozilla.org/releases/comm-esr\\1/" +# tags_destination_branch = "tags-unified" + tag_pattern = ".+" destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/" tags_destination_branch = "tags-testing" From 03bb6f95136f5c543f398cba92c64c6cab86f586 Mon Sep 17 00:00:00 2001 From: Olivier Mehani Date: Tue, 10 Mar 2026 14:44:49 +1100 Subject: [PATCH 6/6] git: ignore config-suite (created by docker mounts) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a043aad..5a8bd18 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /config.toml /pidfile /tests_output +config-suite.toml