docker: project layout updates (bug 1940614)#23
Conversation
8ec0efd to
779e040
Compare
| [[tracked_repositories]] | ||
| name = "firefox-releases" | ||
| url = "/home/fbessou/dev/MOZI/fake-forge/git/firefox-releases" | ||
|
|
||
| [[branch_mappings]] | ||
| source_url = "/home/fbessou/dev/MOZI/fake-forge/git/firefox-releases" | ||
| branch_pattern = "^(esr\\d+)$" | ||
| destination_url = "/home/fbessou/dev/MOZI/fake-forge/hg/mozilla-\\1" | ||
| destination_branch = "default" | ||
|
|
||
| [[tag_mappings]] | ||
| source_url = "/home/fbessou/dev/MOZI/fake-forge/git/firefox-releases" | ||
| tag_pattern = "^FIREFOX_BETA_(\\d+)_(BASE|END)$" | ||
| destination_url = "/home/fbessou/dev/MOZI/fake-forge/hg/mozilla-beta" | ||
| tags_destination_branch = "tags" |
There was a problem hiding this comment.
We'll need to populate something more local at some point.
3babf19 to
1d72c6e
Compare
|
@cgsheeh git-hg-sync PR |
4db0574 to
831f18a
Compare
e8daffa to
70bc43b
Compare
group branch and tag mappings by target
config-docker.toml
Outdated
| [[branch_mappings]] | ||
| source_url = "/clones/test-repo-git" | ||
| branch_pattern = "beta" | ||
| destination_url = "/clones/mozilla-beta" # also, m-c |
There was a problem hiding this comment.
We do have a dev conduit-testing/m-c repo, so would be good to be more explicit about this here. But not sure what this comment means?
There was a problem hiding this comment.
Hum, I think this was a note-to-self more than anything else. It evolved into #24.
The docker-local test setup uses http://github.com/mozilla-conduit/test-repo as a base, and create all the test repos, so it's not really M-C. My reasoning was that it would be overkill [most of the time] to bandy around multiple copies of M-C.
create_clones.sh
Outdated
| # make git status and friends faster: | ||
| # mv .git/hooks/fsmonitor-watchman.sample .git/hooks/query-watchman | ||
| # git config core.fsmonitor .git/hooks/query-watchman | ||
| # add git origin | ||
| # git remote add git_chatzilla http://github.com/djangoliv/chatzilla.git |
There was a problem hiding this comment.
Should this code be removed?
There was a problem hiding this comment.
Fixed. I left the fsmonitor bit as I suspect it could be useful later, but the rest of the comments are no longer needed.
git_hg_sync/pulse_worker.py
Outdated
| return | ||
|
|
||
| if not isinstance(body, dict): | ||
| breakpoint() |
| try: | ||
| if self.event_handler: | ||
| self.event_handler(event) | ||
| except: # noqa: E722 |
There was a problem hiding this comment.
Is there something better here we could do to handle the exception?
There was a problem hiding this comment.
Not really, this is a last-resort catch-all in case we don't know what led to the exception (and therefore how to handle it).
The goal is to make sure we reject the message and re-queue it, rather than dropping it and forgetting all about it, which could lead to inconsistencies in the synced data.
| "hashing_algorithm": "rabbit_password_hashing_sha256", | ||
| "limits": {}, | ||
| "name": "guest", | ||
| "password_hash": "ywxQjVk0n/qwUfbLIf7L2tJIXrNLfM1bd1GoMeJSzZiRMWSd", |
There was a problem hiding this comment.
How are these values overridden?
There was a problem hiding this comment.
RabbitMQ is only here for local testing, so I don't think we need to.
Co-authored-by: Zeid <2043828+zzzeid@users.noreply.github.com>
7a9af4c to
b91fe2c
Compare
and other conditions
put entrypoint outside of app code
Dockerfile
Outdated
| RUN pip-compile --verbose pyproject.toml \ | ||
| && pip install -r requirements.txt | ||
|
|
||
| RUN echo '[ui]\nssh = ssh -oStrictHostKeyChecking=accept-new' >> /etc/mercurial/hgrc \ |
There was a problem hiding this comment.
Nit: we could put the hgrc in a separate file and COPY it into the image.
| # Allow to override Pulse parameters via environment. | ||
| for config in self.pulse.model_fields: | ||
| env_var = f"PULSE_{config}".upper() | ||
| if value := os.getenv(env_var): | ||
| setattr(self.pulse, config, value) |
There was a problem hiding this comment.
We could log updates here, to avoid confusion if it breaks something.
| user: str | ||
| push_json_url: str | ||
|
|
||
| Event = Push |
There was a problem hiding this comment.
Any reason not rename Push to Event in the class definition?
There was a problem hiding this comment.
I'd like to retain the ability to handle other events, even if we are down to 1 at the moment.
Setup and document the project so a standalone syncer can be stood up and manually tested in isolation.
This also adds support for overriding the parameters of the Pulse queue via environment variables, as needed by mozilla-conduit/suite#66.
Looking forwards: more generally, we'll have to override repository and branch configuration per deployment environment. Doing so via env variables will quickly explode. Another option would be to bake (all) per-env configuration files within the source here and into the container image, and select which configuration to use via a single env variable when deploying the container.
This is left for future work, in #24.