Skip to content

fix: anchor the migration exists-check to exact names - #19

Open
thedumbtechguy wants to merge 1 commit into
mainfrom
fix/anchored-migration-exists-check
Open

fix: anchor the migration exists-check to exact names#19
thedumbtechguy wants to merge 1 commit into
mainfrom
fix/anchored-migration-exists-check

Conversation

@thedumbtechguy

Copy link
Copy Markdown
Contributor

Summary

The install/upgrade generators' skip-if-exists check used Dir.glob("*_#{'{'}name}.rb"). Glob * swallows underscores, so any migration merely ending in _name.rb — a host app's own migration, or a sibling whose name extends another's — counted as already installed and silently suppressed the copy. With the current MIGRATIONS names (all chrono_forge-prefixed) this was theoretical, but it's a silent-skip failure mode worth closing.

Now anchored to exactly <digits>_name.rb via a basename regex. Regression test: a host decoy 20200101000000_my_install_chrono_forge.rb no longer suppresses copying install_chrono_forge.

Same tightening applied in saga_forge (landed) and angarium (radioactive-labs/angarium#2).

Testing

bundle exec rake — 323 tests, 1089 assertions, 0 failures (test + standard).

🤖 Generated with Claude Code

https://claude.ai/code/session_01BYH5LNyvj7LpuyJCQkDYTy

A bare *_name.rb glob lets * swallow underscores, so any migration
merely ending in _name.rb would count as installed and silently
suppress the copy.

Claude-Session: https://claude.ai/code/session_01BYH5LNyvj7LpuyJCQkDYTy
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