-
-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raise an error on sufficiently different insta
vs cargo-insta
versions
#509
base: master
Are you sure you want to change the base?
Conversation
…sions This has two purposes: - By raising an error if major versions differ, it allows eventually upgrading to insta 2 without confusing breaks (we want to add this sufficiently before releasing v2) - It potentially allows for making some changes before a big break, by warning when minor versions differ sufficiently. This could be upgraded to an error. Currently we have a few deprecated items; and I was thinking of trying to unify some of the pending / named snapshot handling, but it becomes burdensome if we need to support the existing approach forever. WDYT?
But then this just says we break compatibility which means that someone would need to be able to run |
Very much agree (some of what I meant in the bullet above starting "...one advantage of gradual changes over a big break "....). Are you thinking that Even without the warning of v2 vs v1, this raises a warning on sufficiently different minor versions of |
I think that cargo-insta should definitely support old and new snapshots. My eventual goal at the moment is still to add I wonder if the right approach here might be to add a "snapshot version" marker to the snapshot files and to use that to set a lower bound to cargo-insta? |
OK amazing
I thought about this too! I think it's a nice legible approach. The reason I leaned away is:
A couple of alternatives:
If it were just me, I would initially vote to start increasing the major version even without big changes. We could even do that soon: i.e. check we have warnings on everything that's old, confirm that |
It would really only update in case an insta-2 comes around I believe. So we would basically be on version 2 for now (since we did one change in the past) until we finally decide to really change things around. The global version in a config would also be an option but I would need to think about this more. |
This has two purposes:
cargo-insta
— unless it worked with bothinsta
1.0 & 2.0, folks would need to be flipping between versions when working between projects that have vs. haven't upgraded. Whereas most projects can be expected to upgrade minor versions after a while. (For reference, 10 minor version is currently 15 months ago)WDYT?