Closed pixelzoom closed 1 year ago
I'm also confused about the expected behavior of ?strictMigrationRules
in general. I realize that there are some cases when a failure occurs that are not really things that need to be addressed (like perhaps this issue). But I don't know how to identify which failures need to be addressed vs ignored, and how to communicate/document which failures can be ignored. And continuing to fail assertion that can be ignored seems like an on-going maintenance/QA problem -- do we need some way to mark these as "do not fail assertion because it may legitimately do nothing"? Or are we expected to "manually" remember which failures don't need to be addressed?
Ahhh, very good bug here. Over in https://github.com/phetsims/phet-io-wrappers/issues/521 we decided that when having a many-to-one mapping in migration rules, that you should not overwrite a custom value of the mapping with a default value. This means that this rule is potentially not going to do anything, since it is the second rule to map to the sim's titleStringProperty
:
So we need a way to opt out of this assertion for certain rules, to help assist in testing. I'll work something out.
Ok, so I added canDoNothing
to bypass the ensureAllMigrationRulesDidSomething
strict checker. 20 rules in NS needed this. I'm unsure that this is the best path forward, but I can see that being explicit about these would help everyone understand the rule that much better. Since many-to-one mappings (mostly for strings) are incredibly confusing, and it is good to understand how overwriting may occur. @pixelzoom I also covered https://github.com/phetsims/natural-selection/issues/341 in the above commit, let's discuss what you think. Migration is working without error for me with the above commit.
Looks good, confirm with in Migration wrapper with &strictMigrationRules
. Closing, thanks!
I can't make sense of this Migration wrapper error. @zepumph can you translate for me? What needs to be done?
To reproduce:
&strictMigrationRules