Repository navigation
Description
Problem
devops repos onboard <repo> --confirm with no answer flags renders the infra template with default answers, also for a repository that already has a release setup and scopes. render_answers (src/devops_cli/github/onboard/baseline.py:140-155) gives empty scopes, release_flow: true and no release_type, so Copier takes its default simple.
Evidence: the template pull request #7307, made by an onboard run with no flags, has release_type: simple and scopes: ''. devops-cli releases with release-please release-type: python and has 47 scope/* labels. The simple answer also renders version.txt with 0.0.0. After the merge, check_answer_flags (baseline.py:96-116) refuses a flag that differs from .copier-answers.yml, so the wrong answers stay until a person runs copier update --data. #7307 is closed for this reason. dan-petty/vibes#314 came from the same kind of run.
Done when
- For a repository with no
.copier-answers.yml, onboard readsrelease-typeofrelease-please-config.jsonand thescope/*labels as the default answers, or refuses the render with a message that names the missing--release-typeand--scopeflags. - A flag still wins over a value that onboard reads.
- Tests prove both: a repository with
release-please-config.jsonof typepythonand scope labels, and a new empty repository.
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches found no tool that infers template answers from a repository's release-please config or scope labels; Copier only renders from answers the caller passes, so onboard must read those facts itself.
Lacks:
- No reading of release-please-config.json for release-type
- No discovery of scope labels as answers
- No derivation of answers from an existing repository
Proposed design
Problem statement
devops repos onboard <repo> --confirm renders the infra template with default answers when a repository already has a release setup and scopes. render_answers gives empty scopes and no release_type, so Copier takes simple and writes version.txt with 0.0.0. The template pull request dan-petty/devops-cli#7307 failed this way. The fix derives the answers from release-please-config.json and the scope/* labels when no .copier-answers.yml exists. A given flag keeps priority.
Acceptance criteria
Requirement: Derive the release type from the repository config
derive_answers SHALL take release_type from the release-type key of the text of release-please-config.json.
Scenario: Config of type python
- WHEN
derive_answersgets the text of arelease-please-config.jsonwith"release-type": "python"and an empty label list. - THEN It returns
{"release_type": "python"}.
Requirement: Derive the scopes from the labels
derive_answers SHALL set scopes from the sorted scope/* labels of the repository.
Scenario: Two scope labels
- WHEN
derive_answersgets no config text and the labelsscope/roadmapandscope/cli. - THEN It returns
{"scopes": "cli,roadmap"}.
Requirement: A flag wins over a derived value
An answer flag MUST override the value that onboard derives from the repository.
Scenario: Flag differs from the config
- WHEN
render_answersgets no answers file, the derived answers{"release_type": "python"}and options withrelease_typenode. - THEN The returned answers hold
release_typenode.
Requirement: A derived value stays when its flag is absent
render_answers MUST keep a derived value when the caller gives no flag for that answer.
Scenario: No scope flag
- WHEN
render_answersgets no answers file, the derived answers{"scopes": "cli,roadmap"}and options with no scope. - THEN The returned answers hold
scopescli,roadmapand not"".
Requirement: A new repository keeps the template defaults
derive_answers SHALL return no answer when the repository holds no release setup and no scope label.
Scenario: Empty repository
- WHEN
derive_answersgets no config text and an empty label list. - THEN It returns an empty dict, so Copier keeps its own defaults.
Requirement: An unreadable config stops the render
derive_answers MUST raise BaselineUnreadableError with a message that names --release-type when the config text is not valid JSON.
Scenario: Invalid config
- WHEN
derive_answersgets the text{as the config and an empty label list. - THEN It raises
BaselineUnreadableErrorand the message names--release-type.
Existing Tool Considered
The alternatives check of 2026-11-27 in the issue body gives the verdict none with no tool: Copier renders only from the answers that its caller passes, so no tool derives the answers of an existing repository. The block lists what a tool would lack. The fix builds the two reads itself in src/devops_cli/github/onboard/baseline.py: about 80 lines of Python and one test module, about 6k tokens and 2 hours of work, with no new dependency to keep or patch.
Key questions
- When the repository gives no fact for an answer, does onboard refuse the render or keep the template default?: Keep the template default when the repository holds no release setup and no scope label, so a new repository onboards as today. Stop with an error only when a
release-please-config.jsonexists and does not parse, because that repository has a release setup and a silentsimpleanswer is the defect of ci: add the files of the repository template #7307. (best practice) [sources: src/devops_cli/github/onboard/baseline.py:145, src/devops_cli/github/onboard/baseline.py:101, src/devops_cli/github/onboard/run.py:156]- Chosen: Derive, keep the default when the repository is empty, refuse an unreadable config. A new repository has no fact to derive, and an unreadable config hides the release setup that caused ci: add the files of the repository template #7307.
- Rejected: Refuse each render that cannot derive both answers. It stops the onboard of a new repository, which the done-when keeps working.
- Rejected: Always render the defaults and never refuse. It keeps the silent
simpleanswer for a repository whose config exists but does not parse.
- In what form does the derived
scopesanswer go to Copier?: A sorted, comma-joined string, the same form that the--scopeflag path builds, becausecheck_answer_flagscompares the answer string with the flag value. (best practice) [sources: src/devops_cli/github/onboard/baseline.py:145, src/devops_cli/github/onboard/baseline.py:113]- Chosen: Sorted comma-joined string. It matches the existing flag path and the string compare of
check_answer_flags. - Rejected: YAML list. The flag path and the compare in
check_answer_flagshold a string, so a list breaks both.
- Chosen: Sorted comma-joined string. It matches the existing flag path and the string compare of
- Does the change alter
check_answer_flags?: No.check_answer_flagscompares a flag with an existing.copier-answers.ymlonly, and the derivation applies when that file is absent. A repository with wrong answers in the file still needscopier update --data, which is out of this item. (best practice) [sources: src/devops_cli/github/onboard/baseline.py:101, src/devops_cli/github/onboard/baseline.py:113, src/devops_cli/github/onboard/run.py:153]- Chosen: Leave the flag check unchanged. The defect is the render with no answers file, and the check already refuses a flag that differs from the file.
- Rejected: Also rewrite a wrong answers file. It adds a write path and needs the
copier update --datastep that a person runs.
- Does
render_answersalready ignore the derivation when the repository has a.copier-answers.yml?: Yes. It returns the keys of the file and ignores the flags, so the derivation applies only when the file is absent. [sources: src/devops_cli/github/onboard/baseline.py:145, src/devops_cli/github/onboard/run.py:156] - Where does onboard read the labels and the config text?: In the caller of
render_answers, through the GitHub session of the onboard run.render_answersandderive_answersstay pure, so a test needs no double for a process edge. (best practice) [sources: src/devops_cli/github/onboard/run.py:156, src/devops_cli/github/onboard/baseline.py:145, src/devops_cli/github/onboard/model.py:112]- Chosen: Read in the caller and pass the facts to a pure function. A pure function gives a test of the derivation with no GitHub double.
- Rejected: Read GitHub inside
render_answers. It puts a process edge in the render and forces a double in each test.
- Which key of
release-please-config.jsonholds the release type, and what value does devops-cli use?: The root keyrelease-type, and devops-cli setspython. [sources: release-please-config.json, src/devops_cli/github/onboard/model.py:114]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
onboard derives release-type and scope answers from the repository's release-please-config.json and scope labels instead of using template defaultsas the change that both ask for.Both items ask onboard to read release-type and scopes from the repository's existing facts and use them as defaults when no flags are given.A person closes one of the two if that is so.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 (8)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC