Files
Open_Ultra_SAST/.github
Marius Ciepluch 7ecd60ec4e ci(release): the retention prunes image versions too
The maintainer's request, on 2026-11-29: "packages haven't beeen updated in github. do we delete
them?". The two image packages were updated (2.2.0-alpha.1, three hours before); what is old is
the tag latest, which release.yml gives only to a release tag without a hyphen. Asked by menu
what to do with the image versions, the maintainer chose "Prune image versions (Recommended)":
keep the versions of the kept release tags, keep main with its sha tags, delete the other
sha-tagged and the untagged versions of openultrasast and openultrasast-runner; the first run
only lists, and the deletion waits for the maintainer's word.

What changed
.github/workflows/release-retention.yml, 150 to 262 lines (the python of the step: 105 to 215).
The rule for tags and releases is as before. For image versions, after the versions that go with
a deleted release tag: a version that carries no tag of a kept release and not main is pruned
when it is untagged or tagged with a sha only. Two safeguards, found while the rule was written
and in its review. First, an untagged version can be the image manifest or the attestation
manifest of an image that stays: the four release images read on 2026-11-29 are OCI indexes with
an amd64 manifest and an attestation manifest (s10_pkg_indexes.out), and the packages hold more
untagged versions than tagged ones. So the step logs in to the registry, reads the index of each
image that stays once, whatever tag keeps it, with docker buildx imagetools inspect, and keeps
every version whose digest is one of the manifests that index lists. The index is read one level
deep: an index inside it is not followed, and build-push-action makes none. Second, that fails
closed: an index none of whose manifests is a version of the package, an index entry without a
digest, or output that is not an index stops the job before anything is pruned or deleted. A
version with a tag the rule does not name, or untagged without a digest, stays and is listed.
The limit for image versions is 100 in one run (the limit of 20 stays for tags and releases).
The summary lists every version to prune with the start of its digest and its tags before
anything is deleted. A failed docker call stops the job and names the call and the reason, as a
failed gh call does.

Checks
The harness /tmp/opencode/s10_rr2_harness.py runs the python of the step on fixtures with
stand-ins for git, gh and docker (/tmp/opencode/s10_rr2_bin), ten cases. Against the workflow at
HEAD (d98334a) eight of the ten fail (s10_rr2_red.out): the old script prunes nothing, makes no
docker call, and has no limit for image versions. Against this file ten of ten pass
(s10_rr2_green.out): a dry run that lists and deletes nothing; two deleting runs that delete
exactly the expected 10 image versions and 5 tag operations (keep 3), and 13 and 6 (keep 1,
where the image of a pre-release goes with its release); a failing login, a failing index read,
an index entry without a digest, versions named by another form of digest, the image limit, a
failing read of the releases and a failing read of an image each stop the job with nothing
deleted. The harness also checks that the plan is complete in the summary at the first deleting
call, that each index is read once, and that the token is printed nowhere. The YAML parses, the
step passes bash -n and the python compiles; the file is ASCII, its widest line 120 columns; git
diff --check exits 0 (s10_rr2_diffcheck.out). The gates give ten zeros (s10_rr2_exits.txt, label
rr2). No test reads the workflow. The s10 files are under /tmp/opencode, outside the repository.

Not verified
The run on GitHub: whether the package versions API names each version by the digest that the
index lists, and what docker buildx imagetools inspect prints there. The first run is a dry run.
If the API names versions by another form of digest, that run stops on the second safeguard, and
nothing is deleted; its summary is read before any deletion.

Review.
Three read-only rounds, the harness re-run in each (last r3_new 10 of 10,
r3_head 2 of 10) and copies of the fixtures under /tmp/opencode/s10_rev_rr2.
Round one blocked the file on two gaps: an image that stays under another
tag lost its untagged children, and a digest of another form made the
safeguard match nothing. Round two found both closed, the tags and releases
part identical to d98334a, and blocked the message on one sentence, since
corrected. Round three found the file unchanged (same hash, same python),
the new fixture right by hand, and the mutant without the empty-digest guard
caught. Shown by runs: the dry run list and the deleting plan are equal;
every failed or malformed read stops the job with nothing deleted; twelve
mutants are caught. Open remarks: the stop needs no child to be a version;
a nested index is not followed. Not seen: the API's fields, the run, the chat.
2026-11-29 13:20:41 +01:00
..