feat(launcher): add --answer-yes #91

Merged
claudiomaradonna merged 2 commits from feat/answer-yes into master 2026-11-26 06:36:13 +01:00
Collaborator

Why

The launcher builds a workspace Dockerfile.azkaban or
Dockerfile.<client> only after someone approves its content at a
terminal. An automated flow that reaches a repository carrying one has
nobody to answer: without a terminal a shared file only reuses an image
approved earlier and otherwise stops the launch, and a client's file is
skipped. Approval goes by the workspace path, so a job in a fresh folder
never finds an earlier approval. What remained was to give the launcher
a pseudo-terminal and type y into it.

What changed

--answer-yes answers each launcher question yes, with or without a
terminal, and writes the question with the answer it took to standard
error. Before, a headless launch could not approve or update; now it
approves, records, and builds a new Dockerfile, updates an approved
shared image at every launch, and uses the current directory when no
workspace is given. --dry-run says what the launch would approve,
update, or leave.

The option approves a Dockerfile only in a workspace without an approval
record. Where a record exists, of either file, a new or changed file is
answered no, as under --answer-default: the container can write both
files, so content written in the workspace stays out of the build on the
host (_azk_workspace_has_approval, lib/azk-image.sh).

The option exists only on the command line, and together with
--answer-default it stops the launch. Without it every launch behaves
as before.

docs/custom-images.md and docs/automation.md say what the option
answers and how a flow uses it: on a checkout it trusts, with
--skip-custom-images for a pull request, and by deleting the
workspace's records, on a restored checkout, when the trusted branch
changes its Dockerfile.

How to verify

Set-up needs nothing beyond Bash: the tests run against the vendored
Podman stub. Base master at 29a785f, branch feat/answer-yes at
b93eb72.

On the branch:

make test FILTER='answer_yes|help_is_generated'

It runs five tests and reports 0 failure(s) for each file: a new
shared or client Dockerfile is approved and built without a terminal,
an approved shared image is updated, a Dockerfile in a workspace that
has an approval stays unapproved, the current directory is used unasked,
and --help lists the option. Run as written: passed.

On the base, with the branch's tests:

git worktree add --detach ../answer-yes-base master
git archive feat/answer-yes tests | tar -x -C ../answer-yes-base
make -C ../answer-yes-base test FILTER='answer_yes|help_is_generated'

The same five tests fail at their assertions on the option's behaviour,
since master passes --answer-yes on to the client. Run with the
tests of each task's tip: failed as expected.

Checks run on the branch: make lint, .agents/hooks/shellcheck.sh repo
and make test passed, 353 tests, 0 failures.

Considerations

The option builds content nobody read, on the host's engine and with the
workspace as build context, so it belongs on a checkout the operator
trusts, before a session has written to the folder: a Dockerfile a
session leaves in a folder that had none counts as new.

In a repository with both a Dockerfile.azkaban and a
Dockerfile.<client>, the second file a launch meets is answered no and
needs a terminal, or the deletion of the workspace's records.

An accepted update pulls the client image at every launch, whatever
AZKABAN_AUTO_PULL says.

Review findings set aside, each low and from the last round: the README
row says "after an approval" where --help says "where the workspace
has an approval"; docs/automation.md says "untracked files removed"
without naming ignored files; one comment line in lib/azk-image.sh runs
past the block's width; and the help footer's "approves and builds a new
Dockerfile" leaves the no-approval condition to the option's own line.

## Why The launcher builds a workspace `Dockerfile.azkaban` or `Dockerfile.<client>` only after someone approves its content at a terminal. An automated flow that reaches a repository carrying one has nobody to answer: without a terminal a shared file only reuses an image approved earlier and otherwise stops the launch, and a client's file is skipped. Approval goes by the workspace path, so a job in a fresh folder never finds an earlier approval. What remained was to give the launcher a pseudo-terminal and type `y` into it. ## What changed `--answer-yes` answers each launcher question yes, with or without a terminal, and writes the question with the answer it took to standard error. Before, a headless launch could not approve or update; now it approves, records, and builds a new Dockerfile, updates an approved shared image at every launch, and uses the current directory when no workspace is given. `--dry-run` says what the launch would approve, update, or leave. The option approves a Dockerfile only in a workspace without an approval record. Where a record exists, of either file, a new or changed file is answered no, as under `--answer-default`: the container can write both files, so content written in the workspace stays out of the build on the host (`_azk_workspace_has_approval`, `lib/azk-image.sh`). The option exists only on the command line, and together with `--answer-default` it stops the launch. Without it every launch behaves as before. `docs/custom-images.md` and `docs/automation.md` say what the option answers and how a flow uses it: on a checkout it trusts, with `--skip-custom-images` for a pull request, and by deleting the workspace's records, on a restored checkout, when the trusted branch changes its Dockerfile. ## How to verify Set-up needs nothing beyond Bash: the tests run against the vendored Podman stub. Base `master` at `29a785f`, branch `feat/answer-yes` at `b93eb72`. On the branch: ```bash make test FILTER='answer_yes|help_is_generated' ``` It runs five tests and reports `0 failure(s)` for each file: a new shared or client Dockerfile is approved and built without a terminal, an approved shared image is updated, a Dockerfile in a workspace that has an approval stays unapproved, the current directory is used unasked, and `--help` lists the option. Run as written: passed. On the base, with the branch's tests: ```bash git worktree add --detach ../answer-yes-base master git archive feat/answer-yes tests | tar -x -C ../answer-yes-base make -C ../answer-yes-base test FILTER='answer_yes|help_is_generated' ``` The same five tests fail at their assertions on the option's behaviour, since `master` passes `--answer-yes` on to the client. Run with the tests of each task's tip: failed as expected. Checks run on the branch: `make lint`, `.agents/hooks/shellcheck.sh repo` and `make test` passed, 353 tests, 0 failures. ## Considerations The option builds content nobody read, on the host's engine and with the workspace as build context, so it belongs on a checkout the operator trusts, before a session has written to the folder: a Dockerfile a session leaves in a folder that had none counts as new. In a repository with both a `Dockerfile.azkaban` and a `Dockerfile.<client>`, the second file a launch meets is answered no and needs a terminal, or the deletion of the workspace's records. An accepted update pulls the client image at every launch, whatever `AZKABAN_AUTO_PULL` says. Review findings set aside, each low and from the last round: the README row says "after an approval" where `--help` says "where the workspace has an approval"; `docs/automation.md` says "untracked files removed" without naming ignored files; one comment line in `lib/azk-image.sh` runs past the block's width; and the help footer's "approves and builds a new Dockerfile" leaves the no-approval condition to the option's own line.
An automated flow that reaches a repository with a Dockerfile.azkaban
has nobody to answer the launcher, and without a terminal the launcher
only reuses an image approved earlier, so a job in a fresh workspace
never gets its custom image.

--answer-yes answers each question yes, with or without a terminal, and
logs the question with the answer it took. It approves a Dockerfile only
in a workspace without an approval record: where one exists, of either
file, a new or changed file stays unapproved, so content written in the
workspace does not reach a build on the host.
Says what the option answers to each launcher question, that it builds
unread content, and how a flow keeps a pull request's Dockerfile out of
the build: by launching it without the option.
motoko force-pushed feat/answer-yes from b93eb721a2 to 5ee57a5bb6 2026-11-26 06:34:52 +01:00 Compare
claudiomaradonna deleted branch feat/answer-yes 2026-11-26 06:36:19 +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!91
No description provided.