fix: answer new prompts when updating child repositories - #40
Merged
Merged
Conversation
- Pass --defaults to copier update in the template distribution workflow; the license prompt added in #34 has no recorded answer in repositories generated before it, so Copier tried to ask interactively and the v2.0.0 run failed - Use the same flags in the template lifecycle CI job so the tested update path matches the one that reaches child repositories
This was referenced Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview and Background
Pushing the
v2.0.0tag ran the template distribution workflow, and itsUpdate template in child repositorystep failed:copier update -Askips questions that already have a recorded answer, but thelicenseprompt added in #34 is absent from.copier-answers.ymlin any repository generated before it. With no answer to reuse and no terminal, Copier aborts. The Release workflow itself succeeded, sov2.0.0exists; only the propagation to child repositories failed.The repository's own
Template lifecyclejob did not catch this because it calledcopier updatewith--defaults, which answers new prompts, while the distribution workflow did not.Related Issues
None. Regression from the
licenseprompt added in #34.Implementation Approach
--defaultsto the distribution workflow'scopier update. Prompts added since the child repository was last updated take their default value; every previously answered question still keeps the child's own answer because-Aremains in place. This is the resolution Copier's own error message points to, and it keeps working for any prompt added in the future.Template lifecycleCI job the same flag set (-A --defaults --trust) so the path exercised in CI matches the one that actually reaches child repositories.The workflow opens a pull request rather than pushing, so a person still reviews whatever the defaults produced before it lands in a child repository.
Changes
.github/workflows/trigger-template-update.yml:copier update -A --defaults --trust, with a comment explaining why--defaultsis required..github/workflows/test.yml: lifecycle job uses the same flags, with a comment tying the two commands together.Impact
v2.0.0onward receivelicense: MIT(the prompt's default) unless they answer otherwise. Theirpyproject.tomlgainslicense = "MIT"andlicense-files = ["LICENSE"]. ALICENSEfile is created only when the repository does not already have one, becauseLICENSEis listed in_skip_if_exists. A repository that wants a different license can edit.copier-answers.ymlbefore merging the generated pull request, or edit the pull request itself.Validation Results
Reproduced the failure and verified the fix against a child repository generated from the
v1.0.0tag and committed as a git repository, mirroring what the workflow does.Also ran the
Template lifecyclejob's steps locally with the new flags: generate fromv1.0.0, commit, update toHEAD, assert a diff and a changed_commit, thenuv build.