MILAB-6714: verify a block's docker images exist before publishing (v4-beta to v4) - #199
Merged
Conversation
When no local source branch exists, merge-beta.sh reassigned SOURCE_BRANCH to "origin/<branch>", so the self-ref rewrite sed searched for the non-existent tag "@origin/v4-beta" and silently rewrote nothing — leaving @v4-beta milaboratory/github-ci self-refs on the target branch. This bites any local `merge-beta.sh` run (CI happens to have a local v4-beta branch). Split the mergeable ref (new SOURCE_REF, may be origin/<branch>) from the bare branch name (SOURCE_BRANCH) that the `@<name>` rewrite depends on. Found while promoting v4-beta -> v4 for MILAB-6707.
fix(merge-beta): keep bare branch name for @v4-beta self-ref rewrite
| fi | ||
| echo "Scanning ${#descriptors[@]} entrypoint descriptor(s)." | ||
|
|
||
| mapfile -t tags < <(jq -r 'select(.docker != null and .docker.tag != null) | .docker.tag' "${descriptors[@]}" | sort -u) |
There was a problem hiding this comment.
Descriptor parse failures pass verification
When a descriptor is malformed or unreadable, or jq is unavailable, the process substitution can fail without failing mapfile, leaving tags empty and causing the publication gate to exit successfully without checking any images.
Suggested change
| mapfile -t tags < <(jq -r 'select(.docker != null and .docker.tag != null) | .docker.tag' "${descriptors[@]}" | sort -u) | |
| tags_file="$(mktemp)" | |
| trap 'rm -f "${tags_file}"' EXIT | |
| if ! jq -r 'select(.docker != null and .docker.tag != null) | .docker.tag' "${descriptors[@]}" | sort -u > "${tags_file}"; then | |
| echo "::error::failed to parse entrypoint descriptors" | |
| exit 1 | |
| fi | |
| mapfile -t tags < "${tags_file}" |
Prompt To Fix With AI
This is a comment left during a code review.
Path: blocks/monorepo/verify-docker-images/action.yaml
Line: 48
Comment:
**Descriptor parse failures pass verification**
When a descriptor is malformed or unreadable, or `jq` is unavailable, the process substitution can fail without failing `mapfile`, leaving `tags` empty and causing the publication gate to exit successfully without checking any images.
```suggestion
tags_file="$(mktemp)"
trap 'rm -f "${tags_file}"' EXIT
if ! jq -r 'select(.docker != null and .docker.tag != null) | .docker.tag' "${descriptors[@]}" | sort -u > "${tags_file}"; then
echo "::error::failed to parse entrypoint descriptors"
exit 1
fi
mapfile -t tags < "${tags_file}"
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.A block's .sw.json descriptors carry the image tag the backend pulls at runtime, and the build writes them whether or not the push happened. A misconfigured package (a stray "private": true gates pl-pkg auto-push) therefore produced a green build and a block that 404s on first run, with nothing in CI saying so. New composite action resolves every docker tag in the repo's own descriptors against the registry and blocks publication when one is missing. It checks the pull address recorded in the descriptor, not the push alias, so it also covers any CDN mapping in front of the registry. node_modules is excluded: dependency images are not this block's to guarantee. Opt out per block with verify-docker-images: false.
docker manifest inspect has no precedent in this repo, and the check gates every block publish. Fall back to docker buildx imagetools inspect, and fail loudly if neither exists rather than silently treating every image as missing.
xnacly
force-pushed
the
merge-2026-08-11
branch
from
August 11, 2026 11:24
fe4c00d to
d15f3d2
Compare
DenKoren
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes
v4-betatov4.Main content: pre-publish docker image verification
A block's
.sw.jsondescriptors carry the image tag the backend pulls at runtime, and the build writes them whether or not the push happened. A misconfigured package produced a green build and a block that 404s on first run, with nothing in CI saying so. That is MILAB-6714, wheregpu-testshipped referencing an image that was never uploaded.New composite action
blocks/monorepo/verify-docker-images, wired intonode-simple-pnpm.yamlafter the pre-publish build and before the publish steps. It resolves every docker tag in the repo's own descriptors against the registry and blocks publication when one is missing.Design notes:
containers.pl-open.science/...while the push targetsquay.io/.... Verifying what the backend actually resolves also covers the CDN mapping in front of the registry.node_modules. Those descriptors belong to published dependencies (SDK runenvs); failing a release on upstream state would be wrong.main+ no pending changeset commits), so PR and branch builds that legitimately do not push cannot fail spuriously.verify-docker-images: false.docker manifest inspect, falling back todocker buildx imagetools inspect, both of which reuse the logins this workflow already performs. If neither exists it fails loudly rather than reporting every image as missing.Verification
Script logic exercised against fixtures built from the real tags in this incident:
ok, exit 0MISSING, exit 1, step summary writtennode_modulesdescriptorfail-on-missing: falsebuildx imagetoolsfallback branchBoth YAML files parse.
node-simple-pnpm-k8s.yamlhas no block publish path, so it needs no change.Also carried
merge-beta.shchanges from #196, already onv4-betaand not yet onv4. Existing drift, not part of this work.Rollout note
This gates every block publish. Nothing has exercised it on a real runner yet, since the step only fires on the
mainpublish path and so cannot be canaried from a PR build. The natural first subject is platforma-open/gpu-test#6: once that merges, itsmainbuild publishes a block whose image is present again, which is exactly the passing case.Ticket: MILAB-6714
Greptile Summary
This PR promotes the beta workflow changes to v4, adds a pre-publication Docker-image verification action, and fixes beta-merge self-reference rewriting.
.sw.jsonentrypoint description containing the image pull address. The PR adds discovery and registry verification of these descriptors..docker.tagvalue that Platforma resolves at runtime. The new action checks this address rather than a registry push alias.@v4-betareferences. It is now kept separate from the Git ref used for merging.origin/...ref supplied togit merge. The PR introduces this value so remote merges do not corrupt self-reference matching.Confidence Score: 4/5
The parsing failure path in the Docker-image publication gate should be fixed before merging because it can silently skip all image checks.
The new action treats an empty tag list as success, while the process-substituted
jqcommand can fail independently and leave exactly that empty list, allowing publication to continue without the intended verification.Files Needing Attention: blocks/monorepo/verify-docker-images/action.yaml
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Build packages and descriptors] --> B{Main branch and clean tree?} B -- No --> C[Skip publication] B -- Yes --> D[Discover .sw.json descriptors] D --> E[Extract docker.tag values] E --> F{Every image exists?} F -- Yes --> G[Security scan and publication] F -- No --> H[Block publication]Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "Merge v4-beta into v4" | Re-trigger Greptile