feat: [90] Build the OCI image via composite action (build-only on PRs) #91

Merged
hobbypunk merged 15 commits from enhancement/90_container_image_build into main 2026-09-29 16:53:19 +00:00
Owner

Closes #90

Was

.forgejo/actions/build-and-push-containerfile – frische Neuinterpretation des archivierten shared/workflows-Ansatzes als Composite Action:

  • Safe-by-Default: push: false baut nur – kein Registry-Login, keine Secrets nötig, Image wird verworfen
  • push: true (+ password): Login via docker/login-action, Tags <tag> + optional latest, Push nach code.hoppe-dev.eu/<owner>/<repo>
  • Zusammengesetzte Tags/Labels in einem Bash-Step (OCI source/revision/version/created)
  • Frühe Fehler statt Überraschungen: Push ohne Token schlägt sofort mit klarer Meldung fehl
  • Docker-Actions bewusst fully-qualified via github.com (wie im bewährten shared/oci-Setup, data.forgejo.org spiegelt docker/* nicht)

image.yml: PR-Trigger (Paths Containerfile + Workflow) ruft die Action build-only mit tag: pr-<N>; Job-Container shared/oci/alpine-toolkit:3.22-1 (bewährt, mit renovate-Pinning-Kommentar versehen).

Stage 2 (später, im selben Workflow)

# release: types: [published]
- uses: ./.forgejo/actions/build-and-push-containerfile
  with:
    tag: ${{ forgejo.event.release.tag_name }}
    push: true
    password: ${{ secrets.REGISTRY_TOKEN }}

Sobald die Pipeline hier fertig ist, lässt sich die Action in das geplante neue shared/workflows-Repo verschieben, ohne die Aufruf-Stellen zu ändern (nur der uses:-Pfad).

(Der ursprüngliche Ansatz über einen push-Input an der alten Shared-Workflow wurde verworfen; der zugehörige PR #3 auf shared/workflows ist geschlossen.)

Closes #90 ## Was **`.forgejo/actions/build-and-push-containerfile`** – frische Neuinterpretation des archivierten `shared/workflows`-Ansatzes als Composite Action: - **Safe-by-Default**: `push: false` baut nur – kein Registry-Login, keine Secrets nötig, Image wird verworfen - `push: true` (+ `password`): Login via `docker/login-action`, Tags `<tag>` + optional `latest`, Push nach `code.hoppe-dev.eu/<owner>/<repo>` - Zusammengesetzte Tags/Labels in einem Bash-Step (OCI source/revision/version/created) - **Frühe Fehler** statt Überraschungen: Push ohne Token schlägt sofort mit klarer Meldung fehl - Docker-Actions bewusst fully-qualified via `github.com` (wie im bewährten shared/oci-Setup, data.forgejo.org spiegelt docker/* nicht) **`image.yml`**: PR-Trigger (Paths `Containerfile` + Workflow) ruft die Action build-only mit `tag: pr-<N>`; Job-Container `shared/oci/alpine-toolkit:3.22-1` (bewährt, mit renovate-Pinning-Kommentar versehen). ## Stage 2 (später, im selben Workflow) ```yaml # release: types: [published] - uses: ./.forgejo/actions/build-and-push-containerfile with: tag: ${{ forgejo.event.release.tag_name }} push: true password: ${{ secrets.REGISTRY_TOKEN }} ``` Sobald die Pipeline hier fertig ist, lässt sich die Action in das geplante neue shared/workflows-Repo verschieben, ohne die Aufruf-Stellen zu ändern (nur der `uses:`-Pfad). *(Der ursprüngliche Ansatz über einen `push`-Input an der alten Shared-Workflow wurde verworfen; der zugehörige PR #3 auf shared/workflows ist geschlossen.)*
feat: [90] add build-only container image CI for PRs
Some checks failed
PR Triage / triage (pull_request) Successful in 8s
CI / scan_ruby (pull_request) Successful in 39s
CI / lint (pull_request) Successful in 40s
CI / test (pull_request) Successful in 59s
CI / system-test (pull_request) Successful in 1m5s
CI / coverage (pull_request) Successful in 33s
Image / build (pull_request) Has been cancelled
4b58a177e3
Calls the shared reusable build workflow with push: false to
validate the Containerfile on PRs without publishing. The release
trigger with registry push follows once the build is proven.

📊 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-91/coverage) · [📄 Run-Artifact „coverage-report“](https://code.hoppe-dev.eu/hobbypunk/rails-base_app/actions/runs/1992/artifacts/coverage-report)
refactor: [90] container build as composite action build-and-push-containerfile
Some checks failed
Image / build (pull_request) Failing after 0s
CI / scan_ruby (pull_request) Successful in 45s
CI / lint (pull_request) Successful in 46s
PR Triage / triage (pull_request) Successful in 40s
CI / test (pull_request) Successful in 1m6s
CI / system-test (pull_request) Successful in 1m12s
CI / coverage (pull_request) Successful in 32s
66c6114474
Fresh interpretation of the archived shared/workflows setup: the
build lives as a local composite action with safe-by-default push
(false = validation without registry login), assembled tags with
optional latest, OCI labels and early validation errors.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
hobbypunk changed title from feat: [90] Build the OCI image in CI (build-only on PRs) to feat: [90] Build the OCI image via composite action (build-only on PRs) 2026-09-29 14:35:13 +00:00
feat: [90] smoke-push via workflow_dispatch, catthehacker job container
All checks were successful
PR Triage / triage (pull_request) Successful in 1m42s
CI / scan_ruby (pull_request) Successful in 3m46s
CI / lint (pull_request) Successful in 3m48s
CI / test (pull_request) Successful in 4m7s
CI / system-test (pull_request) Successful in 4m15s
CI / coverage (pull_request) Successful in 1m8s
Image / build (pull_request) Successful in 7m15s
e9d8f8eaf6
---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
fix: [90] pull the alpine-toolkit job container with registry credentials
Some checks failed
CI / coverage (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
Image / build (pull_request) Has been cancelled
CI / system-test (pull_request) Has been cancelled
CI / scan_ruby (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
PR Triage / triage (pull_request) Has been cancelled
e1f6f70eba
The runner pulls job containers without credentials, so the private
shared/oci package needs container.credentials to be pullable.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
fix: [90] use the forgejo-bot account for registry credentials
All checks were successful
PR Triage / triage (pull_request) Successful in 37s
CI / scan_ruby (pull_request) Successful in 1m8s
CI / lint (pull_request) Successful in 1m3s
CI / test (pull_request) Successful in 1m27s
Image / build (pull_request) Successful in 1m24s
CI / system-test (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 33s
3799ef178c
---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
fix: [90] pass the forgejo-bot username to the registry login
All checks were successful
PR Triage / triage (pull_request) Successful in 9s
CI / scan_ruby (pull_request) Successful in 50s
CI / lint (pull_request) Successful in 50s
CI / test (pull_request) Successful in 1m28s
Image / build (pull_request) Successful in 1m30s
CI / system-test (pull_request) Successful in 1m34s
CI / coverage (pull_request) Successful in 30s
f06f814c93
---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
fix: [90] align registry credentials with the owner PAT
All checks were successful
PR Triage / triage (pull_request) Successful in 39s
CI / scan_ruby (pull_request) Successful in 1m51s
CI / lint (pull_request) Successful in 1m53s
Image / build (pull_request) Successful in 2m43s
CI / test (pull_request) Successful in 2m47s
CI / system-test (pull_request) Successful in 2m58s
CI / coverage (pull_request) Successful in 30s
661b2dc87a
---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
feat: [90] gate the image build behind the CI quality gates
All checks were successful
PR Triage / triage (pull_request) Successful in 16s
CI / scan_ruby (pull_request) Successful in 38s
CI / lint (pull_request) Successful in 39s
CI / test (pull_request) Successful in 57s
CI / system-test (pull_request) Successful in 1m5s
CI / coverage (pull_request) Successful in 31s
CI / image (pull_request) Successful in 38s
6e3fa9151b
Forgejo has no workflow_run trigger, so the image build moved into
ci.yml as a job with needs on the quality gates. Change detection
keeps PR builds limited to Containerfile-relevant changes; manual
workflow_dispatch with push:true remains the registry smoke test.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
feat: [90] self-skipping change detection in the action, release-gated push
All checks were successful
PR Triage / triage (pull_request) Successful in 12s
CI / scan_ruby (pull_request) Successful in 54s
CI / lint (pull_request) Successful in 1m4s
CI / test (pull_request) Successful in 1m28s
CI / system-test (pull_request) Successful in 1m45s
CI / coverage (pull_request) Successful in 1m18s
CI / image (pull_request) Successful in 1m41s
55c9846066
The action now detects image-relevant changes itself (one step in the
workflow). Pushes only happen in the release pipeline (release tag +
latest) or via the manual dispatch smoke input; PRs stay build-only.

---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
chore: [90] group job names as <Group> / <Job>
All checks were successful
PR Triage / triage (pull_request) Successful in 11s
CI / Quality / Brakeman (pull_request) Successful in 42s
CI / Quality / RuboCop (pull_request) Successful in 44s
CI / Tests / Unit (pull_request) Successful in 1m19s
CI / Tests / System (pull_request) Successful in 1m31s
CI / Tests / Coverage (pull_request) Successful in 38s
CI / Container / Build and push (pull_request) Successful in 39s
3e2ad2bc62
---------

Co-Authored-By: opencode (Mistral GLM) <opencode-agent[bot]@hoppe-dev.eu>
ci(forgejo): add quality and tests workflows to branch protection status checks
Some checks failed
CI / Quality / Brakeman (pull_request) Failing after 0s
CI / Quality / Bundler Audit (pull_request) Failing after 0s
CI / Quality / RuboCop (pull_request) Failing after 0s
CI / Tests / Unit (pull_request) Failing after 0s
CI / Tests / System (pull_request) Failing after 0s
CI / Tests / Coverage (pull_request) Failing after 0s
CI / Container / Build and push (pull_request) Failing after 0s
PR Triage / triage (pull_request) Successful in 4s
160743f777
ci(workflows): rename CI job names to follow a consistent "category / name" naming convention
Some checks failed
CI / Quality / Brakeman (pull_request) Failing after 0s
CI / Quality / Bundler Audit (pull_request) Failing after 0s
CI / Quality / RuboCop (pull_request) Failing after 0s
CI / Tests / Unit (pull_request) Failing after 0s
CI / Tests / System (pull_request) Failing after 0s
CI / Tests / Coverage (pull_request) Failing after 0s
CI / Container / Build and push (pull_request) Failing after 0s
PR Triage / triage (pull_request) Successful in 6s
0aef0ba7f1
ci(workflows): update test dependencies for coverage job to use explicit unit and system test jobs
Some checks failed
PR Triage / triage (pull_request) Successful in 18s
CI / Quality / Bundler Audit (pull_request) Successful in 47s
CI / Quality / RuboCop (pull_request) Successful in 50s
CI / Quality / Brakeman (pull_request) Successful in 51s
CI / Tests / Unit (pull_request) Successful in 1m10s
CI / Tests / System (pull_request) Successful in 1m16s
CI / Tests / Coverage (pull_request) Successful in 31s
CI / Container / Build and push (pull_request) Has been cancelled
99cd93e082
ci(workflows): remove tests-coverage job from CI workflow as it's redundant
All checks were successful
PR Triage / triage (pull_request) Successful in 17s
CI / Quality / Brakeman (pull_request) Successful in 1m24s
CI / Quality / Bundler Audit (pull_request) Successful in 1m24s
CI / Quality / RuboCop (pull_request) Successful in 1m28s
CI / Tests / Unit (pull_request) Successful in 1m48s
CI / Tests / System (pull_request) Successful in 1m53s
CI / Tests / Coverage (pull_request) Successful in 47s
CI / Container / Build and push (pull_request) Successful in 59s
67f80c0244
hobbypunk deleted branch enhancement/90_container_image_build 2026-09-29 16:53:19 +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!91
No description provided.