feat(torrserv_proxy): delegate docker build to GitHub Action #35

Open
hermes wants to merge 4 commits from hermes/brencher:feature/trigger-build-via-action into main_corrupted
Contributor

What

Replaces the inline DockerComposeBuild step in the torrserv_proxy config with a new GitHubActionTrigger step. Brencher no longer builds the image itself; it POSTs to /api/v1/repos/admin/reverseproxy/actions/workflows/build.yml/dispatches on the merge commit SHA, then polls the run to completion.

Files

  • backend/steps/git.py -- CheckoutMerged gets a new push_branch_template: str | None knob. When set, the merge commit is force-pushed to a branch whose name is built from the template (we use auto-deploy/torrserv_proxy/{commit_sha} here). CheckoutAndMergeResult gets a matching push_branch: str | None field so downstream steps can find it.
  • backend/steps/github_action.py -- new step. Dispatches a workflow on a configurable owner/repo (currently admin/reverseproxy), polls every poll_interval_seconds (default 15s) until status == completed, raises if conclusion != "success", otherwise returns the run id and the optional image_tag output.
  • backend/configs/torrserv_proxy.py -- wires it together: checkoutMerged gets push_branch_template="auto-deploy/torrserv_proxy/{commit_sha}", the new triggerAction step replaces buildDocker, and deployDocker.buildDocker=None.

Why

Closes the inline-docker-build loop in brencher for one stack, as a pilot for #34. The same GitHubActionTrigger will be reusable for any stack that wants to offload build to a per-repo workflow.

Required env / secrets

  • BRENCHER_GITEA_TOKEN -- a Gitea token with repo + actions scope on admin/reverseproxy.
  • The companion workflow admin/reverseproxy/.github/workflows/build.yml must already exist (it does, see admin/reverseproxy#1).

Deploy step

Left as-is per Alex's direction. deployDocker remains in the pipeline; only buildDocker=None.

Open items

  • DockerSwarmDeploy reads the image tag from envs=lambda: {"version": "auto-"+checkoutMerged.progress().version}. The action now produces its own auto-<ref> tag. Need to wire GitHubActionTrigger.progress().image_tag into deployDocker.envs once we know the action reliably emits it (see admin/reverseproxy#1 follow-up).
  • DockerComposeBuild is no longer referenced from this config but is still in the codebase as a step. Other configs may still use it; do not delete it from steps/docker.py.
## What Replaces the inline `DockerComposeBuild` step in the `torrserv_proxy` config with a new `GitHubActionTrigger` step. Brencher no longer builds the image itself; it POSTs to `/api/v1/repos/admin/reverseproxy/actions/workflows/build.yml/dispatches` on the merge commit SHA, then polls the run to completion. ## Files - `backend/steps/git.py` -- `CheckoutMerged` gets a new `push_branch_template: str | None` knob. When set, the merge commit is force-pushed to a branch whose name is built from the template (we use `auto-deploy/torrserv_proxy/{commit_sha}` here). `CheckoutAndMergeResult` gets a matching `push_branch: str | None` field so downstream steps can find it. - `backend/steps/github_action.py` -- new step. Dispatches a workflow on a configurable `owner/repo` (currently `admin/reverseproxy`), polls every `poll_interval_seconds` (default 15s) until `status == completed`, raises if `conclusion != "success"`, otherwise returns the run id and the optional `image_tag` output. - `backend/configs/torrserv_proxy.py` -- wires it together: `checkoutMerged` gets `push_branch_template="auto-deploy/torrserv_proxy/{commit_sha}"`, the new `triggerAction` step replaces `buildDocker`, and `deployDocker.buildDocker=None`. ## Why Closes the inline-docker-build loop in brencher for one stack, as a pilot for #34. The same `GitHubActionTrigger` will be reusable for any stack that wants to offload build to a per-repo workflow. ## Required env / secrets - `BRENCHER_GITEA_TOKEN` -- a Gitea token with repo + actions scope on `admin/reverseproxy`. - The companion workflow `admin/reverseproxy/.github/workflows/build.yml` must already exist (it does, see admin/reverseproxy#1). ## Deploy step Left as-is per Alex's direction. `deployDocker` remains in the pipeline; only `buildDocker=None`. ## Open items - `DockerSwarmDeploy` reads the image tag from `envs=lambda: {"version": "auto-"+checkoutMerged.progress().version}`. The action now produces its own `auto-<ref>` tag. Need to wire `GitHubActionTrigger.progress().image_tag` into `deployDocker.envs` once we know the action reliably emits it (see admin/reverseproxy#1 follow-up). - `DockerComposeBuild` is no longer referenced from this config but is still in the codebase as a step. Other configs may still use it; do not delete it from `steps/docker.py`.
hermes added 2 commits 2026-08-31 20:02:33 +02:00
feat(actions): add brencher reusable GitHub Action
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 46s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 37s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 36s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 29s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 31s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Successful in 1m43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Successful in 1m33s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Successful in 1m50s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 37s
Python package / build (pip list, 3.13) (pull_request) Successful in 33s
Python package / build (pip list, 3.14) (pull_request) Successful in 30s
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 32s
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 32s
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 34s
71a9e1b06b
Adds .github/actions/brencher/action.yml — a composite reusable
GitHub Action that builds a Docker image, pushes it to a registry,
and deploys a Docker Compose stack to a Swarm cluster via SSH.

Designed to be invoked from per-repo workflows that watch for PR
approval events; the caller supplies registry credentials, swarm
manager SSH details, and the stack / image names.

Companion PR in admin/reverseproxy wires this action into the
torrserv_proxy stack as the first end-to-end pilot.
feat(torrserv_proxy): delegate docker build to GitHub Action
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 46s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 38s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 42s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 38s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 37s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 40s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m46s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 1m36s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 1m55s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 33s
Python package / build (pip list, 3.13) (pull_request) Successful in 30s
Python package / build (pip list, 3.14) (pull_request) Successful in 31s
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 36s
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 32s
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 39s
c46e4015ec
Replace the inline DockerComposeBuild step in the torrserv_proxy
config with a new GitHubActionTrigger step that POSTs to
/api/v1/repos/admin/reverseproxy/actions/workflows/build.yml/dispatches
on the commit SHA produced by CheckoutMerged, then polls the run
status until completion.

CheckoutMerged gets a new push_branch_template knob so it pushes
the merge result to 'auto-deploy/torrserv_proxy/<commit_sha>'
on origin. That branch is what the workflow sees as its ref.

DockerSwarmDeploy stays in the pipeline (per Alex: "deploy step
leave as is") -- buildDocker is set to None since the image is
now produced by the action.

New step: backend/steps/github_action.py. Uses BRENCHER_GITEA_TOKEN
env var for auth.
hermes added 1 commit 2026-08-31 20:18:13 +02:00
chore(torrserv_proxy): revert push_branch_template, use auto-{version}
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 39s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 41s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 34s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 30s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 40s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 48s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m47s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 2m7s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 2m2s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 45s
Python package / build (pip list, 3.13) (pull_request) Successful in 45s
Python package / build (pip list, 3.14) (pull_request) Successful in 43s
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 33s
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 33s
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 38s
d9823d0abc
Per Alex's feedback: the original push logic in CheckoutMerged that
auto-generates a branch named 'auto-{version}' from the merged commit
hashes is the convention we keep. Drop the push_branch_template knob
and the matching push_branch field on CheckoutAndMergeResult that
were introduced in the previous commit, so downstream steps get the
standard remote_branch_name back instead.

GitHubActionTrigger uses the merge commit_hash directly (commit_hash
field on CheckoutAndMergeResult, which is unaffected) for the
workflow ref, so we don't need a dedicated push_branch field.
hermes added 1 commit 2026-08-31 20:19:23 +02:00
Revert "feat(actions): add brencher reusable GitHub Action"
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 49s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 43s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 48s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 38s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 40s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m35s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 1m44s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 1m37s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 33s
Python package / build (pip list, 3.13) (pull_request) Successful in 35s
Python package / build (pip list, 3.14) (pull_request) Successful in 34s
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 32s
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 30s
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
308362b807
This reverts commit 71a9e1b06b.
Some required checks failed
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.12.3) (pull_request) Successful in 49s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.13) (pull_request) Successful in 43s
Python package / build (flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics, 3.14) (pull_request) Successful in 48s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.12.3) (pull_request) Successful in 38s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.13) (pull_request) Successful in 40s
Python package / build (flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics, 3.14) (pull_request) Successful in 43s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.12.3) (pull_request) Failing after 1m35s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.13) (pull_request) Failing after 1m44s
Python package / build (mypy --no-incremental --config-file mypy.ini backend tests, 3.14) (pull_request) Failing after 1m37s
Python package / build (pip list, 3.12.3) (pull_request) Successful in 33s
Python package / build (pip list, 3.13) (pull_request) Successful in 35s
Python package / build (pip list, 3.14) (pull_request) Successful in 34s
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 32s
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 30s
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
Checking for merge conflicts…
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 feature/trigger-build-via-action:hermes-feature/trigger-build-via-action
git checkout hermes-feature/trigger-build-via-action
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/brencher#35