Skip to content

docs: correct misleading DO NOT EDIT header on seeded files - #166

Closed
vector-arrow wants to merge 1 commit into
mainfrom
docs/seeded-file-header
Closed

docs: correct misleading DO NOT EDIT header on seeded files#166
vector-arrow wants to merge 1 commit into
mainfrom
docs/seeded-file-header

Conversation

@vector-arrow

Copy link
Copy Markdown
Contributor

Comments only. No behaviour change, and no file moves between files and seeded_files.

Problem

Every provisioned file carries the same header:

## DO NOT EDIT!
# This file was provisioned by Terraform
# File origin: https://github.com/Arrow-air/tf-github/...

For files in the files local that is accurate — Terraform overwrites them on every run. For seeded_files it is wrong. Those are written once at repository creation and then owned by the repo, enforced by lifecycle { ignore_changes = [content] } on github_repository_file.seeded_files (src/modules/github-repository/main.tf). Telling the owner of a file not to edit it is the opposite of the truth.

This has misled people more than once. Arrow-air/website carries a commit d82b7b7 "fix: restore repo-specific cspell ignore paths", which reads like someone believed a sync had eaten their ignorePaths. Nothing had — the repo's ten repo-specific paths have survived, which is itself proof the seeding behaviour works as documented in main.tf.

Change

src/templates/all/.cspell.config.yaml — replace the header with one that states the actual contract:

## SEEDED FILE - this repository owns it.
# Terraform wrote this file once, when the repository was created, and will not
# update it again. Local changes are preserved. Edit it freely.
# Upstream default: https://github.com/Arrow-air/tf-github/tree/main/src/templates/all/.cspell.config.yaml
# Changing the upstream default affects newly created repositories only.

src/main.tf — the seeded_files local has an explanatory comment; the files local had none. Added the symmetric one so the two categories are described in the same place.

Scope limitation, stated plainly

Because .cspell.config.yaml is seeded, this header will not reach any existing repository. ignore_changes = [content] means Terraform will not rewrite the file it already created. Only repositories created after this merges get the corrected wording. That is inherent to the thing being fixed, not something worth working around — force-updating it would overwrite exactly the repo-owned content the header is trying to protect.

The categories are distinguishable only by convention

Worth flagging, not asking anyone to build anything: seeded_files currently holds exactly one entry (.cspell.config.yaml), and the only thing that makes a file seeded rather than managed is which local it was placed in. There is no naming rule, no validation, and no test. A future file added to the wrong bucket would either be silently overwritten forever or silently never updated, and in both cases the first symptom would be someone losing work or debugging a sync that never happens.

The corrected header helps a little, since a seeded file now announces itself in its own text — but that only works if whoever adds the next seeded template remembers to write the right header, which is the same convention problem one level down.

Verification

  • grep -rn seeded src --include=*.tflocal.seeded_files is defined once in main.tf and every call site (repositories_templates.tf, repositories_embedded.tf, repositories_pod.tf, repositories_terraform.tf) passes that same local. One entry, no divergent definitions.
  • git diff touches only comment lines in two files.
  • No Terraform-visible change: comment text inside a template file changes the string content that would be written to new repos only, and the main.tf comment is inert.

🤖 Generated with Claude Code

seeded_files are written once at repo creation and owned by the repository
afterwards (lifecycle ignore_changes = [content]), so 'DO NOT EDIT!' is the
opposite of the truth for .cspell.config.yaml.

Comments only. No behaviour change, no files moved between locals.

Reaches newly created repositories only - existing repos keep their seeded
copy by design.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vector-arrow
vector-arrow requested a review from a team as a code owner July 29, 2026 16:51
@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2026
@github-actions

Copy link
Copy Markdown

Terraform Format and Style 🖌success

Terraform Initialization ⚙️success

Terraform Validation 🤖success

Validation Output
Success! The configuration is valid.


Terraform Plan 📖success

Show Plan
terraform

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration
and found no differences, so no changes are needed.

Pusher: @vector-arrow, Action: pull_request, Working Directory: ``, Workflow: Terraform

@vector-arrow

Copy link
Copy Markdown
Contributor Author

Closing per Sleety: the only place this header caused harm is Arrow-air/website, which owns its copy of .cspell.config.yaml and can correct it in one line whenever something else is already going to that repo. Fixing the template here would only reach newly created repos, so it doesn't address the actual harm.

@vector-arrow
vector-arrow deleted the docs/seeded-file-header branch July 29, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant