-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Don't do app upgrades in the background #9866
Conversation
*/ | ||
public static function loadApp($app) { | ||
public static function loadApp($app, $checkUpgrade = true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we default this to false
instead or do you think there's a risk to break other things ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo defaulting to false
provides a bigger risk (an accidental app being loaded without properly being upgraded)
To test: Main update
Single app update
|
Ok from what I see, whenever an app needs upgrade, the "Upgrade to OC 8" page appears again. |
Bonus point for the fact that you're now showing what app is being updated 😄 |
|
@georgehrke do you see any conflict with this and the app store approach of updating ? |
|
Just tested the following:
At step 4) it looks like only the code is updated, but the actual DB upgrade occurs after a page refresh, where the "upgrade to OC8" page appears. We need to make sure that this worklow is acceptable, or tweak it. |
Also I'm not sure about the impact of this. |
Apart from the the code looks good 😄 |
Hm, does that mean that whenever an app needs a upgrade, the blocking page will be shown? Should only be invokable by admins, no? |
code looks good, don't see any direct conflicts with app updates for shipped apps, didn't test though. Will try to find time for testing this tomorrow |
@jancborchardt, yes only admins. Other users would get "Service not available" or something until the admin runs the upgrade procedure. |
@PVince81 wait – but that »Service not available« page in the first place only appears once the admin dedicatedly pushes the »update app« switch, right? Otherwise it sounds like app updates will halt the installation until an admin is there. |
@jancborchardt App updates are invoked by admins ;) There is no auto-updater |
I'm not sure if I like the idea of the update screen for every app update. This can be quite irritating especially Why not just activate the maintenance mode before we call the update script? This way we make sure that the script gets triggered only once and we can still perform the updates in the background on-demand. |
There are 2 cases for upgrading apps
I'll look into "fixing" updating apps from the app store |
can you elaborate on it? I don't know the code, so maybe I miss |
The app store now properly set the app version in the database after updating, when updating an app trough the app store you no longer need to go trough the upgrade page |
The problem is that the upgrade would be triggered by whatever request happens to be next, neither we nor the admin updating the app has any control when the upgrade would be triggered. By going trough the update page we not only ensure parallel requests dont try to both update the app but also ensure there is someone to respond to any error that might happen |
🚀 Test Passed. 🚀 |
What's the status? Isn't it something we would like to have for OC7.0.1? |
Rebased, I think all raised issues are taken care of now |
🚀 Test Passed. 🚀 |
foreach ($apps as $appId) { | ||
if (\OC_App::shouldUpgrade($appId)) { | ||
\OC_App::updateApp($appId); | ||
$this->emit('\OC\Updater', 'appUpgrade', array($appId, $version)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undefined variable $version
I retested with the steps from #9866 (comment) and everything works fine now. Upgrading a single third party app by clicking on "Update now" simply sets the maintenance mode during upgrade, which provides a better UX than before. However there is one last small issue:
@icewind1991 please fix that then this is good to go. |
@karlitschek @craigpg I have the feeling this would be useful to have in 7.0.2. @schiesbn please also help reviewing |
@icewind1991 any update ? |
Fixed the undefined variable |
A new inspection was created. |
Works 👍 |
This needs another reviewer @schiesbn @DeepDiver1975 @th3fallen |
🚀 Test Passed. 🚀 |
Works for me as well 👍 some unit tests wouldn't hurt though.... |
@icewind1991 add unit tests separately ? From what I remember it's quite difficult with the current structure and might require some refactoring... |
Yes, I'm not sure how to add unit tests atm |
Don't do app upgrades in the background
@icewind1991 @karlitschek Backport needed and possible? |
please backport |
Backport would be useful to increase upgrade stability |
Stable7: c69215c...7842014 |
This removes the logic for transparently upgrading apps and moves it to the same system we use for core upgrades.
Transparent app upgrades can leave the instance in a broken state when requests are being processed in parallel.
Only doing the upgrades in the foreground prevents this and provide a way for users to know when an upgrade failed.
cc @DeepDiver1975 @PVince81