fix: anchor the migration exists-check to exact names - #19
Open
thedumbtechguy wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 currentMIGRATIONSnames (allchrono_forge-prefixed) this was theoretical, but it's a silent-skip failure mode worth closing.Now anchored to exactly
<digits>_name.rbvia a basename regex. Regression test: a host decoy20200101000000_my_install_chrono_forge.rbno longer suppresses copyinginstall_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