Skip to content

Remove stale fixtures using explicit generated-file ownership - #120

Merged
nertzy merged 1 commit into
masterfrom
generated-fixture-ownership
Sep 11, 2026
Merged

nertzy merged 1 commit into
masterfrom
generated-fixture-ownership

Conversation

@nertzy

@nertzy nertzy commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Rebuilding fixtures currently leaves YAML files behind when their tables disappear. Rails then tries to load those orphaned fixture sets against tables that no longer exist.

Generated fixtures now receive an exact first-line ownership comment. Rebuilds remove stale marked files, and the explicit clean task follows the same rule. Unmarked files survive cleanup; when generation must overwrite one, it warns and preserves the existing overwrite behavior.

Recognized pre-marker v1 manifests trigger one quiet migration rebuild, recording marker adoption only after generation and callbacks succeed. After updating the gem, the first normal fixture check performs this migration automatically and logs its reason; an initial diff adding ownership headers across existing generated fixtures is expected. The manifest version remains 1. Historical unmarked orphans still require manual inspection and removal; marker ownership intentionally does not protect subsequent manual edits to marked files.

The README documents a dedicated generated-fixture directory, test-runner registration, and separate Rails database-task configuration.

Refs #119.

Mark generated YAML and remove only owned output when tables disappear.
Warn on unmarked collisions while migrating recognized v1 manifests quietly.

Refs #119.
@nertzy
nertzy merged commit 4e59c21 into master Sep 11, 2026
10 checks passed
@nertzy
nertzy deleted the generated-fixture-ownership branch September 11, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant