refactor: simplify image helpers and tests #77

Merged
claudiomaradonna merged 3 commits from refactor/image-helper-contracts into master 2026-11-15 11:07:56 +01:00
Collaborator

Why

Maintainers changing custom-image handling have to trace caller-local variables across approval, reuse, and build helpers. Shared tests also hide their single representative client behind repeated loops and duplicate shell-command decoding.

What changed

Give image helpers explicit arguments and named result outputs. Select refresh policy at the call site and construct build options in the build helper, preserving approval prompts, headless reuse, provenance checks, and exit statuses.

Run shared core tests directly with Codex and share one argument decoder. Preserve every assertion, test name, genuine client matrix, and production behavior pin. Most of the test diff is indentation; git diff -w origin/master...HEAD -- tests shows the structural changes.

Correct the documented Linux architecture requirements, provide the portable approval-record lookup, and align contributor instructions with the simplified tests.

How to verify

With Bash 4.4 or newer, Make, ShellCheck, and the repository's test tools available, run:

make lint && .agents/hooks/shellcheck.sh repo && make test

Expect 80 unit tests and 248 integration tests to pass, 328 total. The vendored engine stubs serve both runtime paths, so these checks need no real container engine or client credentials.

The refactored tests also pass against the original production code, with identical passing names and order. Existing image-lifecycle, dispatch, harness, and runner test bodies remain unchanged.

Real rootless-Podman end-to-end tests and real macOS checks were not run.

## Why Maintainers changing custom-image handling have to trace caller-local variables across approval, reuse, and build helpers. Shared tests also hide their single representative client behind repeated loops and duplicate shell-command decoding. ## What changed Give image helpers explicit arguments and named result outputs. Select refresh policy at the call site and construct build options in the build helper, preserving approval prompts, headless reuse, provenance checks, and exit statuses. Run shared core tests directly with Codex and share one argument decoder. Preserve every assertion, test name, genuine client matrix, and production behavior pin. Most of the test diff is indentation; `git diff -w origin/master...HEAD -- tests` shows the structural changes. Correct the documented Linux architecture requirements, provide the portable approval-record lookup, and align contributor instructions with the simplified tests. ## How to verify With Bash 4.4 or newer, Make, ShellCheck, and the repository's test tools available, run: ```sh make lint && .agents/hooks/shellcheck.sh repo && make test ``` Expect 80 unit tests and 248 integration tests to pass, 328 total. The vendored engine stubs serve both runtime paths, so these checks need no real container engine or client credentials. The refactored tests also pass against the original production code, with identical passing names and order. Existing image-lifecycle, dispatch, harness, and runner test bodies remain unchanged. Real rootless-Podman end-to-end tests and real macOS checks were not run.
claudiomaradonna deleted branch refactor/image-helper-contracts 2026-11-15 11:08:01 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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
claudiomaradonna/azkaban!77
No description provided.