Skip to content

feat(repos): answer the coverage question of the template #6876

Open

Description

@dan-petty

Problem

devops repos onboard gives the template answers only through its flags (--release-type, --release-flow, --scope, ...). The template of dan-petty/infra gets a code_coverage question (dan-petty/infra issue of 2026-11-23), and devops-cli needs it set to true, else row 10 removes its code_coverage rule (plan on #6784).

Proposed remedy

  • A flag --code-coverage/--no-code-coverage that gives the answer, with the same rule as the other answer flags: it gives a value only before .copier-answers.yml exists, and the command refuses a flag that differs from that file.

Acceptance criteria

  • A test: --code-coverage renders a baseline whose ruleset holds the code_coverage rule, and a differing flag after .copier-answers.yml exists is refused.
  • docs/repos/onboard.md names the flag.

Dependencies

The dan-petty/infra template question and its release.

Alternatives check of 2026-11-30: in-use.
The repository already uses this tool.
Tool: copier-org/copier (https://github.com/copier-org/copier), MIT, last activity 2026-11-28, maintained.
Reason: Copier renders the template and passes answers with --data, and it records .copier-answers.yml. It gives no code_coverage flag and no refusal of a differing value, so devops-cli must add them.

Covers:

  • Renders project templates from a questionnaire of answers
  • Passes extra answers with the --data option
  • Records answers in .copier-answers.yml for later updates
  • Updates a rendered project from a newer template

Lacks:

  • No --code-coverage flag of its own
  • No refusal when a flag differs from the answers file
  • No code_coverage question; the template owns it
  • No ruleset or baseline check after the render

Proposed design

Problem statement

Add --code-coverage/--no-code-coverage to devops repos onboard; hold the item until the dan-petty/infra template release. The command gives the template answers only through flags. The template gets a code_coverage question, and devops-cli needs the answer true so row 10 keeps the code_coverage rule. The new flag follows the answers-file rule of the other answer flags. The baseline cannot hold the rule before the template release.

Acceptance criteria

Requirement: The command offers the code coverage answer flag

devops repos onboard SHALL offer --code-coverage and --no-code-coverage beside the other answer flags.

Scenario: The help output lists the code coverage flag

  • WHEN A test runs devops repos onboard --help.
  • THEN The output contains --code-coverage and --no-code-coverage.

Requirement: The code coverage flag gives the true answer

devops repos onboard SHALL pass code_coverage=true to the template render when --code-coverage is given and .copier-answers.yml does not exist.

Scenario: The stub copier records the true code coverage answer

  • WHEN A test runs the command with --code-coverage on a repository with no .copier-answers.yml, with a stub copier program on PATH.
  • THEN The stub records code_coverage=true in the --data arguments of its call.

Requirement: The no-code-coverage flag gives the false answer

devops repos onboard SHALL pass code_coverage=false to the template render when --no-code-coverage is given and .copier-answers.yml does not exist.

Scenario: The stub copier records the false code coverage answer

  • WHEN A test runs the command with --no-code-coverage on a repository with no .copier-answers.yml, with a stub copier program on PATH.
  • THEN The stub records code_coverage=false in the --data arguments of its call.

Requirement: The omitted flag adds no code coverage answer

The command MUST add no code_coverage value to the template render when neither --code-coverage nor --no-code-coverage is given.

Scenario: The stub copier records no code coverage answer

  • WHEN A test runs the command with neither flag on a repository with no .copier-answers.yml, with a stub copier program on PATH.
  • THEN The stub records no code_coverage value in the --data arguments of its call.

Requirement: A differing code coverage flag is refused

The command MUST refuse a --code-coverage or --no-code-coverage value that differs from .copier-answers.yml, with exit status 2.

Scenario: A differing flag after the first render

  • WHEN A test runs the command with --no-code-coverage on a repository whose .copier-answers.yml holds code_coverage: true.
  • THEN The command exits 2, and its output names code_coverage and copier update --data code_coverage=false.

Requirement: A matching code coverage flag is accepted

The command MUST accept a --code-coverage value that matches code_coverage: true in .copier-answers.yml.

Scenario: A matching flag after the first render

  • WHEN A test runs the command with --code-coverage on a repository whose .copier-answers.yml holds code_coverage: true.
  • THEN The command reports no differing code_coverage value and exits with a status other than 2.

Requirement: The generated command reference holds the flag

The change MUST regenerate docs/CLI_REFERENCE.md from the command, so that the command matrix holds --code-coverage.

Scenario: The docs row accepts the regenerated reference

  • WHEN A run of uv run devops ci --check --only docs checks the changed tree.
  • THEN The row exits 0 and reports no stale generated document.

Requirement: The onboard page names the flag

docs/repos/onboard.md MUST name --code-coverage/--no-code-coverage with the other answer flags in the section The baseline.

Scenario: The onboard page holds the flag

  • WHEN A test reads docs/repos/onboard.md.
  • THEN The section The baseline contains --code-coverage/--no-code-coverage.

Requirement: Pending a person after the merge

After the template release, a person MUST confirm that a rendered baseline keeps the code_coverage rule.

Scenario: The live onboard run keeps the code coverage rule

  • WHEN A person runs uv run devops repos onboard <repo> --confirm on a repository with the template release and reads the ruleset main.
  • THEN The command reports row 10 present and the ruleset main holds a code_coverage rule.

Existing Tool Considered

The alternatives check in the issue body records in-use for copier-org/copier (https://github.com/copier-org/copier), MIT, maintained. The block lists what Copier covers and lacks. The change adds only the named --code-coverage/--no-code-coverage flag and the answers-file refusal rule that the block lists as lacking. It passes the answer through Copier's --data option. The change builds no renderer.

Key questions

  • How does the command give the code_coverage answer to the template?: Add the tri-state option --code-coverage/--no-code-coverage beside the other answer flags. Add code_coverage to the --data arguments of copier only when .copier-answers.yml does not exist. Refuse a given value that differs from the file with exit status 2. (best practice) [sources: docs/repos/onboard.md, src/devops_cli/github/onboard/baseline.py, CONTEXT.md]
    • Chosen: Tri-state flag beside the other answer flags. The page gives this rule for --scope, --release-flow and --release-type; one rule for each answer flag is easy to keep.
    • Rejected: Read code_coverage from .devops/project.toml or the devops-cli config. The config holds operational keys only, and .copier-answers.yml already holds the template answers.
    • Rejected: Always pass code_coverage=true with no flag. The command would refuse each repository whose answers file holds another value and would answer a question that a person did not answer.
  • Which value does devops-cli need for code_coverage?: true. Row 10 builds the ruleset main from the rendered baseline. The answer false writes a ruleset with no code_coverage rule. (best practice) [sources: docs/repos/onboard.md]
    • Chosen: Use true. Row 10 builds the ruleset main from the rendered baseline, and devops-cli needs the code_coverage rule.
    • Rejected: Use false. The rendered ruleset would have no code_coverage rule.
  • Which documents name the answer flags?: docs/repos/onboard.md names them in the section The baseline. docs/CLI_REFERENCE.md is generated and holds the command matrix, so the change regenerates it. The docs row of Static Analysis checks the generated document. [sources: docs/repos/onboard.md, docs/CLI_REFERENCE.md, CONTEXT.md]
  • Does the work wait on the dan-petty/infra template release?: Yes. The baseline is the template at one ref. A render before the release gives no code_coverage rule, and row 10 writes none. [sources: docs/repos/onboard.md]

Fit

Fits in one pull request.

Suspected block

The code_coverage question of the dan-petty/infra template and its release (dan-petty/infra issue of 2026-11-23).

Dependencies

None.

Activity

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    on Nov 23, 2026
  2. dan-petty commented on Nov 23, 2026

    @dan-petty
    OwnerAuthor
  3. added
    effort/low
    scope/repos
    priority/p2-medium
    on Nov 23, 2026
  4. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    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 (4)

    Tools considered:

    Searches run:

    • copier --data pass answers to template questions CLI, results: 5
    • copier-org copier template answers --data option documentation, results: 5
    • copier python project template generator copier-org copier, results: 5
    • copier-org copier readthedocs answers file, results: 5

    Sources:

  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/repossource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions