ci(brencher): OpenAPI client generation + type verification workflows #44

Open
hermes wants to merge 14 commits from hermes/brencher:copilot/rewrite-ui-to-typescript into main
Contributor

Adds two GitHub Actions workflows under .github/workflows/:

  • generate-openapi-client.yml — generates JS + python-fastapi clients from openapi.yaml on push
  • verify-openapi-types.yml — verifies generated client on PR
    Both use openapitools/openapi-generator-cli@v2.5.0 and Java 17.
Adds two GitHub Actions workflows under `.github/workflows/`: - `generate-openapi-client.yml` — generates JS + python-fastapi clients from `openapi.yaml` on push - `verify-openapi-types.yml` — verifies generated client on PR Both use `openapitools/openapi-generator-cli@v2.5.0` and Java 17.
admin changed target branch from main_corrupted to main 2026-10-05 16:35:18 +02:00
admin added 14 commits 2026-10-05 16:35:18 +02:00
openapi generated client
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 30s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 32s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 32s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Failing after 52s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 30s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 34s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m28s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m35s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m30s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 31s
Python package / build (pip list, 3.13) (pull_request) Successful in 33s
Python package / build (pip list, 3.14) (pull_request) Successful in 31s
Python package / build (pytest --ignore=tests/integration, 3.12.3) (pull_request) Successful in 43s
Python package / build (pytest --ignore=tests/integration, 3.13) (pull_request) Successful in 46s
Python package / build (pytest --ignore=tests/integration, 3.14) (pull_request) Successful in 42s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Successful in 29s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Successful in 29s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Successful in 28s
Verify OpenAPI types / Verify generated TypeScript matches committed types (pull_request) Successful in 3m15s
fab47acc95
Merge remote-tracking branch 'upstream/main' into tmp-fix-copilot-rewrite-ui-to-typescript
Verify OpenAPI types / Verify generated TypeScript matches committed types (pull_request) Canceled after 0s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Canceled after 0s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Canceled after 0s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Canceled after 0s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Canceled after 0s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Canceled after 0s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Canceled after 0s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Canceled after 0s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Canceled after 0s
Python package / build (pip list, 3.12.3) (pull_request) Canceled after 0s
Python package / build (pip list, 3.13) (pull_request) Canceled after 0s
Python package / build (pip list, 3.14) (pull_request) Canceled after 0s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.12.3) (pull_request) Canceled after 0s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.13) (pull_request) Canceled after 0s
Python package / build (python -c "import sys; print(f'Python {sys.version}'); print(f'Build: {sys.version_info}'); print(f'Implementation: {sys.implementation}')", 3.14) (pull_request) Canceled after 0s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Canceled after 12s
278253f6eb
# Conflicts:
#	Dockerfile
#	backend/app.py
#	frontend/app.js
#	frontend/index.html
#	frontend/styles.css
feat(configs): point hermes at gitea admin/hermes ansible repos (#11)
Merge main to all / rebase (push) Canceled after 0s
Python package / build (3.12.3) (push) Canceled after 0s
Python package / build (3.13) (push) Canceled after 0s
Python package / build (3.14) (push) Canceled after 0s
694c28109d
## 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>
feat(configs): point immich at gitea admin/hermes ansible repos (#12)
Merge main to all / rebase (push) Canceled after 0s
Python package / build (3.12.3) (push) Canceled after 0s
Python package / build (3.13) (push) Canceled after 0s
Python package / build (3.14) (push) Canceled after 0s
fa9f8791bd
## 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>
feat(configs): point gmail_mcp at gitea admin/hermes mcps repos (#26)
Merge main to all / rebase (push) Canceled after 0s
Python package / build (3.12.3) (push) Canceled after 0s
Python package / build (3.13) (push) Canceled after 0s
Python package / build (3.14) (push) Canceled after 0s
272504eab3
## 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>
feat(git): per-remote branch prefix filtering for multi-remote GitClone (#31)
Merge main to all / rebase (push) Failing after 31s
Python package / build (3.12.3) (push) Failing after 2m28s
Python package / build (3.13) (push) Failing after 2m29s
Python package / build (3.14) (push) Failing after 2m38s
Python package / build (3.12.3) (pull_request) Failing after 2m17s
Python package / build (3.13) (pull_request) Canceled after 55s
Python package / build (3.14) (pull_request) Canceled after 0s
99f8b73654
## 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>
Merge remote-tracking branch 'gitea/main' into main_corrupted
Python package / build (3.12.3) (pull_request) Failing after 2m31s
Python package / build (3.13) (pull_request) Failing after 2m20s
Python package / build (3.14) (pull_request) Failing after 2m39s
60b5af79fc
fix(tests): add type ignore for non-string prefix in GitClone tests
Python package / build (3.12.3) (pull_request) Successful in 2m23s
Python package / build (3.13) (pull_request) Successful in 2m29s
Python package / build (3.14) (pull_request) Successful in 2m30s
74bf5aefa2
Merge remote-tracking branch 'origin/main' into main_corrupted
Python package / build (3.12.3) (pull_request) Successful in 2m21s
Python package / build (3.13) (pull_request) Successful in 2m19s
Python package / build (3.14) (pull_request) Successful in 2m27s
71d1e1c1af
Merge remote-tracking branch 'origin/main' into main_corrupted
Python package / build (3.12.3) (pull_request) Successful in 2m19s
Python package / build (3.13) (pull_request) Successful in 2m27s
Python package / build (3.14) (pull_request) Successful in 2m27s
8219b743cf
Merge remote-tracking branch 'origin/main' into main_corrupted
Python package / build (3.12.3) (pull_request) Successful in 2m22s
Python package / build (3.13) (pull_request) Successful in 2m35s
Python package / build (3.14) (pull_request) Successful in 2m52s
d5a7bc1e4e
Merge branch 'main_corrupted' into copilot/rewrite-ui-to-typescript
Verify OpenAPI types / Verify generated TypeScript matches committed types (pull_request) Successful in 3m12s
7bee9dc133
All checks were successful
Verify OpenAPI types / Verify generated TypeScript matches committed types (pull_request) Successful in 3m12s
This pull request has changes conflicting with the target branch.
  • backend/steps/git.py
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u https://gitea.rudolf.keenetic.link/hermes/brencher copilot/rewrite-ui-to-typescript:hermes-copilot/rewrite-ui-to-typescript
git checkout hermes-copilot/rewrite-ui-to-typescript
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/brencher#44