Skip to content

feat: render a .gitignore in the repository template #54

Backlog

Description

@devops-cli-service

Split from #25.

Problem The repository template renders no .gitignore. A repository that devops repos onboard creates thus ignores neither .venv/ nor .data/. On 2026-11-30, dan-petty/devcontainer-features listed .data/ as untracked after devops roadmap intake, because its .gitignore does not list the folder. ## Why this part is deferred Issue #25 changes the .gitignore of this repository only. The rendered file needs its own content decision, a row in templates/README.md and a case in tests/test-repository-template.sh. ## Acceptance criteria - The repository template SHALL render a .gitignore that lists .data/. - mise exec -- tests/test-repository-template.sh SHALL pass with a case for the rendered .gitignore. - A repository that the template renders SHALL list no path under .data/ in git status --short after devops roadmap intake.

Proposed design

Problem statement

The Copier template of a new repository renders no .gitignore. Thus a repository that devops repos onboard creates ignores neither .venv/ nor .data/. On 2026-11-30, dan-petty/devcontainer-features listed .data/ as untracked after devops roadmap intake. This change adds templates/repository/.gitignore with .data/ and .venv/. It adds the file to _skip_if_exists of copier.yml, so the repository keeps its own entries. It adds a row in templates/README.md and cases in tests/test-repository-template.sh.

Acceptance criteria

Requirement: The template renders a .gitignore

The repository template SHALL render a .gitignore in each repository that Copier renders.

Scenario: The default answers hold the file

  • WHEN mise exec -- tests/test-repository-template.sh renders the template with the default answers
  • THEN The case defaults: files passes, and the render holds .gitignore.

Requirement: The rendered .gitignore lists the two folders

The rendered .gitignore MUST list .data/ and .venv/, each on a line of its own.

Scenario: The entries of the rendered file

  • WHEN mise exec -- tests/test-repository-template.sh checks the .gitignore of the default render
  • THEN The case defaults: .gitignore passes with the entries .data/ and .venv/.

Requirement: The repository keeps its own .gitignore

copier update MUST keep each entry that a repository adds to its .gitignore.

Scenario: An update after the repository changes the file

  • WHEN mise exec -- tests/test-repository-template.sh updates a render whose .gitignore holds an entry of its own
  • THEN The case update: each file of the repository keeps its content passes, and the entry stays.

Requirement: Pending a person after the merge

A repository that devops repos onboard creates from the release MUST list no path under .data/ in git status --short after devops roadmap intake.

Scenario: The live proof in a new repository

  • WHEN A person runs devops roadmap intake in a repository that devops repos onboard created from the release, and then runs git status --short
  • THEN git status --short lists no path under .data/.

Existing Tool Considered

No alternatives check has run. The Python.gitignore file of the maintained github/gitignore collection of GitHub lists .venv and the Python caches. It lacks .data/, and it holds entries that a repository of another language does not need. Copier renders the static file. The change writes no code, so no written build cost applies.

Key questions

  • Which entries does the rendered .gitignore hold?: .data/ and .venv/, one on each line, and no other entry. The issue names .data/. The test of this repository puts the virtual environment in .venv. (best practice) [sources: tests/test-repository-template.sh, templates/README.md]
    • Chosen: The two entries only. The issue names both folders, and the tools of this repository use .venv.
    • Rejected: The whole Python.gitignore of github/gitignore. It holds entries for Python files only, and it lacks .data/.
    • Rejected: The entries of Python.gitignore and .data/. The extra entries ignore files that a repository of another language does not make.
  • Who owns the rendered .gitignore after the first copy?: The repository. The change adds .gitignore to _skip_if_exists of copier.yml, so copier update keeps each entry that the repository adds. (best practice) [sources: templates/README.md, copier.yml]
    • Chosen: Add it to _skip_if_exists. copier update writes each other file again, which would drop the entries of the repository (templates/README.md, Owners).
    • Rejected: The template owns the file. Each update would replace the .gitignore of each rendered repository.
    • Rejected: A question gives the entries. The entries need no answer, so a question adds a prompt and a key of .copier-answers.yml with no gain.
  • Does the template render the file with Jinja or as a plain file?: As a plain file, templates/repository/.gitignore. The content holds no answer, so it needs no Jinja. [sources: templates/README.md, templates/repository/.pre-commit-config.yaml]
  • Which lists of tests/test-repository-template.sh hold the new file?: The list common adds .gitignore, so the case defaults: files holds it. The list kept adds .gitignore, so the update and recopy cases keep the entries of the repository. [sources: tests/test-repository-template.sh]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    status/new
    value/medium
    effort/low
    source/agent
    on Dec 1, 2026
  2. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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-mediumsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions