chore(ci): guard the OCI build type=gha cache pattern #483

Merged
nrupard merged 2 commits from chore/PMS-720-oci-gha-cache-guard into main 2026-08-04 19:20:42 +02:00
Member

The type=gha migration itself is already on main: .forgejo/workflows/build-oci-image.yml already creates a docker-container buildx builder (line 131), runs crazy-max/ghaction-github-runtime@v3 to re-export ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN (line 139), and passes cache_from = "type=gha" / cache_to = "type=gha,mode=max,ignore-error=true" (lines 159-165). The issue's background describes an older state of the file, so re-doing the migration would be a no-op; what is actually missing is the mechanical enforcement, and that is what this adds.

Add scripts/check-oci-build-cache.nu, wired into just check and the Check workflow next to the existing migration / mail-copy / runner-label guards. It asserts the invariant over every workflow that runs docker buildx build: the docker-container driver, the runtime-env export step, and type=gha cache_from/cache_to are all present, and the retired type=inline, type=registry and :buildcache backends are absent. Comment lines are excluded because the workflow's own comments name the retired backends when explaining why they were dropped.

The regression is otherwise invisible: ignore-error=true means a dead or reverted cache still exits 0, and inline / registry caching also builds green, just slowly. Freshness has to be read from the build log's importing cache manifest from gha line, which nothing was checking.

#PMS-720
#GOV-20

The `type=gha` migration itself is already on main: `.forgejo/workflows/build-oci-image.yml` already creates a `docker-container` buildx builder (line 131), runs `crazy-max/ghaction-github-runtime@v3` to re-export ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN (line 139), and passes `cache_from = "type=gha"` / `cache_to = "type=gha,mode=max,ignore-error=true"` (lines 159-165). The issue's background describes an older state of the file, so re-doing the migration would be a no-op; what is actually missing is the mechanical enforcement, and that is what this adds. Add `scripts/check-oci-build-cache.nu`, wired into `just check` and the Check workflow next to the existing migration / mail-copy / runner-label guards. It asserts the invariant over every workflow that runs `docker buildx build`: the docker-container driver, the runtime-env export step, and `type=gha` cache_from/cache_to are all present, and the retired `type=inline`, `type=registry` and `:buildcache` backends are absent. Comment lines are excluded because the workflow's own comments name the retired backends when explaining why they were dropped. The regression is otherwise invisible: `ignore-error=true` means a dead or reverted cache still exits 0, and inline / registry caching also builds green, just slowly. Freshness has to be read from the build log's `importing cache manifest from gha` line, which nothing was checking. #PMS-720 #GOV-20
chore(ci): guard the OCI build type=gha cache pattern
Some checks failed
Check / fmt + clippy + build + tests (pull_request) Successful in 1m47s
Integration / integration tests (pull_request) Successful in 6m14s
E2E / Playwright against staging (pull_request) Failing after 1m6s
cb578ba383
The `type=gha` migration itself is already on main: `.forgejo/workflows/build-oci-image.yml` already creates a `docker-container` buildx builder (line 131), runs `crazy-max/ghaction-github-runtime@v3` to re-export ACTIONS_CACHE_URL / ACTIONS_RUNTIME_TOKEN (line 139), and passes `cache_from = "type=gha"` / `cache_to = "type=gha,mode=max,ignore-error=true"` (lines 159-165). The issue's background describes an older state of the file, so re-doing the migration would be a no-op; what is actually missing is the mechanical enforcement, and that is what this adds.

Add `scripts/check-oci-build-cache.nu`, wired into `just check` and the Check workflow next to the existing migration / mail-copy / runner-label guards. It asserts the invariant over every workflow that runs `docker buildx build`: the docker-container driver, the runtime-env export step, and `type=gha` cache_from/cache_to are all present, and the retired `type=inline`, `type=registry` and `:buildcache` backends are absent. Comment lines are excluded because the workflow's own comments name the retired backends when explaining why they were dropped.

The regression is otherwise invisible: `ignore-error=true` means a dead or reverted cache still exits 0, and inline / registry caching also builds green, just slowly. Freshness has to be read from the build log's `importing cache manifest from gha` line, which nothing was checking.

#PMS-720
#GOV-20
Merge branch 'main' into chore/PMS-720-oci-gha-cache-guard
All checks were successful
E2E / Playwright against staging (pull_request) Successful in 1m55s
Check / fmt + clippy + build + tests (pull_request) Successful in 2m0s
Create release / Gate (release-branch merges only) (pull_request) Successful in 2s
Create release / Create release from merged PR (pull_request) Has been skipped
Integration / integration tests (pull_request) Successful in 4m26s
b17b515385
nrupard scheduled this pull request to auto merge when all checks succeed 2026-08-04 19:19:57 +02:00
nrupard deleted branch chore/PMS-720-oci-gha-cache-guard 2026-08-04 19:20:42 +02:00
Sign in to join this conversation.
No reviewers
No labels
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
psa-systems/mokosh-server!483
No description provided.