mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 18:28:19 +00:00
734ab6ab58b56fa1ca6da3ab0b2c034b0aa42671
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d68280bf2d |
ci(release): keep the three newest releases, tags and versioned images
The maintainer's request, in their words: "add a retention of 3 releases and
tags, and delete the old". The menu of 2026-11-28, four answers, each the option
recommended: the three newest version tags with their releases, by the date of
the tag, pre-releases included (the archive/* tags stay); one workflow that runs
after each release and on demand and logs what it deletes; the old ones are
listed first and deleted on the maintainer's word; older version tags of the
images are deleted too.
What changed
- One new file, .github/workflows/release-retention.yml (150 lines).
- Triggers: a manual run, with dry run on by default, and the end of the Tagged
Release workflow. The run after a release only lists. A manual run with dry
run off deletes.
- The rule: version tags (vX.Y.Z with an optional pre-release) by the date of
the tag. The newest RELEASES_TO_KEEP (3) stay, and so does the latest stable
release. The others go with their releases.
- Images: for openultrasast and openultrasast-runner, a version goes only when
every one of its tags came from a deleted release tag (the version, and the
major.minor of a stable one). A version that carries latest, main, a sha or
a tag of a kept release stays and is named in the summary.
- Guards: a non-version tag is never touched; more than 20 deletions in one run
stop the job; the plan is written to the job summary before the images are
read and before anything is deleted; one read gives the releases and the
latest stable release, and a failed read stops the job; a failed call fails
the job, and the log names the call and the reason gh printed.
Checks
- s10_rr1_harness_evidence.out: the python of the workflow, taken out of the
file and run on the local tags of this repository with a stand-in for gh.
Five runs. A dry run that keeps 3 exits 0 and deletes nothing. A deleting
run that keeps 3 makes nine deleting calls: five image versions, then four
releases. A deleting run that keeps 1 leaves the latest stable release
v2.0.1 in place and deletes the tag v2.0.0, which has no release, by the
API: eleven calls. A deleting run where the read of the releases fails exits
1 with no deleting call. A deleting run where the read of the first image
fails exits 1 with the plan in its summary and no deleting call.
- s10_rr1_file.out: the file is ASCII; its longest line is 120 columns; the
step passes bash -n and its python compiles.
- s10_rr1_exits.txt: the gates with label rr1, ten zeros (they do not read the
workflow; they show that the tree is otherwise unchanged).
Not verified
- The run on GitHub itself. The path for user-owned packages with GITHUB_TOKEN
(/user/packages/container/{name}/versions) is proven only by the first run.
The documentation of GitHub says a workflow deletes package versions through
the REST API only with admin permission on the package, which a repository
that publishes the package has by default (public preview).
- No test in tests/ reads the new workflow.
Review.
Two rounds, read-only, on the workflow, release.yml, engine-image.yml, the harness,
its stand-in and the evidence; the step's own shell script ran under bash with my own
stand-ins for git and gh. Round one blocked the file: the read of the latest release
was swallowed, so with three pre-releases above the latest stable a failed read let a
deleting run exit 0, print nothing and delete the release and the tag v2.0.1; a failed
call named the command but not the reason. Round two: one read of the releases with
isLatest must succeed, gh() exits with the call, its code and the stderr, and the plan
precedes the images and the limit check. The attack repeated: exit 1, the call and its
502 named, no deleting call. Measured too: a failed delete names call and reason; a
failed image read leaves the plan in the summary; 27 planned deletions stop the same
way. The harness reproduces its five runs (exit 0, 0, 0, 1, 1; deleting calls 0, 9, 11,
0, 0); jq confirms the tab-separated rows. Left for GitHub: isLatest and the package path.
|