feat: [96] TrueNAS deploy action with websocket probe mode #97

Merged
hobbypunk merged 4 commits from enhancement/96_truenas_deploy into main 2026-09-30 15:59:02 +00:00
Owner

Closes #96 (erster Schritt)

Was

truenas-deploy Action – spricht die TrueNAS-Middleware-API (Goldeye 25.10, reine WebSocket-API) an:

  • WebSocket-Client (ws) mit Authorization: Bearer <API-Key> im Handshake, JSON-RPC-Frames mit laufender ID
  • Probe-Modus (dry-run, Default): app.query → listet alle Apps, findet die zum Repo-Namen passende und dumped deren komplette Config ins Job-Log
  • Existiert die App noch nicht: klarer Fehler mit Bootstrap-Hinweis (einmalig manuell anlegen – die Action aktualisiert nur bestehende Apps, bewusstes Design)
  • Optionen: insecure-tls (Self-Signed), tag (für die spätere Update-Logik), app-name (Üerride)

deploy.yml Workflow – Probe-Phase: workflow_dispatch only, Release-Trigger auskommentiert als Ziel (nach dem Image-Push).

Vorgehen (Probe-first)

Die API ist reine WebSocket – die Update-Logik (app.update mit mutiertem Image-Tag) wird gegen die echte Config-Struktur entwickelt, die der Probe-Lauf liefert. Dafür:

  1. Secrets TRUENAS_API_URL + TRUENAS_API_KEY hinterlegen
  2. Workflow auf diesem Branch dispatchen (Runner muss die TrueNAS-API erreichen)
  3. Config-Dump aus dem Job-Log → Update-Logik bauen → dry-run auf false → Test-Deployment

Danach: Release-Trigger aktivieren → Kette Release → Image → TrueNAS-Rollout, und die zentrale Wiederverwendung im neuen shared-Ökosystem.

Closes #96 (erster Schritt) ## Was **`truenas-deploy` Action** – spricht die TrueNAS-Middleware-API (Goldeye 25.10, reine WebSocket-API) an: - WebSocket-Client (`ws`) mit `Authorization: Bearer <API-Key>` im Handshake, JSON-RPC-Frames mit laufender ID - **Probe-Modus (`dry-run`, Default)**: `app.query` → listet alle Apps, findet die zum Repo-Namen passende und **dumped deren komplette Config ins Job-Log** - Existiert die App noch nicht: klarer Fehler mit Bootstrap-Hinweis (einmalig manuell anlegen – die Action aktualisiert nur bestehende Apps, bewusstes Design) - Optionen: `insecure-tls` (Self-Signed), `tag` (für die spätere Update-Logik), `app-name` (Üerride) **`deploy.yml` Workflow** – Probe-Phase: `workflow_dispatch` only, Release-Trigger auskommentiert als Ziel (nach dem Image-Push). ## Vorgehen (Probe-first) Die API ist reine WebSocket – die Update-Logik (`app.update` mit mutiertem Image-Tag) wird gegen die **echte** Config-Struktur entwickelt, die der Probe-Lauf liefert. Dafür: 1. Secrets `TRUENAS_API_URL` + `TRUENAS_API_KEY` hinterlegen 2. Workflow auf diesem Branch dispatchen (Runner muss die TrueNAS-API erreichen) 3. Config-Dump aus dem Job-Log → Update-Logik bauen → dry-run auf false → Test-Deployment Danach: Release-Trigger aktivieren → Kette **Release → Image → TrueNAS-Rollout**, und die zentrale Wiederverwendung im neuen shared-Ökosystem.
feat: [96] TrueNAS deploy action, websocket probe mode
All checks were successful
PR Triage / triage (pull_request) Successful in 15s
CI / Quality / Brakeman (pull_request) Successful in 1m25s
CI / Quality / Bundler Audit (pull_request) Successful in 1m29s
CI / Quality / RuboCop (pull_request) Successful in 1m31s
CI / Tests / Unit (pull_request) Successful in 1m55s
CI / Tests / System (pull_request) Successful in 2m1s
CI / Container / Build and push (pull_request) Successful in 14s
CI / Tests / Coverage (pull_request) Successful in 41s
e5ad5259ce
Talks to the TrueNAS middleware websocket API (JSON-RPC frames,
Bearer auth on the handshake). Probe mode (dry-run) queries the
apps and dumps the config of the repo-named app into the job log;
the update logic is developed against that real config shape.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>

📊 Coverage

Metrik Abdeckung
Zeilen 97.69% (2618/2680)
Branches 81.38% (638/784)
Methoden 96.71% (412/426)

Patch-Coverage: keine getrackten Zeilen geändert

Schwächste Dateien im Projekt

Datei Abdeckung
app/models/concerns/has_uuid_v7.rb 54.55%
app/components/form/select.rb 72.41%
app/components/layout/flash.rb 84.0%
app/components/concerns/actionable.rb 86.67%
app/components/layout/sidebar.rb 89.47%
app/controllers/settings/security_controller.rb 90.24%
app/controllers/sessions_controller.rb 90.32%
app/components/concerns/inferrable.rb 90.63%
app/components/users/avatar.rb 91.23%
app/controllers/settings/security/otps_controller.rb 91.67%

🔍 Report im Browser ansehen · 📄 Run-Artifact „coverage-report“

<!-- coverage-report --> ## 📊 Coverage | Metrik | Abdeckung | |---|---| | Zeilen | 97.69% (2618/2680) | | Branches | 81.38% (638/784) | | Methoden | 96.71% (412/426) | **Patch-Coverage**: keine getrackten Zeilen geändert **Schwächste Dateien im Projekt** | Datei | Abdeckung | |---|---| | app/models/concerns/has_uuid_v7.rb | 54.55% | | app/components/form/select.rb | 72.41% | | app/components/layout/flash.rb | 84.0% | | app/components/concerns/actionable.rb | 86.67% | | app/components/layout/sidebar.rb | 89.47% | | app/controllers/settings/security_controller.rb | 90.24% | | app/controllers/sessions_controller.rb | 90.32% | | app/components/concerns/inferrable.rb | 90.63% | | app/components/users/avatar.rb | 91.23% | | app/controllers/settings/security/otps_controller.rb | 91.67% | [🔍 Report im Browser ansehen](https://pages.hoppe-dev.eu/hobbypunk-rails-base_app/pr-97/coverage) · [📄 Run-Artifact „coverage-report“](https://code.hoppe-dev.eu/hobbypunk/rails-base_app/actions/runs/2031/artifacts/coverage-report)
feat: [96] real TrueNAS protocol, tag mutation, redacted probe
All checks were successful
PR Triage / triage (pull_request) Successful in 12s
CI / Quality / Bundler Audit (pull_request) Successful in 55s
CI / Quality / RuboCop (pull_request) Successful in 58s
CI / Quality / Brakeman (pull_request) Successful in 1m0s
CI / Tests / Unit (pull_request) Successful in 1m17s
CI / Tests / System (pull_request) Successful in 1m23s
CI / Container / Build and push (pull_request) Successful in 7s
CI / Tests / Coverage (pull_request) Successful in 34s
8f9eef2e51
Validated against the live API: strict JSON-RPC 2.0 frames on
/api/current, auth via the auth.login_with_api_key message. The
update mutates image.tag from app.config, verifies the repository
matches the pipeline image, waits for the app.update job and
checks the app state afterwards. Dry-run dumps the config with
env values masked.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
feat: [96] check/deploy split with skip semantics
All checks were successful
PR Triage / triage (pull_request) Successful in 1m24s
CI / Quality / Bundler Audit (pull_request) Successful in 3m2s
CI / Quality / Brakeman (pull_request) Successful in 3m6s
CI / Quality / RuboCop (pull_request) Successful in 3m10s
CI / Tests / Unit (pull_request) Successful in 4m13s
CI / Tests / System (pull_request) Successful in 4m17s
CI / Container / Build and push (pull_request) Successful in 23s
CI / Tests / Coverage (pull_request) Successful in 1m3s
55fe5e62c7
The check mode queries the app and exposes exists/current-image as
action outputs, never failing on a missing app. The workflow gates
the deploy step on exists=true, so template repos without a
TrueNAS app skip the deploy visibly instead of failing.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
feat: [96] wire the TrueNAS deploy into the CI chain
All checks were successful
PR Triage / triage (pull_request) Successful in 44s
CI / Quality / Bundler Audit (pull_request) Successful in 1m12s
CI / Quality / Brakeman (pull_request) Successful in 1m16s
CI / Quality / RuboCop (pull_request) Successful in 1m33s
CI / Tests / Unit (pull_request) Successful in 1m51s
CI / Tests / System (pull_request) Successful in 2m9s
CI / Tests / Coverage (pull_request) Successful in 1m8s
CI / Container / Build and push (pull_request) Successful in 1m38s
CI / deploy (pull_request) Has been skipped
cea6d61101
The deploy job needs the container push and deploys on release
automatically (or via the deploy-tag dispatch input after the
gates are green). The standalone deploy.yml is gone - Forgejo has
no workflow_run trigger, so the dependency belongs in ci.yml.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
hobbypunk deleted branch enhancement/96_truenas_deploy 2026-09-30 15:59:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hobbypunk/rails-base_app!97
No description provided.