Skip to content

fix(repos): onboard overwrites files that the repository owns #7873

Done

Description

@dan-petty

Problem

Row 9 of devops repos onboard writes each rendered template file that differs from the file of the repository. It writes two groups of files that it must not write.

  1. Files that the repository owns. copier.yml of dan-petty/github-workflows lists them in _skip_if_exists: .github/renovate.json, .pre-commit-config.yaml, .devops/project.toml, version.txt and .release-please-manifest.json. Row 9 replaces each of them with the text of a first render. A repository with releases gets version 0.0.0 again.
  2. The template source repository. For github.template_repository itself, row 9 replaces the reusable workflows .github/workflows/pr-title.yml and .github/workflows/release.yml with callers of an older release of the same repository. Row 11 can then merge that pull request.

The Service also runs row 9 with writes for each repository of service.repos (ONBOARD_WRITE_ROWS, src/devops_cli/github/onboard/service_onboard.py). It writes as soon as its pod has the program copier.

Reproduction Steps

devops repos onboard dan-petty/github-workflows --plan at devops-cli 0.258.4 lists in row 9:

  • update .github/renovate.json
  • update .github/workflows/pr-title.yml
  • update .github/workflows/release.yml
  • update .pre-commit-config.yaml
  • update .release-please-manifest.json
  • update version.txt

A render of the template at v0.2.0 with Copier gives version.txt 0.0.0 where the repository holds 0.2.0. It gives a release.yml of 32 lines where the repository holds the reusable workflow of 181 lines.

Expected behavior

  • Row 9 does not write a file of _skip_if_exists that the repository holds. It writes such a file only when the repository lacks it, as copier update does.
  • For the template source repository, rows 9 and 11 are skipped with a reason. They send no write.

Existing tool considered

Copier (MIT), in use. _skip_if_exists already states which files the repository owns. Read that list from copier.yml at the template ref, or let Copier apply it to a render over the files of the repository.

Acceptance criteria

  • A test gives a repository that holds version.txt with other text. A --confirm run writes no version.txt.
  • A test gives a repository that lacks version.txt. A --confirm run adds it.
  • A test onboards the template repository itself. Rows 9 and 11 are skipped, and no route of these rows runs.
  • docs/repos/onboard.md describes both rules.

Related

#7411 (row 9 writes the template text over a differing file so that copier update applies with no conflict). copier update does not rewrite a file of _skip_if_exists, so such a file cannot cause that conflict.

Activity

  1. added
    type/bug
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
    • Priority: The bug overwrites version.txt and workflow files, corrupting repository state.
  3. added
    source/agent
    status/new
    effort/medium
    value/high
    scope/repos
    priority/p1-high
    status/in-progress
    and removed
    status/new
    on Nov 30, 2026
  4. added
    status/in-review
    and removed
    status/in-progress
    on Nov 30, 2026
  5. removed
    status/in-review
    on Nov 30, 2026
  6. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-30 20:54 UTC

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/mediumpriority/p1-highscope/repossource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions