Conversation
If it's 6.1, let's just run all pending migrations We're losing multi-db setups in the process, most likely, though
|
So the tests failed on 6.1 and ran on later versions. Then got fixed. Good. I'll see if it might make sense to actually run the commands themselves and observe side-effects, because current tests are rather non-exhaustive and rely on knowing how Rails internals work |
|
feels like if we wanted to avoid potentially breaking versions, we should follow the model used for bullet where patches for different versions of Rails are saved in different files |
|
good point @vprigent! I initially wanted us to have something akin to what you've shown, but I dunno. The difference between 6.x and later versions is just too much. We're basically mirroring Rails implementation, which might not be as sustainable as I'd hope. Moreover, having multiple places that'd include version-specific patches is going to be rather difficult. But it might actually make sense to isolate Rails-specific code from DataMigrate-specific code and just... include LARGE chunks of code. Like, the whole migration infrastructure, per-version, with patches, included. Or look for other ways to piggyback on Rails' migrations. Either way, this PR seems to be working. I'm not going further with it because I wanna be more confident that it works. What used to fail doesn't. The question is: does anything fail that didn't? I don't want silent failures. |
It's basically my last attempt at trying to tackle the issue.
In a nutshell: 7.0 had a huge rework of migration internals. We mirror those internals, thus they're broken for 6.1 users
The main challenge I personally faced while trying to make it work is to actually verify that
a) the code works for 6.1 users
b) the code doesn't break for anyone else
c) there are no silent errors or data corruption happening
Fun fact? Rails doesn't have a test for the part that was failing in our gem :) So Rails, in theory, could have had this part failing, and it wouldn't have been caught by tests
So yeah. Basically, I'm trying to make it work. Again. I think it's the fifth time.
If it doesn't work – I think we'll have to port a bunch of QoL updates, bug fixes, security fixes to 9.x.x and drop EOL Rails versions.
But I'll do my best
P.S. Yeah I've tried AI to do that. Multiple attempts over the 2 year period.
P.P.S. Any feedback like "tried it, works for us" would be very appreciated <3