Repository navigation
Description
Problem or Motivation
devops repos onboard takes each answer of the repository template from an option or from the default of the template. It does not read the facts that the repository already holds, so a run with no option records wrong answers in .copier-answers.yml.
Read on 2026-11-26, after devops repos onboard dan-petty/devops-cli --confirm --only 0,1,2,3,4,5,6,7,8,9,10,11:
- The template pull request ci: add the files of the repository template #7307 recorded
release_type: simpleand addedversion.txtwith0.0.0.release-please-config.jsonof devops-cli has"release-type": "python", and the version is inpyproject.toml. The command kept that config file ("Kept as the repository holds them") and still rendered the baseline for the simple type. - Each onboarded repository records
scopes: '': devops-cli, dan-petty/infra (labelsscope/ansible,scope/argocd,scope/helm,scope/infra,scope/k8s,scope/tf), dan-petty/devtools and dan-petty/danielpetty.com (scope/harvester,scope/infra,scope/k8s,scope/pixelfed). The command keeps.github/labels.ymlof the repository, so the labels are right today. A latercopier updatewith the empty answer would render a labels file with the scopes ci, deps and docs only.
Proposed Solution
Disposition: change the code.
- With no
--release-type, the command readsrelease-typeofrelease-please-config.jsonof the repository, when the file is there, and uses it as the answer. - With no
--scope, the command reads thescope/*labels of.github/labels.ymlof the repository, without the scopes that the template always adds, and uses them as the answer. - An option that differs from the fact of the repository stops the run with one line that names the two values.
- The plan prints each answer and its source (option, repository or default), so a person sees it before
--confirm.
Proof: a test over the fake GitHub API with a release-please-config.json of the type python gives release_type: python and a baseline with no version.txt. A second test with a labels file gives the scopes answer.
Existing Tool Considered
Copier, in use: it takes each answer as data (--data). The command already reads the files of the repository through the GitHub API.
Alternatives check of 2026-11-26: in-use.
The repository already uses this tool.
Tool: copier (https://pypi.org/project/copier), MIT, last activity 2026-10-13, maintained.
Reason: Searches found no tool that derives template answers from a repository's own files; the named template engine only accepts answers as data, so the repository reading, conflict check and plan sources stay project code.
Covers:
- Takes each template answer as data on the command line
- Renders the template and writes the answers file
- Updates an onboarded repository from stored answers
Lacks:
- No read of release-type from release-please-config.json
- No read of scope labels from .github/labels.yml
- No refusal when an option differs from the repository
- No plan that names the source of each answer
Proposed design
Problem statement
The onboard command records template answers that the repository denies. A python repository gets release_type: simple and a version.txt, and a repository with scope labels gets scopes: ''. Merged #7406 now derives the release type and the scopes from repository labels. Two parts remain: read the scopes from .github/labels.yml without the three template scopes, and print the source of each answer in the plan. An explicit option overrides a derived answer, as the merged spec requires.
Acceptance criteria
Requirement: Scopes from the labels file
The onboard command SHALL take the scopes answer from the scope/* labels of the repository's .github/labels.yml when the run gives no --scope option.
Scenario: A labels file that holds the template scopes and the repository scopes
- WHEN The fake GitHub API holds a .github/labels.yml with scope/ci, scope/deps, scope/docs, scope/infra and scope/k8s, and the run gives no --scope.
- THEN The recorded answers hold a scopes value that names infra and k8s and names no ci, deps or docs.
Requirement: Plan names the source of each answer
The onboard plan SHALL print each template answer with its source, which is the option, the repository or the default.
Scenario: A plan over a repository that holds a labels file
- WHEN The run gives no --scope and the repository holds scope/infra in .github/labels.yml.
- THEN The plan output shows scopes with the value infra and the source repository.
Requirement: An explicit option overrides the derived answer
The onboard command MUST use the value of an explicit --release-type or --scope option in place of the answer that the repository gives.
Scenario: An explicit release type that differs from the repository
- WHEN The repository holds "release-type": "python" and the run gives --release-type simple.
- THEN The recorded answers hold release_type: simple and the command exits with status 0.
Existing Tool Considered
Copier (https://pypi.org/project/copier), MIT, last activity 2026-10-13, maintained, verdict in-use: the repository already uses it. The alternatives check of 2026-11-26 in the issue body records what copier covers and lacks. The proposal keeps copier for the render and the answers file. It writes the two steps that copier lacks as project code: the read of the scope/* labels of .github/labels.yml, and the plan line of each answer. That code is about 60 lines in src/devops_cli/github/onboard/ with two tests.
Key questions
- Which parts of the answer derivation does the merged code already hold?: Merged fix(repos): derive the template answers of an existing repository #7406 reads release-type from release-please-config.json and the scope/* labels when .copier-answers.yml is absent: derive_answers(config_text, labels) at src/devops_cli/github/onboard/baseline.py:168 and _Run.read_baseline at src/devops_cli/github/onboard/run.py:168-190. This proposal does not deliver that part again. [sources: src/devops_cli/github/onboard/baseline.py:168, src/devops_cli/github/onboard/run.py:168-190, openspec/specs/repos-onboard/spec.md:557-566]
- Does an explicit option that differs from the repository fact stop the run?: No. The merged spec scenario Flag overrides derived answer says explicit --release-type and --scope flags MUST override derived values. The test test_render_answers_prefers_flags_over_derived_and_keeps_unflagged_derived asserts it. This proposal drops the stop that the issue body asks for, because it would break the merged spec and its test. (best practice) [sources: openspec/specs/repos-onboard/spec.md:557-566, tests/github/onboard/test_onboard_baseline.py:64]
- Chosen: An explicit option overrides the derived answer. The merged spec and its test from fix(repos): derive the template answers of an existing repository #7406 require the override.
- Rejected: Stop with one line that names the two values. It contradicts the merged spec Flag overrides derived answer and fails the merged test.
- Which labels form the scopes answer?: Each scope/* label of .github/labels.yml except scope/ci, scope/deps and scope/docs, which the template renders itself. (best practice) [sources: .github/labels.yml]
- Chosen: The scope/* labels except the three template scopes. The template default answer is ci, deps and docs, so the answer holds only the repository's own scopes.
- Rejected: All scope/* labels of the repository. A copier update would duplicate the three scopes that the template adds.
- Does the plan print each answer with its source?: Yes. The plan prints each answer with its source: the option, the repository or the default. (best practice) [sources: AGENTS.md]
- Chosen: Print each answer with its source. A person can check each answer before --confirm, as rule 2 of AGENTS.md asks.
- Rejected: Print only the answers that the repository gives. A partial list hides the answers that came from the default.
- Rejected: Print nothing extra. A person would confirm answers that no line shows.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 26, 2026
Both fix 'devops repos onboard' to read a value from the repository instead of requiring manual input, but #7305 reads the release App client ID while this candidate reads release-type and scope.devops-cli-service commentedon Nov 26, 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:
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.
dan-petty commentedon Nov 29, 2026
Returning #7309 to New because merged #7406 (commit
0b8cf5fef, PR #7638) already implemented template answer derivation for the same incident (#7307) with a directly conflicting specification for CLI flags:derive_answers(config_text, labels)(src/devops_cli/github/onboard/baseline.py:168) and_Run.read_baseline(src/devops_cli/github/onboard/run.py:168-190) already readrelease-typefromrelease-please-config.jsonandscope/*from repository labels when.copier-answers.ymlis absent.--release-typeor--scopeflag that differs from the repository fact must stop with a nonzero exit status (An option that differs from the repository stops the run), whereas the merged spec from fix(repos): derive the template answers of an existing repository #7406 (openspec/specs/repos-onboard/spec.md:557-566, ScenarioFlag overrides derived answer) explicitly mandatesexplicit --release-type and --scope flags MUST override derived values, asserted bytests/github/onboard/test_onboard_baseline.py:64(test_render_answers_prefers_flags_over_derived_and_keeps_unflagged_derived).Because implementing #7309 as written would break #7406's merged specification and tests (and
#7309's remaining deltas—reading.github/labels.ymlwhile excludingscope/ci,scope/deps,scope/docsand printing plan answer sources—need reconciliation against#7406), returning with evidence per AGENTS.md rule 2.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.
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC