Skip to content

Config cleanup - OC_Preferences refactoring - #12406

Merged
DeepDiver1975 merged 12 commits into
masterfrom
drop-getApps-getUsers
Dec 9, 2014
Merged

DeepDiver1975 merged 12 commits into
masterfrom
drop-getApps-getUsers

Conversation

@MorrisJobke

Copy link
Copy Markdown
Contributor

cc @icewind1991 @DeepDiver1975 @PVince81 @LukasReschke

  • removal of all OC_Preferences references in core and apps I find in this github org.

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

ref #12260

@MorrisJobke MorrisJobke added this to the 8.0-current milestone Nov 25, 2014
@MorrisJobke MorrisJobke changed the title drop OC_Preferences::getUsers and getApps More config cleanups Nov 25, 2014
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

I will tag this a the WIP branch for all of my config related cleanups

@MorrisJobke MorrisJobke changed the title More config cleanups [WIP] More config cleanups Nov 25, 2014
@MorrisJobke
MorrisJobke force-pushed the drop-getApps-getUsers branch from 47f0200 to 42460e0 Compare November 27, 2014 16:59
Comment thread lib/private/allconfig.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Inject AppConfig?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Crashes the DI and I need to figure out why.... this is still WIP, but thanks for the comment.

@MorrisJobke
MorrisJobke force-pushed the drop-getApps-getUsers branch 3 times, most recently from 7ad355e to 343697e Compare November 30, 2014 17:29
Comment thread apps/files_encryption/lib/util.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can this be injected instead of being grabbed from global OC::

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but there are currently that many occurences of the create logic of this class, that we also could put this in here. Once this is handled by an dependency container we can easiely add the parameter

@DeepDiver1975 DeepDiver1975 changed the title [WIP] More config cleanups More config cleanups Dec 1, 2014
@DeepDiver1975 DeepDiver1975 changed the title More config cleanups [WIP] More config cleanups Dec 1, 2014
@MorrisJobke
MorrisJobke force-pushed the drop-getApps-getUsers branch from 38c9166 to d78a56b Compare December 3, 2014 18:35
@LukasReschke

Copy link
Copy Markdown
Contributor
13:53:37 SSSSSSSSSSSSSSSSSSSSSSSSSSSSSS.........................PHP Fatal error:  Call to undefined method OC\Preferences::deleteApp() in /var/jenkins/workspace/pull-request-analyser-ng-simple@6/label/vm-slave-02/tests/lib/preferences.php on line 146

@MorrisJobke
MorrisJobke force-pushed the drop-getApps-getUsers branch from d78a56b to 71d2d3f Compare December 4, 2014 08:40
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

My last task for this PR will be the removal of all OC_Preferences references in core and apps I find in this github org.

@DeepDiver1975

Copy link
Copy Markdown
Contributor

My last task for this PR will be the removal of all OC_Preferences references in core and apps I find in this github org.

and fix the unit tests:

Test Result (3 failures / +3)

    Test\TestAllConfig.testDeleteUserValue
    Test\TestAllConfig.testDeleteAllUserValues
    Test\TestAllConfig.testDeleteAppFromAllUsers

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

Test Result (3 failures / +3) Test\TestAllConfig.testDeleteUserValue Test\TestAllConfig.testDeleteAllUserValues Test\TestAllConfig.testDeleteAppFromAllUsers

They work locally :( Let me have a look at the jenkins output.

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

hmmm ... why?

Many duplicated lines of code in the tests, because of the limits of the not fully mockable unit tests. Will come later.

@MorrisJobke MorrisJobke mentioned this pull request Dec 8, 2014
1 task done
Comment thread lib/private/preferences.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing type annotations

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh ... they seems to have gone while refactoring. Will add them.

@LukasReschke

Copy link
Copy Markdown
Contributor

👍

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

Just added type annotations for a deprecated interface. So jenkins can be ignored

* introduce SystemConfig to avoid DI circle (used by database connection which is itself needed by AllConfig that itself contains the methods to access the config.php which then would need the database connection - did you get it? ;))
* use DI container and use that method in legacy code paths (for easier refactoring later)
* create and use getSystemConfig instead of query() in DI container
* keep old static methods - mapped to new ones and deprecated
* removed deleteApp, getUsers, getApps because they are unused
* make AllConfig unit tests more robust against not cleaned up environments
* this needs to be properly fixed by a proper organisation of the base.php
* introduced fixDIInit() in AllConfig that moves the injection
  of DatabaseConnection to a later point in time
* problems mostly because of the autoconfig setup
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

New jenkins PR: #12710

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

Damn :( Rebase fuckup -.-

* files_encryption
* files_versions
* files_trashbin
* tests
* status.php
* core
* server container
@MorrisJobke
MorrisJobke force-pushed the drop-getApps-getUsers branch from 16099f3 to 9a7362d Compare December 8, 2014 21:43
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @LukasReschke Ready for final review. The rebase just required the deletion of settings/ajax/userlist.phpand the adjustment of lib/private/user/user.php as there was code moved to. (both by @LukasReschke user list REST PR)

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 214 new issues, 34 updated code elements

@ghost

ghost commented Dec 8, 2014

Copy link
Copy Markdown

Waiting for jenkins in ... #12714


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

DeepDiver1975 added a commit that referenced this pull request Dec 9, 2014
Config cleanup - OC_Preferences refactoring
@DeepDiver1975
DeepDiver1975 merged commit c36bac3 into master Dec 9, 2014
@DeepDiver1975
DeepDiver1975 deleted the drop-getApps-getUsers branch December 9, 2014 08:36
@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants