Repository navigation
Description
Problem
devops repos onboard keeps each template file that the repository already holds with other text (template_row, src/devops_cli/github/onboard/template_pr.py:216-236), but the template pull request adds .copier-answers.yml. Copier then treats each kept file as a file of the template. The next copier update from Renovate makes a 3-way merge of the kept file, and each change of the template near a changed line gives conflict markers. The Renovate pull request then cannot merge.
Evidence
- chore(deps): update https://github.com/dan-petty/infra.git to v0.24.3 dotfiles#18 (copier update to v0.24.3, closed with no merge) committed
<<<<<<< before updatingmarkers in.github/labels.yml: the header comment of the kept file against the new header oflabels.yml.jinja. - ci: add the files of the repository template vibes#314 keeps
.github/labels.yml,.github/CODEOWNERS,.github/renovate.jsonand.pre-commit-config.yaml. In a scratch clone of its head,copier update --skip-answered --defaults --vcs-ref v0.25.0 --conflict inline(Copier 9.19.1) left.github/labels.ymlunmerged (UU), with one conflict block on the header comment. v0.25.0 is the current release, so the first Renovate copier update after the merge of vibes#314 holds this conflict.
Proposed Solution
Disposition: decide the owner of a kept file, then change the code. Two forms:
- The template pull request also brings each kept file to the text of the template, with the facts of the repository as answers (fix(repos): onboard reads the template answers from the repository #7309 reads the scopes from
.github/labels.yml). Then the next update has the template text as its base and applies with no conflict. - Or the repository stays the owner, and the answers file records it so that
copier updatedoes not touch the file (Copier--skip,skip_if_exists).
Existing Tool Considered
Copier, in use: copier update does the 3-way merge, and skip_if_exists keeps a file that exists. No tool chooses the owner of a file that both the repository and the template hold.
Acceptance criteria
- A test renders the template over a repository that holds
.github/labels.ymlwith other text, runscopier updateto a newer tag of the template, and finds no conflict marker.
Related: #7309 (the answers of onboard), dan-petty/infra#214 (the SHA pin of the callers).
Alternatives check of 2026-11-27: in-use.
The repository already uses this tool.
Tool: copier-org/copier (https://github.com/copier-org/copier), MIT, last activity 2026-11-26, maintained.
Reason: Searches found no tool beyond Copier, which the issue already names as in use: it runs the 3-way update merge and can skip an existing file, but it decides no owner for a kept file, so the conflict remains.
Covers:
- Three-way merge of a template update to a newer ref
- Keeps a destination file that already exists
- Records the template and answers in a file
Lacks:
- No per-file decision of which side owns it
- Kept file still enters the update merge and conflicts
- No exclusion of a kept file from later merges
Proposed design
Problem statement
devops repos onboard keeps each template file that the repository already holds with other text. The template pull request adds .copier-answers.yml, so Copier treats the kept file as a template file. The next copier update merges the kept file against a changed template and writes conflict markers. The Renovate pull request then cannot merge.
Acceptance criteria
Requirement: Template text replaces a kept file
template_row SHALL write the rendered template text for a kept file and SHALL return no kept path.
Scenario: Repository holds a labels file with another header
- WHEN A test calls
template_rowwith a fake repository, a fake baseline, and a fake writer. The repository holds.github/labels.ymlwith another header. - THEN The writer records one write of
.github/labels.ymlwith the textbaseline.files[".github/labels.yml"]. The kept paths thattemplate_rowreturns are empty.
Requirement: A kept file alone opens the template pull request
template_row SHALL open the template pull request when the repository holds at least one kept file and lacks no template file.
Scenario: Repository holds every template file with other text
- WHEN A test calls
template_rowwith a fake repository that holds each template file with other text. The repository has no open template pull request. - THEN The writer records the create of branch
ci/repository-templateand draft pull requestci: add the files of the repository template.
Requirement: Pending a person after the merge
After the merge, a copier update to the next template tag MUST apply with no conflict on a kept file.
Scenario: Copier update of a repository that kept its labels file
- WHEN A person runs
copier update --skip-answered --defaults --vcs-ref <the next tag> --conflict inlinein a clone. The repository onboarded while it held.github/labels.ymlwith other text. - THEN
git status --porcelainlists no unmerged path..github/labels.ymlholds no<<<<<<<,=======or>>>>>>>marker.
Existing Tool Considered
Copier (https://github.com/copier-org/copier), in use; the alternatives check of 2026-11-27 in the issue body records what Copier covers and lacks. The change makes the template the owner of each kept file: it writes the rendered template text, so the next copier update uses that text as the base.
Key questions
- Where does the onboard command decide to keep a template file that the repository already holds with other text?:
_file_statescompares the template files at the baseline ref with the repository. It returns the files that the repository holds with other text as kept.template_rowreceives that kept list. [sources: src/devops_cli/github/onboard/template_pr.py:80, src/devops_cli/github/onboard/template_pr.py, docs/repos/onboard.md] - Which form of the proposed solution should the change take?: The template pull request writes the rendered template text for each kept file. A repository fact that differs becomes an answer in
.copier-answers.yml, not an edit of the file. The file then equals the template text that the nextcopier updateuses as its base. (best practice) [sources: docs/adr/0035-the-onboard-command-owns-the-repository-settings.md, openspec/changes/archive/2026-11-22-6773-repos-onboard/design.md, openspec/specs/repos-onboard/spec.md, docs/repos/onboard.md]- Chosen: Template text, with the repository facts as answers. ADR 0035 gives the onboard command ownership of the repository settings. The answers keep the write lossless, so the file becomes the base of the next update and the conflict goes. The change amends the spec rule that a kept file stays.
- Rejected: Template text over every kept file, with no answer for its facts. The 2026-11-22 design rejected this overwrite because it undoes the repository's changes at each run.
- Rejected: A skip in the answers file. The alternatives check records that Copier has no exclusion of a kept file from later merges. The kept file still enters the update merge, so the conflict remains.
- Does the answers file make Copier skip a kept file?: No. The alternatives check of 2026-11-27 in the issue body records that a kept file still enters the update merge and that Copier has no exclusion of a kept file from later merges.
read_answersreads the answers file that the command writes. [sources: src/devops_cli/github/onboard/baseline.py:94] - Does the rendered labels file keep the repository's scopes?: Only when
.copier-answers.ymlholds thescopesanswer. A render with noscopesanswer writes the default scopes and drops thescope/*labels of the repository. fix(repos): onboard reads the template answers from the repository #7309 fills that answer from.github/labels.yml, so this change depends on fix(repos): onboard reads the template answers from the repository #7309. [sources: src/devops_cli/github/onboard/baseline.py, docs/repos/onboard.md] - What does the template row do when the repository lacks no template file?: It reads the check runs of the open template pull request. The change also opens the template pull request when the repository holds at least one kept file, because the rendered text is a change that the row must push. (best practice) [sources: docs/repos/onboard.md, src/devops_cli/github/onboard/template_pr.py]
- Chosen: Open the template pull request for a kept file. The rendered text is a change to the repository. A later run has no missing file to write, so the row must open the pull request now.
- Rejected: Keep the row at
presentand wait. No later run writes the rendered text, so the kept file still conflicts at the nextcopier update.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 27, 2026
Both work on the onboard template PR and .copier-answers.yml, but #7309 fixes wrong answers recorded while this candidate fixes conflict markers on kept files during copier update.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
ci: update the repository template to v0.25.2
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
test(roadmap): record copier in NOT_IN_RUNNER for live template test (#…
test(repos): cover missing default branch commit in template_pr (#7411)
test(roadmap): record copier in NOT_IN_RUNNER for live template test (#…
test(repos): cover missing default branch commit in template_pr (#7411)
docs(repos): align onboard OpenSpec specs and test names (#7411)
chore(main): release 0.258.2 (#7853)
devops-cli-service commentedon Nov 30, 2026
Released in v0.258.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.258.2
fix(repos): onboard keeps the files that a repository owns (#7883)