Skip to content

Commit 3564843

Browse files
authored
config: add config-production-thunderbird.toml (bug 2012575) (#83)
* Add configuration for thunderbird worker * Cover thunderbird and firefox config in tests (and make noop fx config pass the tests) * Add `config-suite.toml` to gitignore
1 parent 079be7a commit 3564843

File tree

5 files changed

+120
-13
lines changed

5 files changed

+120
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/config.toml
66
/pidfile
77
/tests_output
8+
config-suite.toml

config-production-firefox.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,32 @@ sentry_dsn = ""
1717

1818
[clones]
1919
directory = "/clones"
20+
21+
###########
22+
# FIREFOX #
23+
###########
24+
25+
[[tracked_repositories]]
26+
name = "firefox"
27+
url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE"
28+
29+
30+
#
31+
# MOZILLA-UNIFIED
32+
#
33+
# We don't sync to this repository, but we put it here first to fetch all
34+
# references early, with the benefit of bundles.
35+
#
36+
[[branch_mappings]]
37+
source_url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE"
38+
branch_pattern = "THIS_SHOULD_MATCH_NOTHING"
39+
destination_url = "https://hg.mozilla.org/mozilla-unified/"
40+
destination_branch = "NOT_A_VALID_BRANCH"
41+
42+
[[tag_mappings]]
43+
source_url = "https://github.com/mozilla-firefox/firefox.git_NOT_YET_IN_USE"
44+
tag_pattern = "THIS_SHOULD_MATCH_NOTHING"
45+
destination_url = "https://hg.mozilla.org/mozilla-unified/"
46+
tags_destination_branch = "NOT_A_VALID_BRANCH"
47+
# Default
48+
#tag_message_suffix = "a=tagging CLOSED TREE DONTBUILD"

config-production-thunderbird.toml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
[pulse]
2+
# Those parameters can be overriden by PULSE_* environment variables
3+
host = "pulse.mozilla.org"
4+
port = 5671
5+
ssl = true
6+
userid = "SET THIS IN PULSE_USERID ENV VARIABLE"
7+
password = "SET THIS IN PULSE_PASSWORD ENV VARIABLE"
8+
# The exchange is declared by the Producer.
9+
exchange = "exchange/landoprod/pushes"
10+
routing_key = "gitpushes"
11+
# The Consumer declares the queue and binds it to the exchange.
12+
heartbeat = 30
13+
queue = "queue/githgsyncprod/pushes"
14+
15+
[sentry]
16+
sentry_dsn = ""
17+
18+
[clones]
19+
directory = "/clones"
20+
21+
#############################
22+
# THUNDERBIRD-INFRA-TESTING #
23+
#############################
24+
25+
[[tracked_repositories]]
26+
name = "thunderbird-infra-testing"
27+
url = "https://github.com/thunderbird/infra-testing.git"
28+
29+
#
30+
# COMM-UNIFIED
31+
#
32+
# We don't sync to this repository, but we put it here first to fetch all
33+
# references early, with the benefit of bundles.
34+
#
35+
[[branch_mappings]]
36+
source_url = "https://github.com/thunderbird/infra-testing.git"
37+
branch_pattern = "THIS_SHOULD_MATCH_NOTHING"
38+
destination_url = "https://hg.mozilla.org/comm-unified/"
39+
destination_branch = "NOT_A_VALID_BRANCH"
40+
41+
[[branch_mappings]]
42+
source_url = "https://github.com/thunderbird/infra-testing.git"
43+
branch_pattern = "main"
44+
destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/"
45+
destination_branch = "default"
46+
47+
[[tag_mappings]]
48+
source_url = "https://github.com/thunderbird/infra-testing.git"
49+
50+
# comm-central:
51+
# tag_pattern = ".+"
52+
# destination_url = "ssh://hg.mozilla.org/comm-central"
53+
# tags_destination_branch = "tags-testing"
54+
55+
# comm-beta:
56+
# tag_pattern = "(^THUNDERBIRD|NIGHTLY|BETA|RELEASE)_.*$"
57+
# destination_url = "ssh://hg.mozilla.org/releases/comm-beta/"
58+
# tags_destination_branch = "tags-unified"
59+
60+
# comm-release:
61+
# tag_pattern = "(^THUNDERBIRD|NIGHTLY|BETA|RELEASE)_.*$"
62+
# destination_url = "ssh://hg.mozilla.org/releases/comm-release/"
63+
# tags_destination_branch = "tags-unified"
64+
65+
# comm-esrXXX
66+
# tag_pattern = "^(THUNDERBIRD)_(\\d+)(_\\d+)+esr_(BUILD\\d+|RELEASE)$"
67+
# destination_url = "ssh://hg.mozilla.org/releases/comm-esr\\2/"
68+
# tags_destination_branch = "tags-unified"
69+
# ...
70+
# tag_pattern = "^ESR_(\\d+)_BASE$"
71+
# destination_url = "ssh://hg.mozilla.org/releases/comm-esr\\1/"
72+
# tags_destination_branch = "tags-unified"
73+
74+
tag_pattern = ".+"
75+
destination_url = "ssh://hg.mozilla.org/conduit-testing/comm-infra-testing/"
76+
tags_destination_branch = "tags-testing"
77+
# Default
78+
#tag_message_suffix = "a=tagging CLOSED TREE DONTBUILD"

config-suite.toml

Whitespace-only changes.

tests/test_config_files.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
from pathlib import Path
22

33
import pytest
4+
from pydantic import ValidationError
45

56
from git_hg_sync.config import Config
67

7-
HERE = Path(__file__).parent
8+
BASEDIR = Path(__file__).parent.parent
89

910

1011
@pytest.mark.parametrize(
1112
"config_file",
12-
[
13-
"config-development.toml",
14-
"config-docker.toml",
15-
"config-production.toml",
16-
"config-staging.toml",
17-
],
13+
list(BASEDIR.glob("config-*.toml"))
1814
)
19-
def test_config_files(config_file: str) -> None:
20-
config = Config.from_file(HERE / ".." / config_file)
15+
def test_config_files(config_file: Path) -> None:
16+
try:
17+
config = Config.from_file(config_file)
18+
except ValidationError as exc:
19+
raise AssertionError(f"Syntax in {config_file}") from exc
2120

2221
# We just do a shallow verification. What we really care is that the file could be
2322
# loaded correctly.
24-
assert config.pulse
25-
assert config.tracked_repositories
26-
assert config.branch_mappings
27-
assert config.tag_mappings
23+
assert config.pulse, f"`pulse` section missing in {config_file}"
24+
assert config.tracked_repositories, f"`tracked_repositories` section missing in {config_file}"
25+
assert config.branch_mappings, f"`branch_mappings` section missing in {config_file}"
26+
assert config.tag_mappings, f"`tag_mappings` section missing in {config_file}"

0 commit comments

Comments
 (0)