Refactor set and reset of capabilities#29195
Merged
Merged
Conversation
Contributor
Author
|
The original PR is not "broken" in an outward way. The unexpected "always true" at point 2 was hiding an underlying issue. And also, making these refactorings also helps avoid needing to touch the integration tests in apps. |
Contributor
Author
|
Backport stable10 #29200 |
SergioBertolinSG
approved these changes
Oct 10, 2017
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
wasCapabilitySetwas supposed to return a properboolean- fixed.if ($savedState !== $testingState)was always true because the types were different. Item (1) makes sure that$savedStateis aboolean.But in practice, enabling some capability settings will also change sub-settings. e.g. when
files_sharingapi_enabledis switched on, then various sub-capabilities get set to their defaults. So the original saved state of capabilities is not a good indicator of what is currently set/not set. There were then some failures, particularly in the capabilities and sharing suites.To fix that in the general case, you would have to re-query the capabilities after every change you make. That defeats the purpose of trying to be efficient and do a single capabilities query, then only change the things that need changing. It turns out to be just as quick to set every capability, whether it is already set or not.
Save the capabilities that really do get changed as an array. At the end of the scenario these can be put back. It eliminates needing individual
restore*methods that know what to put back. And eliminates the need for the (new)restoreAppConfigs()method.Rename
setupAppConfigs()back toresetAppConfigs()- along with item (4) this reverts the abstract methods inAppConfiguration.phpback to the way they were previously. It means that existing integration tests in apps that useBasicStructureandAppConfigurationdo not get broken (i.e. do not have to all be patched)Related Issue
This is a follow-on from PR #28970
Motivation and Context
How Has This Been Tested?
Extra test runs in Jenkins in temporary PRs to make sure it works and does not take too much time.
Types of changes
Checklist: