Skip to content
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

Re-enable apps that got automatically disabled while updating #8380

Merged
merged 1 commit into from
Jul 25, 2018

Conversation

nickvergessen
Copy link
Member

This seems like a quite simple approach to work against #8293
But maybe I'm overseeing something.

Also I noticed, that automatic disable is already running the uninstall repairsteps. I once had the idea to use the uninstall step to clean up the database of my apps.
But that basically means when the announcement app e.g. gets automatically disabled all announcements and comments would be gone.

Not sure if that sounds intended.

@MorrisJobke
Copy link
Member

But that basically means when the announcement app e.g. gets automatically disabled all announcements and comments would be gone.

We should make this a separate step - see #5539

Also the app management should be unified, because now it is distributed across OC_App, IAppManager and Installer - see #5833 and #4453

@@ -154,6 +155,7 @@ public static function loadApp($app) {
if (!\OC::$server->getAppManager()->isShipped($app)) {
// Only disable apps which are not shipped
self::disable($app);
self::$autoDisabledApps[] = $app;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this is for the update case, which disabled e.g. the files_accesscontrol app.

Steps are:

  1. Upload the new code of the server
  2. Open Nextcloud (shows the updater)
  3. Start the update (loads all apps, and disables files_accesscontrol, because the storagewrapper is not matching the method signature anymore (was changed between 12 and 13))
  4. Updater looks for updates of enabled apps (and skips files_accesscontrol, because it is not enabled)

With this patch, in step 4 it also checks for updates of apps which were disabled while calling the updater.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... it is accessed from the outside via \OC_App::$autoDisabledApps 🙈

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if we agree on the logic, we can wrap this in beautiful methods and public interfaces 💃

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it 👍

Signed-off-by: Joas Schilling <coding@schilljs.com>
@skjnldsv skjnldsv force-pushed the bugfix/noid/reenable-disabled-apps branch from 00835f8 to 4b49f81 Compare June 26, 2018 07:17
@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jun 26, 2018
@codecov
Copy link

codecov bot commented Jun 26, 2018

Codecov Report

Merging #8380 into master will increase coverage by 20.26%.
The diff coverage is 0%.

@@              Coverage Diff              @@
##             master    #8380       +/-   ##
=============================================
+ Coverage      31.7%   51.97%   +20.26%     
- Complexity    26017    26018        +1     
=============================================
  Files          1660     1660               
  Lines         96167    96172        +5     
  Branches       1290     1290               
=============================================
+ Hits          30490    49982    +19492     
+ Misses        65677    46190    -19487
Impacted Files Coverage Δ Complexity Δ
lib/private/legacy/app.php 62.22% <0%> (+21.91%) 196 <0> (ø) ⬇️
lib/private/Updater.php 5.24% <0%> (-0.07%) 121 <5> (+1)
lib/private/Files/Stream/Encryption.php 75.22% <0%> (+0.45%) 54% <0%> (ø) ⬇️
apps/theming/lib/ThemingDefaults.php 97.29% <0%> (+0.67%) 52% <0%> (ø) ⬇️
lib/private/Group/Group.php 76.19% <0%> (+0.79%) 62% <0%> (ø) ⬇️
lib/private/Setup.php 12.55% <0%> (+0.83%) 52% <0%> (ø) ⬇️
lib/public/AppFramework/Db/Mapper.php 94.95% <0%> (+0.84%) 30% <0%> (ø) ⬇️
...vate/Authentication/Token/DefaultTokenProvider.php 98.05% <0%> (+0.97%) 32% <0%> (ø) ⬇️
lib/private/Preview/Generator.php 78.28% <0%> (+1.14%) 53% <0%> (ø) ⬇️
lib/private/App/DependencyAnalyzer.php 95.62% <0%> (+1.25%) 64% <0%> (ø) ⬇️
... and 382 more

@skjnldsv
Copy link
Member

Rebased

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jul 18, 2018
@MorrisJobke MorrisJobke mentioned this pull request Jul 24, 2018
21 tasks
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code makes sense and checks for the apps that failed hard. 👍

@MorrisJobke
Copy link
Member

@rullzer Mind to review?

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Jul 25, 2018
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jul 25, 2018
@MorrisJobke MorrisJobke merged commit 7eb7418 into master Jul 25, 2018
@MorrisJobke MorrisJobke deleted the bugfix/noid/reenable-disabled-apps branch July 25, 2018 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug feature: apps management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants