Plan how an existing bench picks up template changes (copier update)
Problem
bench scaffold runs copier copy and nothing else — never copier update. That
is the right call for the current slice (an update on a non-TTY prompts and fails,
and --overwrite on the repo phase would clobber CI config, README and
CODEOWNERS), but it means an existing bench can never pick up later template
changes: migrations, base-image bumps, or a security fix to
Dockerfile.assembly itself. Today the only path is a manual, undocumented one.
Raised by @theoretick in common-template-copier!880#note_3658291206, which asked for a tracked plan rather than a fix in that MR.
This matters more now than it did before !57 (merged): the image recipe used to be
generated from a fixture compiled into the bench binary, so a bench picked up a
new base image by upgrading bench. It is now a checked-in file, so an old bench
keeps an old recipe indefinitely.
What already exists
- The repo render is updatable in principle. It writes
.copier-answers.ymlat the repository root, recording_commitand_src_path, which is allcopier updateneeds. - Renovate covers the case that worried the reviewer most. A scaffolded bench
extends
renovate-common, whose dockerfile manager bumpsFROMpins in checked-in Dockerfiles — so a base-image CVE reaches an existing bench as an MR without any re-scaffold. That was a stated reason for moving the recipe into the template. It does not cover template changes to any other line, or_migrations. Dockerfile.assemblyis deliberately not in_skip_if_exists, so it is one of the files an update could carry, unlike/Dockerfile.
What blocks an update path
- Component renders cannot be updated at all. The template's
_excludedrops everything but the handler files incomponentmode, so no.copier-answers.ymlis written intointernal/<pkg>/— verified on a scaffolded sandbox. Any update story is therefore repo-phase only, which is probably fine (the handler is user code by then) but should be stated rather than discovered. _src_pathrecords whateverBENCH_TEMPLATE_URLwas. A bench scaffolded with the local-checkout override records a filesystem path, and an update from that answers file would read a directory that does not exist on anyone else's machine.- Non-TTY conflicts. An unchanged template and unchanged file report "identical" with no prompt, but a changed recipe or a user edit produces a conflict and an interactive prompt, which fails in CI. That is arguably the correct failure — your image recipe changed upstream, decide — but it means re-scaffolding cannot be automated as-is.
--trustre-runs hooks and_taskson update, including the template'sgo mod tidy(currently gated off for labbench, !880).- Answers arrive as strings. bench passes every answer with
-d, so a Jinja validator sees"false"rather thanfalse; that already breaks a Rust bench on any template ref newer thanv1.64.0(thehandler_funcPascalCase validator) and would break an update the same way, since questions are re-asked. Possibly the same fix as switching to a typed--data-file. - Copier version floor. The template sets
_min_copier_version: 9.12.0because_skip_if_existsanchoring is only correct onupdatefrom that version; bench preflights thatcopierexists but not which version.
Options
bench scaffold --updatewrappingcopier updatefor the repo phase only, with the answers-file and_src_pathcaveats handled explicitly.- Document a manual procedure in the bench docs and keep bench out of it — cheapest, and enough while the number of benches is small.
- Lean on Renovate for pins and accept drift elsewhere, revisiting when a
template
_migrationactually needs to reach a bench.
Deciding between these needs no code, so the first deliverable is a short decision note rather than an implementation.