refactor(launcher): remove code no launch runs #70
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/launcher-dead-code"
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
bin/azkabanis the launcher that starts each client in its containerand decides what the container may see; it is the file a contributor
reads to change a launch, and a reviewer to audit one. Two things in it
did no work and cost that reader time.
The check that no component of
~/.azkaban/mcpis a symlink could notfire. Every component above the directory also lies on the path of the
identity folder, which the launcher checks first on every launch, and
the directory itself has its own test one line above. No test reached
the check, and the test written for that case accepted either message.
Eight array expansions carried the guard
"${a[@]+"${a[@]}"}", whichBash older than 4.4 needs under
set -u. The launcher refuses such ashell at its twelfth line, and
install.shalready expands empty arraysplainly.
Set aside: keeping the check as a second guard, which no test can
exercise while the first one stands.
What changed
Nothing a user meets changes: a launch refuses the same paths with the
same messages. A reader of
_azk_require_safe_mcp_dirnow finds the onecheck that can fire, with a comment saying where the components above
the directory are checked, and arrays expanded as
"${name[@]}".The first commit pins, in
tests/integration/test_mcp.sh, that asymlinked
~/.azkabanstops a dry run too, and that the identityfolder's check is the one that refuses it; the other two change
bin/azkaban.How to verify
Have Git and Bash 4.4 or newer, on Linux. No container engine is
needed: the launch below stops before it would call one.
On
masterthe launch printscodex: identity folder '<scratch>/home/.azkaban/identities/default' contains a symlink componentand
exit 1: the identity folder's check answers, never the MCP one,and the two counts are
1and8. Aftergit switch refactor/launcher-dead-codethe launch prints the sameline and
exit 1, and both counts are0.Checks run on the tip:
make lint && .agents/hooks/shellcheck.sh repo && make testpasses, 352 tests; the pin passes on
masteras well. Not tried: Bash4.4 itself, since the tests ran on Bash 5.3 only.
Considerations
The plain expansion of an empty array under
set -uis valid from Bash4.4, the version the launcher's gate requires; a real launch also
checks every component of the MCP path again after creating the
directory.
"${a[@]+"${a[@]}"}" protects an empty array from set -u in Bash older than 4.4, which the launcher's gate refuses before this code runs. install.sh already expands empty arrays plainly.aae60acbe8tobeff7a8834