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
Prepping 3.3.0 upgrade #71
Conversation
@andersburla I'm prepping an update as I've updated the payment providers with the latest stripe and also implemented using ILMerge to merge payment provider dependencies. Because of this, I'm doing an upgrade step to delete the old 3rd party dlls (as these are now merged into the core PaymentProvide dll). I'm happy with how I have this setup, but I'd quite like your feedback regarding the upgrade steps. It occurred to me whilst preparing this that the upgrade steps only work sequentially meaning you would have to upgrade to each intermediary SpecialActionsVersion manually in order for the upgrades to occur as the upgrades are occurring only if the currentVersion is the previous version number. I'm wondering whether these should actually be updated to use
As this would then allow say someone on an install of 3 to jump up to version 5 and have all the upgrade steps in between run in one go. Like I say, with the current |
The previous code did run sequentially and could do multiple updates in one go. If you had special version 3 and the code said newVersion = 6 - it would do 4 + 5 + 6 as its a while loop. For each loop it updates the specialActionsVersion in the database - so if step 5 failed - it would still have done the version 4 update. Then you could try and see in the log what the error was, and then boot your application again to try and run 5 + 6 again. At the moment the code will fail because currentVersion variable is never changed and it would be an infinite loop. Line 187 you removed - was doing this before. You should add 1 to the currentVersion variable when you do the update of SpecialActionsVersion in the DB in line 225. The reason to use currentVersion + 1 == 6 is to have each while loop only execute one of the version codes. Then it would update the version number in the DB and then run the next version update in the while loop. If you do currentVersion < 4 and also have < 5 and < 6 in two other if statements, then they would also run in the same while loop iteration. If 5 then fails - then your DB won't be updated with the SpecialActionsVersion to 4, and when the system boots, it will try and do version 4 again - which could then fail, if they code didn't support this case. So we did it the current way to allow each special version to run separately and update the SpecialActionsVersion in the DB for each while loop iteration. |
@andersburla ahh, of course. I missed the fact it was in a while loop. That makes total sense now. I have re-instated the loop counter so should be back to how it was before. Thanks for the feedback. |
…e sense, rather than doing math in the if statements.
@andersburla I've introduced the concept of a "stepTargetVersion" which effectively stores the target version of the current loop. I think this makes the if statements a little easier to read, rather than doing + 1 math. This should pretty much be as before, but I'm wondering why
|
|
Added upgrade code to delete old payment provider 3rd party dependencies