Skip to content

Clear enabled apps cache after loading authentication app - #11495

Merged
PVince81 merged 1 commit into
masterfrom
apps-clearenableappscacheafterloadingauthapp
Oct 9, 2014
Merged

PVince81 merged 1 commit into
masterfrom
apps-clearenableappscacheafterloadingauthapp

Conversation

@PVince81

@PVince81 PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor

Since getEnabledApps() depends on an authentication app to be loaded,
especially in the case of LDAP, the cache from getEnabledApps() is now
cleared to make sure that subsequent calls will properly return apps
that were enabled for groups.
This is because getEnabledApps() uses the inGroups() function from the
group manager provided by LDAP or any other authentication app.

Fixes #11484

TODO

  • add unit tests

@ghost

ghost commented Oct 9, 2014

Copy link
Copy Markdown

💣 Test FAILed. 💣
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng/177/

Build result: FAILURE

GitHub pull request #11495 of commit 312b600d903f4b267ac91721e9a2eda01157dbb7 automatically merged.Building on master in workspace /var/lib/jenkins/jobs/pull-request-analyser-ng/workspace@2 > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/owncloud/core.git # timeout=10Fetching upstream changes from https://github.com/owncloud/core.git > git --version # timeout=10 > git fetch --tags --progress https://github.com/owncloud/core.git +refs/pull/:refs/remotes/origin/pr/ > git rev-parse origin/pr/11495/merge^{commit} # timeout=10Checking out Revision 4de08f4d568d45d80645f9fa87565a9b425a88dc (detached) > git config core.sparsecheckout # timeout=10 > git checkout -f 4de08f4d568d45d80645f9fa87565a9b425a88dc > git rev-list d113d53b0356e4bc5a2aaff4016fd32e17c49300 # timeout=10 > git remote # timeout=10 > git submodule init # timeout=10 > git submodule sync # timeout=10 > git config --get remote.origin.url # timeout=10 > git submodule update --init --recursiveTriggering pull-request-analyser-ng » sqlite,vm-slave-02Touchstone configurations resulted in FAILURE, so aborting...Started calculate disk usage of buildFinished Calculation of disk usage of build in 0 secondsStarted calculate disk usage of workspaceFinished Calculation of disk usage of workspace in 0 seconds:bomb: Test FAILed. :bomb:

@karlitschek

Copy link
Copy Markdown
Contributor

very nice! 👍

@LukasReschke

Copy link
Copy Markdown
Contributor
EEEEEEEEEEPHP Fatal error:  Call to a member function mkdir() on null in /var/jenkins/workspace/pull-request-analyser-ng@2/database/sqlite/label/vm-slave-02/lib/private/files/filesystem.php on line 542
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   8. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP   9. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:783
PHP  10. PHP_Invoker->invoke() /usr/share/php/PHPUnit/Framework/TestResult.php:646
PHP  11. call_user_func_array:{/usr/share/php/PHP/Invoker.php:93}() /usr/share/php/PHP/Invoker.php:93
PHP  12. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHP/Invoker.php:93
PHP  13. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:838
PHP  14. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  15. Test_Encryption_Share->testMoveFolder() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  16. OC\Files\Filesystem::mkdir() /var/jenkins/workspace/pull-request-analyser-ng@2/database/sqlite/label/vm-slave-02/apps/files_encryption/tests/share.php:1029
PHP Warning:  Unknown: Cannot destroy the zip context in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   8. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP   9. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:783
PHP  10. PHP_Invoker->invoke() /usr/share/php/PHPUnit/Framework/TestResult.php:646
PHP  11. call_user_func_array:{/usr/share/php/PHP/Invoker.php:93}() /usr/share/php/PHP/Invoker.php:93
PHP  12. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHP/Invoker.php:93
PHP  13. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:838
PHP  14. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  15. Test_Encryption_Share->testMoveFolder() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  16. OC\Files\Filesystem::mkdir() /var/jenkins/workspace/pull-request-analyser-ng@2/database/sqlite/label/vm-slave-02/apps/files_encryption/tests/share.php:1029
PHP Warning:  Unknown: Cannot destroy the zip context in Unknown on line 0
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129
PHP   4. PHPUnit_TextUI_TestRunner->doRun() /usr/share/php/PHPUnit/TextUI/Command.php:176
PHP   5. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/TextUI/TestRunner.php:349
PHP   6. PHPUnit_Framework_TestSuite->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:705
PHP   7. PHPUnit_Framework_TestSuite->runTest() /usr/share/php/PHPUnit/Framework/TestSuite.php:745
PHP   8. PHPUnit_Framework_TestCase->run() /usr/share/php/PHPUnit/Framework/TestSuite.php:775
PHP   9. PHPUnit_Framework_TestResult->run() /usr/share/php/PHPUnit/Framework/TestCase.php:783
PHP  10. PHP_Invoker->invoke() /usr/share/php/PHPUnit/Framework/TestResult.php:646
PHP  11. call_user_func_array:{/usr/share/php/PHP/Invoker.php:93}() /usr/share/php/PHP/Invoker.php:93
PHP  12. PHPUnit_Framework_TestCase->runBare() /usr/share/php/PHP/Invoker.php:93
PHP  13. PHPUnit_Framework_TestCase->runTest() /usr/share/php/PHPUnit/Framework/TestCase.php:838
PHP  14. ReflectionMethod->invokeArgs() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  15. Test_Encryption_Share->testMoveFolder() /usr/share/php/PHPUnit/Framework/TestCase.php:983
PHP  16. OC\Files\Filesystem::mkdir() /var/jenkins/workspace/pull-request-analyser-ng@2/database/sqlite/label/vm-slave-02/apps/files_encryption/tests/share.php:1029

Since getEnabledApps() depends on an authentication app to be loaded,
especially in the case of LDAP, the cache from getEnabledApps() is now
cleared to make sure that subsequent calls will properly return apps
that were enabled for groups.
This is because getEnabledApps() uses the inGroups() function from the
group manager provided by LDAP or any other authentication app.
@PVince81
PVince81 force-pushed the apps-clearenableappscacheafterloadingauthapp branch from 312b600 to 36d2282 Compare October 9, 2014 12:36
@PVince81 PVince81 changed the title [WIP] Clear enabled apps cache after loading authentication app Clear enabled apps cache after loading authentication app Oct 9, 2014
@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

I just force-pushed a better solution.
Now the check is in loadApp.

@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

Unit test won't be possible here as I can't mock require_once.

Please review @icewind1991 @LukasReschke @blizzz @schiesbn

@ghost

ghost commented Oct 9, 2014

Copy link
Copy Markdown

🚀 Test PASSed. 🚀
Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng/182/:rocket: Test PASSed. 🚀

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: No new issues

@LukasReschke

Copy link
Copy Markdown
Contributor

Makes sense 👍

PVince81 pushed a commit that referenced this pull request Oct 9, 2014
…rloadingauthapp

Clear enabled apps cache after loading authentication app
@PVince81
PVince81 merged commit c82e310 into master Oct 9, 2014
@PVince81
PVince81 deleted the apps-clearenableappscacheafterloadingauthapp branch October 9, 2014 15:20
@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

@karlitschek will backport this bugfix to stable7

@PVince81

PVince81 commented Oct 9, 2014

Copy link
Copy Markdown
Contributor Author

Backported as 24dbdd2 to stable7 and verified that it also works there.

@karlitschek

Copy link
Copy Markdown
Contributor

Thanks

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable app for groups + LDAP doesn't work, loading order issue

4 participants