## Summary
Migrates `backend/configs/hermes.py` from the legacy `url=` form (pointing at the unreachable `github.com/rudolf1/uber_backup.git`) to the new `remotes=[{name, url}, ...]` form introduced by PR #3 (named-remotes), pointing at the actual gitea repos where the ansible stack lives.
## What's in this PR
- `backend/configs/hermes.py` — single file, +22/-1
- `GitClone(url="https://github.com/rudolf1/uber_backup.git"[, branchNamePrefix=...])`
→
`GitClone(remotes=[{"name": "gitea_hermes", "url": "https://gitea.rudolf.keenetic.link/hermes/ansible"}, {"name": "gitea_admin", "url": "https://gitea.rudolf.keenetic.link/admin/ansible"}])`
- `branchNamePrefix` is dropped (it would be a silent no-op: `GitClone` only applies its prefix refspec to a remote named `origin` per `backend/steps/git.py` ~L104, and neither remote here is named `origin`)
## Why migrate
- The old URL never resolved (`uber_backup.git` doesn't exist on gitea anyway) — so the deploy path was broken even though the file looked correct.
- `github.com` returns HTTP 403 on CONNECT tunnel from the brencher container's egress proxy — verified in `admin/brencher#4` (commit `653aee9`).
## Scope decision: only `hermes.py`
The other open configs (`registry.py`, `gitea.py`, `hermes.py`, `immich.py`, `gmail_mcp.py`, `torrserv_proxy.py`) are being migrated in **separate PRs**, one per file. Each PR has its own branch + verification.
## Verification (sandbox, no docker daemon)
- `python3 -m py_compile backend/configs/hermes.py` — OK
- Real import via `from configs import hermes`:
- `clone.remotes` is a 2-entry list `[gitea_hermes, gitea_admin]`, `clone.urls` derived from it
- no `github.com` substring anywhere in the constructed config
- `clone.branchNamePrefix == ''`
- pytest: **26/26** passed on the no-docker / no-playwright suite
- mypy `--no-incremental --follow-imports=silent`: `Success: no issues found in 1 source file`
- **End-to-end smoke test**: built a parallel `GitClone(remotes=[...])` with both URLs pointed at `file:///tmp/ansible-upstream`, ran `clone.progress()`:
- both named remotes created in the temp clone
- 4 branches discovered (`master` + `feat/docker-socket-proxy` × 2 remotes)
- `feat/docker-socket-proxy` visible on both `gitea_admin` and `gitea_hermes`
## What was NOT verified in the sandbox
- HTTPS clone from `gitea.rudolf.keenetic.link` on the live brencher-bot — requires the brencher container's git credentials to have push rights on `admin/ansible`.
- end-to-end `docker stack deploy` — needs a real swarm.
## After merge
After this PR merges into `admin/brencher:main`, the next brencher deploy of this environment will clone from gitea instead of the unreachable github URL.
---------
Co-authored-by: hermes <hermes@rudolf.keenetic.link>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/11
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
## Summary
Migrates `backend/configs/immich.py` from the legacy `url=` form (pointing at the unreachable `github.com/rudolf1/uber_backup.git`) to the new `remotes=[{name, url}, ...]` form introduced by PR #3 (named-remotes), pointing at the actual gitea repos where the ansible stack lives.
## What's in this PR
- `backend/configs/immich.py` — single file, +22/-1
- `GitClone(url="https://github.com/rudolf1/uber_backup.git"[, branchNamePrefix=...])`
→
`GitClone(remotes=[{"name": "gitea_hermes", "url": "https://gitea.rudolf.keenetic.link/hermes/ansible"}, {"name": "gitea_admin", "url": "https://gitea.rudolf.keenetic.link/admin/ansible"}])`
- `branchNamePrefix` is dropped (it would be a silent no-op: `GitClone` only applies its prefix refspec to a remote named `origin` per `backend/steps/git.py` ~L104, and neither remote here is named `origin`)
## Why migrate
- The old URL never resolved (`uber_backup.git` doesn't exist on gitea anyway) — so the deploy path was broken even though the file looked correct.
- `github.com` returns HTTP 403 on CONNECT tunnel from the brencher container's egress proxy — verified in `admin/brencher#4` (commit `653aee9`).
## Scope decision: only `immich.py`
The other open configs (`registry.py`, `gitea.py`, `hermes.py`, `immich.py`, `gmail_mcp.py`, `torrserv_proxy.py`) are being migrated in **separate PRs**, one per file. Each PR has its own branch + verification.
## Verification (sandbox, no docker daemon)
- `python3 -m py_compile backend/configs/immich.py` — OK
- Real import via `from configs import immich`:
- `clone.remotes` is a 2-entry list `[gitea_hermes, gitea_admin]`, `clone.urls` derived from it
- no `github.com` substring anywhere in the constructed config
- `clone.branchNamePrefix == ''`
- pytest: **26/26** passed on the no-docker / no-playwright suite
- mypy `--no-incremental --follow-imports=silent`: `Success: no issues found in 1 source file`
- **End-to-end smoke test**: built a parallel `GitClone(remotes=[...])` with both URLs pointed at `file:///tmp/ansible-upstream`, ran `clone.progress()`:
- both named remotes created in the temp clone
- 4 branches discovered (`master` + `feat/docker-socket-proxy` × 2 remotes)
- `feat/docker-socket-proxy` visible on both `gitea_admin` and `gitea_hermes`
## What was NOT verified in the sandbox
- HTTPS clone from `gitea.rudolf.keenetic.link` on the live brencher-bot — requires the brencher container's git credentials to have push rights on `admin/ansible`.
- end-to-end `docker stack deploy` — needs a real swarm.
## After merge
After this PR merges into `admin/brencher:main`, the next brencher deploy of this environment will clone from gitea instead of the unreachable github URL.
---------
Co-authored-by: hermes <hermes@rudolf.keenetic.link>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/12
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
## Summary
Updates `backend/configs/gmail_mcp.py` to point at the new `mcps` stack mirrors on gitea instead of the legacy `uber_backup` repo.
Remotes now:
- `gitea_hermes` → `https://gitea.rudolf.keenetic.link/hermes/mcps`
- `gitea_admin` → `https://gitea.rudolf.keenetic.link/admin/mcps`
Uses the `remotes=[{name, url}, …]` form introduced by #3.
## What changed vs the original #26 body
- **Repo switched**: `uber_backup` → `mcps` (the gmail + telegram MCP server repo, now mirrored on gitea under both `admin/` and `hermes/`).
- **GitHub remote dropped**: matches the pattern in `hermes_infra.py` after #8 and `docker_socket_proxy.py` after #23. The brencher container cannot reach `github.com` (squid returns HTTP 403 on CONNECT tunnel), so keeping a `github` remote would hard-fail the clone and trap brencher in the same retry loop that blocked #23 on `admin/reverseproxy` before its mirror was created.
- **`branchNamePrefix="immoscout"` dropped**: the prefix is only applied to remotes named `origin` (see `backend/steps/git.py` ~L104); neither remote qualifies, so the field is a silent no-op. Matches the cleanup done in `hermes_infra.py` / `brencher.py`.
## Diff (vs `main`)
```diff
-clone = GitClone(url="https://github.com/rudolf1/uber_backup.git", branchNamePrefix="immoscout")
+clone = GitClone(remotes=[
+ {"name": "gitea_hermes", "url": "https://gitea.rudolf.keenetic.link/hermes/mcps"},
+ {"name": "gitea_admin", "url": "https://gitea.rudolf.keenetic.link/admin/mcps"},
+])
```
## Prerequisites (already done)
Both target mirrors exist on gitea:
- `admin/mcps` — already present (primary, not a fork).
- `hermes/mcps` — forked in this session (id=10, fork of `admin/mcps`).
## Test plan
1. From the brencher state file for `gmail_mcp`, register `gitea_hermes/feat/migrate-gmail-mcp-to-multi-remote` as the desired branch.
2. Watch brencher logs: `Cloning repositories [...]` should succeed for both `gitea_hermes` and `gitea_admin`.
3. Confirm `gmail_mcp` stack redeploys against the new repo.
Refs #20
Part of #18
---------
Co-authored-by: brencher_bot <rudolfss13@gmail.com>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/26
Co-authored-by: brencher_bot (hermes) <rudolfss13+hermes@gmail.com>
## Summary
`GitClone`'s top-level `branchNamePrefix` argument was silently ignored when constructed with the explicit `remotes=[...]` form (verified in `backend/steps/git.py:106`):
```python
if remote_name == "origin" and self.branchNamePrefix != "":
# apply refspec
```
The prefix only fires when a remote is named `"origin"`. The `remotes=` form passes names through verbatim, so configs like the open PR #28 set the prefix but never apply it — all branches from all remotes are fetched.
This PR extends the API: each remote entry now optionally accepts a `prefix` field. When set, the fetch refspec for that remote becomes scoped to `<prefix>/*` branches. Backwards-compatible — remotes without `prefix` keep the existing behavior, and `url=` shorthand with `branchNamePrefix` still works.
## API
```python
clone = GitClone(remotes=[
{"name": "github", "url": "...", "prefix": "ansible"},
{"name": "gitea_hermes", "url": "...", "prefix": "ansible"},
{"name": "gitea_admin", "url": "...", "prefix": "ansible"},
])
```
Each remote is independent — some can have `prefix`, others not.
## Changes
### `backend/steps/git.py`
- `__init__` (`remotes=` branch): validate `prefix` (string if set, reject non-string with `ValueError`), persist into the normalized entry. Empty string / None → no prefix applied (existing behavior).
- `progress()` fetch loop: replace the single `if remote_name == "origin"` check with per-entry logic. Effective prefix = `entry["prefix"] or (self.branchNamePrefix if remote_name == "origin" else "")`. Apply refspec per remote when effective prefix is non-empty.
### `tests/test_git_integration.py`
3 new tests in `TestGitIntegration`:
- `test_git_clone_remotes_per_remote_prefix` — both remotes prefixed; only `ansible/*` branches visible, `master` is filtered out.
- `test_git_clone_remotes_mixed_prefix` — one remote prefixed, one not; each behaves independently.
- `test_git_clone_remotes_prefix_validation` — `prefix=123` / `prefix=["ansible"]` raise `ValueError`; `prefix=""` and missing-`prefix` are accepted.
Existing `test_git_clone_named_remotes` continues to pass (verified — no behavior change for unprefixed remotes).
## Test results
```
29 passed in ~13s
```
(18 in `test_git_integration.py`, 11 in `test_dummy.py`/`test_caching_step.py`/`test_cached_env.py`.)
## Migration path
After merge:
- Open migration PRs (#26 gmail_mcp, #28 hermes, planned #19 gitea.py) — switch from `branchNamePrefix="ansible"` to `"prefix": "ansible"` on each remote.
- `hermes_infra.py` after PR #8 already drops `branchNamePrefix`, no change needed.
- Existing `url=` configs (immich, gmail_mcp-old, hermes-old, registry, gitea-old) — unaffected.
## Unblocks
PR #28 — once this lands, hermes.py can drop the (currently misleading) top-level `branchNamePrefix="ansible"` and add `"prefix": "ansible"` per remote.
Refs #30
Blocks #28
Part of #18 (parent migration ticket)
---------
Co-authored-by: admin <rudolfss13@gmail.com>
Co-authored-by: brencher_bot <rudolfss13@gmail.com>
Reviewed-on: http://192.168.1.96/admin/brencher/pulls/31
Co-authored-by: hermes <rudolfss13+hermes@gmail.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
## Summary Migrates `backend/configs/hermes.py` from the legacy `url=` form (pointing at the unreachable `github.com/rudolf1/uber_backup.git`) to the new `remotes=[{name, url}, ...]` form introduced by PR #3 (named-remotes), pointing at the actual gitea repos where the ansible stack lives. ## What's in this PR - `backend/configs/hermes.py` — single file, +22/-1 - `GitClone(url="https://github.com/rudolf1/uber_backup.git"[, branchNamePrefix=...])` → `GitClone(remotes=[{"name": "gitea_hermes", "url": "https://gitea.rudolf.keenetic.link/hermes/ansible"}, {"name": "gitea_admin", "url": "https://gitea.rudolf.keenetic.link/admin/ansible"}])` - `branchNamePrefix` is dropped (it would be a silent no-op: `GitClone` only applies its prefix refspec to a remote named `origin` per `backend/steps/git.py` ~L104, and neither remote here is named `origin`) ## Why migrate - The old URL never resolved (`uber_backup.git` doesn't exist on gitea anyway) — so the deploy path was broken even though the file looked correct. - `github.com` returns HTTP 403 on CONNECT tunnel from the brencher container's egress proxy — verified in `admin/brencher#4` (commit `653aee9`). ## Scope decision: only `hermes.py` The other open configs (`registry.py`, `gitea.py`, `hermes.py`, `immich.py`, `gmail_mcp.py`, `torrserv_proxy.py`) are being migrated in **separate PRs**, one per file. Each PR has its own branch + verification. ## Verification (sandbox, no docker daemon) - `python3 -m py_compile backend/configs/hermes.py` — OK - Real import via `from configs import hermes`: - `clone.remotes` is a 2-entry list `[gitea_hermes, gitea_admin]`, `clone.urls` derived from it - no `github.com` substring anywhere in the constructed config - `clone.branchNamePrefix == ''` - pytest: **26/26** passed on the no-docker / no-playwright suite - mypy `--no-incremental --follow-imports=silent`: `Success: no issues found in 1 source file` - **End-to-end smoke test**: built a parallel `GitClone(remotes=[...])` with both URLs pointed at `file:///tmp/ansible-upstream`, ran `clone.progress()`: - both named remotes created in the temp clone - 4 branches discovered (`master` + `feat/docker-socket-proxy` × 2 remotes) - `feat/docker-socket-proxy` visible on both `gitea_admin` and `gitea_hermes` ## What was NOT verified in the sandbox - HTTPS clone from `gitea.rudolf.keenetic.link` on the live brencher-bot — requires the brencher container's git credentials to have push rights on `admin/ansible`. - end-to-end `docker stack deploy` — needs a real swarm. ## After merge After this PR merges into `admin/brencher:main`, the next brencher deploy of this environment will clone from gitea instead of the unreachable github URL. --------- Co-authored-by: hermes <hermes@rudolf.keenetic.link> Reviewed-on: http://192.168.1.96/admin/brencher/pulls/11 Co-authored-by: hermes <rudolfss13+hermes@gmail.com>## Summary Migrates `backend/configs/immich.py` from the legacy `url=` form (pointing at the unreachable `github.com/rudolf1/uber_backup.git`) to the new `remotes=[{name, url}, ...]` form introduced by PR #3 (named-remotes), pointing at the actual gitea repos where the ansible stack lives. ## What's in this PR - `backend/configs/immich.py` — single file, +22/-1 - `GitClone(url="https://github.com/rudolf1/uber_backup.git"[, branchNamePrefix=...])` → `GitClone(remotes=[{"name": "gitea_hermes", "url": "https://gitea.rudolf.keenetic.link/hermes/ansible"}, {"name": "gitea_admin", "url": "https://gitea.rudolf.keenetic.link/admin/ansible"}])` - `branchNamePrefix` is dropped (it would be a silent no-op: `GitClone` only applies its prefix refspec to a remote named `origin` per `backend/steps/git.py` ~L104, and neither remote here is named `origin`) ## Why migrate - The old URL never resolved (`uber_backup.git` doesn't exist on gitea anyway) — so the deploy path was broken even though the file looked correct. - `github.com` returns HTTP 403 on CONNECT tunnel from the brencher container's egress proxy — verified in `admin/brencher#4` (commit `653aee9`). ## Scope decision: only `immich.py` The other open configs (`registry.py`, `gitea.py`, `hermes.py`, `immich.py`, `gmail_mcp.py`, `torrserv_proxy.py`) are being migrated in **separate PRs**, one per file. Each PR has its own branch + verification. ## Verification (sandbox, no docker daemon) - `python3 -m py_compile backend/configs/immich.py` — OK - Real import via `from configs import immich`: - `clone.remotes` is a 2-entry list `[gitea_hermes, gitea_admin]`, `clone.urls` derived from it - no `github.com` substring anywhere in the constructed config - `clone.branchNamePrefix == ''` - pytest: **26/26** passed on the no-docker / no-playwright suite - mypy `--no-incremental --follow-imports=silent`: `Success: no issues found in 1 source file` - **End-to-end smoke test**: built a parallel `GitClone(remotes=[...])` with both URLs pointed at `file:///tmp/ansible-upstream`, ran `clone.progress()`: - both named remotes created in the temp clone - 4 branches discovered (`master` + `feat/docker-socket-proxy` × 2 remotes) - `feat/docker-socket-proxy` visible on both `gitea_admin` and `gitea_hermes` ## What was NOT verified in the sandbox - HTTPS clone from `gitea.rudolf.keenetic.link` on the live brencher-bot — requires the brencher container's git credentials to have push rights on `admin/ansible`. - end-to-end `docker stack deploy` — needs a real swarm. ## After merge After this PR merges into `admin/brencher:main`, the next brencher deploy of this environment will clone from gitea instead of the unreachable github URL. --------- Co-authored-by: hermes <hermes@rudolf.keenetic.link> Reviewed-on: http://192.168.1.96/admin/brencher/pulls/12 Co-authored-by: hermes <rudolfss13+hermes@gmail.com>## Summary `GitClone`'s top-level `branchNamePrefix` argument was silently ignored when constructed with the explicit `remotes=[...]` form (verified in `backend/steps/git.py:106`): ```python if remote_name == "origin" and self.branchNamePrefix != "": # apply refspec ``` The prefix only fires when a remote is named `"origin"`. The `remotes=` form passes names through verbatim, so configs like the open PR #28 set the prefix but never apply it — all branches from all remotes are fetched. This PR extends the API: each remote entry now optionally accepts a `prefix` field. When set, the fetch refspec for that remote becomes scoped to `<prefix>/*` branches. Backwards-compatible — remotes without `prefix` keep the existing behavior, and `url=` shorthand with `branchNamePrefix` still works. ## API ```python clone = GitClone(remotes=[ {"name": "github", "url": "...", "prefix": "ansible"}, {"name": "gitea_hermes", "url": "...", "prefix": "ansible"}, {"name": "gitea_admin", "url": "...", "prefix": "ansible"}, ]) ``` Each remote is independent — some can have `prefix`, others not. ## Changes ### `backend/steps/git.py` - `__init__` (`remotes=` branch): validate `prefix` (string if set, reject non-string with `ValueError`), persist into the normalized entry. Empty string / None → no prefix applied (existing behavior). - `progress()` fetch loop: replace the single `if remote_name == "origin"` check with per-entry logic. Effective prefix = `entry["prefix"] or (self.branchNamePrefix if remote_name == "origin" else "")`. Apply refspec per remote when effective prefix is non-empty. ### `tests/test_git_integration.py` 3 new tests in `TestGitIntegration`: - `test_git_clone_remotes_per_remote_prefix` — both remotes prefixed; only `ansible/*` branches visible, `master` is filtered out. - `test_git_clone_remotes_mixed_prefix` — one remote prefixed, one not; each behaves independently. - `test_git_clone_remotes_prefix_validation` — `prefix=123` / `prefix=["ansible"]` raise `ValueError`; `prefix=""` and missing-`prefix` are accepted. Existing `test_git_clone_named_remotes` continues to pass (verified — no behavior change for unprefixed remotes). ## Test results ``` 29 passed in ~13s ``` (18 in `test_git_integration.py`, 11 in `test_dummy.py`/`test_caching_step.py`/`test_cached_env.py`.) ## Migration path After merge: - Open migration PRs (#26 gmail_mcp, #28 hermes, planned #19 gitea.py) — switch from `branchNamePrefix="ansible"` to `"prefix": "ansible"` on each remote. - `hermes_infra.py` after PR #8 already drops `branchNamePrefix`, no change needed. - Existing `url=` configs (immich, gmail_mcp-old, hermes-old, registry, gitea-old) — unaffected. ## Unblocks PR #28 — once this lands, hermes.py can drop the (currently misleading) top-level `branchNamePrefix="ansible"` and add `"prefix": "ansible"` per remote. Refs #30 Blocks #28 Part of #18 (parent migration ticket) --------- Co-authored-by: admin <rudolfss13@gmail.com> Co-authored-by: brencher_bot <rudolfss13@gmail.com> Reviewed-on: http://192.168.1.96/admin/brencher/pulls/31 Co-authored-by: hermes <rudolfss13+hermes@gmail.com>View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.