fix(migration): Ignore non-renamed modules #2309
Merged
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.
The basics
The details
Resolves
Fixes #2171.
Proposed Changes
Don't create a renaming entry for modules that haven't been renamed.
Add an entry to the test renamings that replicates the situation describe in #2171, and which causes multiple test failures without the aforementioned fix.
Additional Information
We should probably do a prefix sort on
.renamings_
(or even just sort by length descending), so that more specific entries precede less-specific ones, but after thinking quite hard about the possible consequences of this I wasn't 100% sure that this wouldn't have unforeseen consequences due to the (arguably excessive) complexity of how renamings are specified.Since the renaming file (and therefore script) is due for a rethink anyway—since it is keyed on
goog.module
IDs that no longer actually exist in the Blockly sourcecode—I think doing the simplest possible thing for now is probably the best approach.