refactor: dedupe launcher, installer, test harness #81
No reviewers
Labels
No labels
bug
cannot reproduce
duplicate
enhancement
help wanted
invalid
need info
need triage
need verification
not a bug
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
claudiomaradonna/azkaban!81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor-dedup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The same maintainers keep the dispatcher, the installer, and the test
suite, and today four pieces of their logic exist in several copies, so
changing one means remembering the others: the installer reaches the
container engine through two paths (direct
"$AZK_HOST_ENGINE"calls andthe host library's
azk_host_engine), the base and client buildsassemble the same
buildinvocation twice, the operator confirmation iswritten three times, and the test harness repeats its result-capture tail
ten times. This change gives each of them one home and keeps the behavior
callers and tests see identical.
What changed
"$AZK_HOST_ENGINE" …invocations ininstall.shnow go throughazk_host_enginefromlib/azk-host.sh,which resolves the engine and runs it with the host environment plus
LC_ALL=C— the way every other engine call already ran. The recordedengine argv stays byte-identical; the pins of the first commit prove
it, including the
--versionprobe line and environment inheritance._azk_install_build_image LABEL TARGET IMAGE EXTRA…in
install.shassembles thebuildinvocation shared by the base andthe client builds; each caller keeps only its own build-args.
_azk_confirm "PROMPT" y|ninbin/azkabanownsthe prompt read and the yes-parse; the workspace, custom-image
approval, and shared-image update prompts call it. Prompt texts, the
per-prompt defaults, and today's treatment of an empty line and a
closed terminal as no are unchanged; each caller still owns its own
outcome path.
_launch_capturedand_capture_resultintests/helpers.shhold theEXIT_CODE/STDOUT/STDERRtail that tenrunners copied; each runner keeps only its own part — the launcher
symlink, the
envwrapper, the stdin file, the pty status file.How to verify
From a fresh checkout, on the base (
01e9109) and on this branch:make test TESTS='install_pulls install_builds install_engine'asserts the exact recorded argv of the pull, tag,version-probe, and build calls, including the full macOS
containersequence. Same results on both revisions.
make test TESTS=install_enginerunstest_engine_calls_inherit_the_installer_environment, which reads thestub's per-call environment record. Passes on both revisions.
make test TESTS='arg_parsing custom_image_approval custom_image_shared auto_pull'runs the accept, decline, empty-line,and closed-stdin matrices of all three prompts. Same results on both
revisions.
make testcovers every runner through thesuites that use it.
All scenarios were run on the branch tip: the engine suites pass, the
confirmation suites pass (43 tests), and the pins — added before any
code change — passed on the base's code and pass on the tip. The
networked release gate,
make test-e2e, was not run: it needs realrootless Podman and stays outside the project's Verify.
Checks run: the Verify command
make lint && .agents/hooks/shellcheck.sh repo && make testpasses on6b5e210(331 tests, 0 failures).Change and security reviews ran on the tip with no findings to fix.
Considerations
LC_ALL=C, as launcherengine calls already did: version and message parsing becomes
deterministic, with diagnostics text the only thing it can affect.
in
bin/azkabanandinstall.share bootstrap code that must runbefore any Bash-only syntax and is tested at each entry point
separately; the
podman_argsmount-scan loops already share theirreading in
_azk_split_mount; sharing the client build between theinstaller and
lib/azk-image.shwould cross a process and a trustboundary; and the harness's
workspace_keykeepsazk_host_sha256's logic independent of production code on purpose.