From dbcbbd7f2745446e946bd913a11e0daea24b149c Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Fri, 27 Nov 2026 10:21:17 +0100 Subject: [PATCH] docs(contributor-scan): the documented build commands carry the base pin (item 5a) Three documented build commands would have failed. README.md told the reader to build plane/Dockerfile.engine-task with docker buildx and Dockerfile with docker build, without TASK_BASE_TAG and TASK_BASE_DIGEST. Both Dockerfiles default the tag to base-unpublished and give the digest no default. Measured on 2026-11-27 from a clean copy of the tree, with the push and the published tags taken out so nothing could be published: each failed in one to two seconds with `failed to parse stage name "ghcr.io/norandom/ousast-task-base:base-unpublished@": invalid reference format`. Both lines now pass the tag and the digest of `base` in plane/task-base.digest, and a sentence after the block names the file. With those arguments the main Dockerfile builds (exit 0 in two seconds; the image was removed afterwards). docs/scanning.md says `docker compose build`, which pins the base and tags openultrasast:dev (the defaults are guarded by tests/test_task_images.py), and says to run it in a checkout of this repository. Found while measuring, and not fixed: - README.md's buildx line still does not run to the end on this tree. It builds the last stage, `replay`, and plane/Dockerfile.engine-task:47 copies benchmarks/unseen/replay_entry.py, which .dockerignore:32 has excluded since 9017038 (2026-11-24). With the arguments the base resolves and the build stops at that COPY (`not found`). By the reviewer's reading, which was not run: of the Engine image workflow only its `replay` job reaches that line, so that job fails on the next push and on the next tag, and the `engine` job and the release image do not. tests/test_task_images.py forbids a negation pattern for the reserved populations. - The README's copy of the pin is kept by hand and no test reads it. When the pin changes, both builds still succeed on the old base until that base is deleted. The nine test files that reference README.md or docs/scanning.md pass (190 tests), `mkdocs build --strict` exits 0, ruff, mypy, the three gates and compileall pass, and the gates print what they printed before. An independent reviewer approved the change in one round; its remark that docs/scanning.md did not say where to run the build is applied. --- README.md | 10 ++++++++-- docs/scanning.md | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4267a30..096e5921 100644 --- a/README.md +++ b/README.md @@ -443,16 +443,22 @@ export PATH=/home/mc/Source/OpenUltraSAST/.venv/bin:$PATH export PYTHONPATH="$PWD/src" TASK_TAG="ghcr.io/norandom/ousast-engine-task:sha-$(git rev-parse --short=7 HEAD)" docker buildx build --platform linux/amd64 -f plane/Dockerfile.engine-task \ + --build-arg TASK_BASE_TAG=base-b696c08 \ + --build-arg TASK_BASE_DIGEST=sha256:0f374138fcb49fef41609d323cc80b6c2324b1e798d3a2aee5c8038b8c7ac3aa \ -t "$TASK_TAG" -t ghcr.io/norandom/ousast-engine-task:main \ --push --metadata-file /tmp/ousast-engine-task-build.json . export TASK_IMAGE="ghcr.io/norandom/ousast-engine-task@$(python -c 'import json; print(json.load(open("/tmp/ousast-engine-task-build.json"))["containerimage.digest"])')" printf '%s\n' "$TASK_IMAGE" -docker build -f Dockerfile -t openultrasast:engine-ax . +docker build -f Dockerfile \ + --build-arg TASK_BASE_TAG=base-b696c08 \ + --build-arg TASK_BASE_DIGEST=sha256:0f374138fcb49fef41609d323cc80b6c2324b1e798d3a2aee5c8038b8c7ac3aa \ + -t openultrasast:engine-ax . ``` The Engine image workflow also builds/pushes both images and prints each digest; CI needs the changes published before dispatch. The local build above includes -uncommitted changes without publishing a git commit. +uncommitted changes without publishing a git commit. Both builds take the base from +`plane/task-base.digest`; when that pin changes, change the two `--build-arg` pairs with it. With `KUBECONFIG` pointing to the operator's kube-ax config and store settings in `.env`, run a one-pin smoke using the default experiment units and local example diff --git a/docs/scanning.md b/docs/scanning.md index abbd089c..231efad6 100644 --- a/docs/scanning.md +++ b/docs/scanning.md @@ -187,7 +187,8 @@ Docker image, an invalid setting, a crash. hook and runs the check in the container (repository read-only, no network, `--memory 3g`). The container runs the code of its image's version: the quick-rule tier, the plain skip lines and `--engine` need an image built from a version that has them - (`docker build -t openultrasast:dev .`, then `OUSAST_IMAGE=openultrasast:dev`). + (`docker compose build` in a checkout of this repository, which pins the base and + tags `openultrasast:dev`, then `OUSAST_IMAGE=openultrasast:dev`). 4. Remove it with `ousast pre-push uninstall`. Only a hook this tool wrote is removed, and a chained previous hook is restored.