feat(launcher): add --answer-yes #91
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!91
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/answer-yes"
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 launcher builds a workspace
Dockerfile.azkabanorDockerfile.<client>only after someone approves its content at aterminal. 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
yinto it.What changed
--answer-yesanswers each launcher question yes, with or without aterminal, 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-runsays 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 bothfiles, 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-defaultit stops the launch. Without it every launch behavesas before.
docs/custom-images.mdanddocs/automation.mdsay what the optionanswers and how a flow uses it: on a checkout it trusts, with
--skip-custom-imagesfor a pull request, and by deleting theworkspace'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
masterat29a785f, branchfeat/answer-yesatb93eb72.On the branch:
It runs five tests and reports
0 failure(s)for each file: a newshared 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
--helplists the option. Run as written: passed.On the base, with the branch's tests:
The same five tests fail at their assertions on the option's behaviour,
since
masterpasses--answer-yeson to the client. Run with thetests of each task's tip: failed as expected.
Checks run on the branch:
make lint,.agents/hooks/shellcheck.sh repoand
make testpassed, 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.azkabanand aDockerfile.<client>, the second file a launch meets is answered no andneeds a terminal, or the deletion of the workspace's records.
An accepted update pulls the client image at every launch, whatever
AZKABAN_AUTO_PULLsays.Review findings set aside, each low and from the last round: the README
row says "after an approval" where
--helpsays "where the workspacehas an approval";
docs/automation.mdsays "untracked files removed"without naming ignored files; one comment line in
lib/azk-image.shrunspast 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.
b93eb721a2to5ee57a5bb6