Skip to content

Deprecated \OCP\IAppConfig - add missing methods to IConfig - #13938

Merged
DeepDiver1975 merged 4 commits into
masterfrom
deprecate-iappconfig
Mar 27, 2015
Merged

DeepDiver1975 merged 4 commits into
masterfrom
deprecate-iappconfig

Conversation

@MorrisJobke

Copy link
Copy Markdown
Contributor

ref #12260

@karlitschek @DeepDiver1975 I added a deprecation note into the header. In here I added a 2 year time frame, because it involves a interface of the public namespace \OCP. This is meant to be discussed.

I added all the missing methods to our central config interface and added a deprecation note to each method.

Is this the way we want to deal with deprecations?

Opinions @PVince81 @icewind1991 @nickvergessen @LukasReschke ?

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@LukasReschke

Copy link
Copy Markdown
Contributor

+1 from my PoV – 2 year deprecation policy seems sensible.

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

I rebased, because of the merge conflicts

Comment thread lib/private/allconfig.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.

hmm - we shall move this code logic over to use insertIfNotExists - or even enhance it to insertOrUpdate

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.

This is just a whitespace change. Better to fix this in a separate PR

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.

This is just a whitespace change. Better to fix this in a separate PR

sure nothing for this pr - tech dept opened? pr opened? Just to make sure we do not forget @MorrisJobke

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.

@LukasReschke

Copy link
Copy Markdown
Contributor

Rebase required.

@LukasReschke LukasReschke changed the title Deprecated \OCP\IAppConfig - add missing methods to IConfig [WIP] Deprecated \OCP\IAppConfig - add missing methods to IConfig Feb 24, 2015
@MorrisJobke MorrisJobke changed the title [WIP] Deprecated \OCP\IAppConfig - add missing methods to IConfig Deprecated \OCP\IAppConfig - add missing methods to IConfig Feb 26, 2015
Comment thread lib/private/legacy/appconfig.php Outdated

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.

Caused by #14403

@MorrisJobke
MorrisJobke force-pushed the deprecate-iappconfig branch 2 times, most recently from 333e95e to 9c246e4 Compare March 2, 2015 08:40
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

I rebased and added the @since annotation to the new public interface methods.

@MorrisJobke
MorrisJobke force-pushed the deprecate-iappconfig branch 2 times, most recently from bba7204 to b336c0e Compare March 17, 2015 14:25
@MorrisJobke

Copy link
Copy Markdown
Contributor Author

I rebased and removed the whitespace only (and unrelated) changes.

cc @rullzer @nickvergessen @DeepDiver1975

@nickvergessen

Copy link
Copy Markdown
Contributor

Tests? 🙊

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

Tests? 🙊

The AppConfig itself has tests. https://github.com/owncloud/core/blob/c3ae01d66f46321ab79fa0a69597068e12ae72cb/tests/lib/appconfig.php

Once I move these code parts over to the allconfig I will migrate the tests too.

@nickvergessen

Copy link
Copy Markdown
Contributor

Retesting only helps when the tests pass 🙊

    Testergebnis (2 fehlgeschlagene Tests / +2)
    Test_Share.testShareItemWithLinkAndDefaultExpireDate
    Test_Files_Sharing_Api.testUpdateShareExpireDate

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@nickvergessen These are the same as on the CSS-only branches 🙈 but I will debug them locally.

@MorrisJobke
MorrisJobke force-pushed the deprecate-iappconfig branch from b336c0e to fbea83d Compare March 17, 2015 16:35

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.

I assume this already makes problems?

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @Raydiation We had a discussion about the removal of the IAppConfig in #12260 . Can we come to a decision? Do we want to remove the IAppConfig or do we want to drop the app related methods from IConfig and keep IAppConfig? I would rate for the first approach, because then we have a single entrypoint for all the config related stuff.

cc @PVince81 @rullzer @Xenopathic @nickvergessen Maybe join the discussion and write down what you think about this?

@MorrisJobke

Copy link
Copy Markdown
Contributor Author
00:00:00.336 java.io.IOException: remote file operation failed: /var/jenkins/workspace/pull-request-analyser-ng-simple@5 at hudson.remoting.Channel@5212c699:lex-j1: hudson.remoting.ChannelClosedException: channel is already closed
00:00:00.336    at hudson.FilePath.act(FilePath.java:985)
00:00:00.336    at hudson.FilePath.act(FilePath.java:967)
00:00:00.336    at hudson.FilePath.mkdirs(FilePath.java:1150)
00:00:00.336    at hudson.model.AbstractProject.checkout(AbstractProject.java:1263)
00:00:00.336    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609)
00:00:00.336    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
00:00:00.336    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531)
00:00:00.336    at hudson.model.Run.execute(Run.java:1751)
00:00:00.336    at hudson.matrix.MatrixBuild.run(MatrixBuild.java:306)
00:00:00.336    at hudson.model.ResourceController.execute(ResourceController.java:89)
00:00:00.336    at hudson.model.Executor.run(Executor.java:240)
00:00:00.336    at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)
00:00:00.336 Caused by: hudson.remoting.ChannelClosedException: channel is already closed
00:00:00.336    at hudson.remoting.Channel.send(Channel.java:549)
00:00:00.336    at hudson.remoting.Request.call(Request.java:129)
00:00:00.336    at hudson.remoting.Channel.call(Channel.java:751)
00:00:00.336    at hudson.FilePath.act(FilePath.java:978)
00:00:00.336    ... 11 more
00:00:00.336 Caused by: java.io.IOException
00:00:00.336    at hudson.remoting.Channel.close(Channel.java:1105)
00:00:00.336    at hudson.slaves.ChannelPinger$1.onDead(ChannelPinger.java:118)
00:00:00.336    at hudson.remoting.PingThread.ping(PingThread.java:125)
00:00:00.336    at hudson.remoting.PingThread.run(PingThread.java:86)
00:00:00.336 Caused by: java.util.concurrent.TimeoutException: Ping started on 1426676977032 hasn't completed at 1426677217032
00:00:00.336    ... 2 more

@DeepDiver1975 Is this how jenkins should work? ;)

@BernhardPosselt

Copy link
Copy Markdown
Contributor

@MorrisJobke single config interface is fine for me, so I vote for solution 1

@rullzer

rullzer commented Mar 18, 2015

Copy link
Copy Markdown
Contributor

@MorrisJobke I agree, a single interface sounds much cleaner. Also avoids new code duplication in the future.

@scrutinizer-notifier

Copy link
Copy Markdown

The inspection completed: 4 new issues, 6 updated code elements

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

@MorrisJobke Single interface makes more sense to me.

@ghost

ghost commented Mar 18, 2015

Copy link
Copy Markdown

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

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

This is ready for review :)

cc @Xenopathic @rullzer @Raydiation @nickvergessen @LukasReschke @DeepDiver1975

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.

Why again do we need this :D? cant we put these things into the constructor?

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.

Because currently we don't setup all paths with the DI container. And therefore we use the system config in some places (especially base.php) in a very early state of the request (and also during the installation). These places should be properly set up (i.e. with just usage of the SystemConfig - they are in core and there the usage is fine).

But unwrangling this wasn't successful yet, because it was a cyclic dependency. As we now dropped the autoconfig I can give it another try, because that was the most trickiest part. For now this will just delay the object init in the DI to a later point and the database credentials can be loaded correct.

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.

Do we have a tech debt ticket for this?

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.

I don't think so, because this involves the whole base.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.

Please create one :)

This is definitely possible because basically we dont have cyclic dependencies, there is always a starting point (that is reading the config.php)

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.

@MorrisJobke

Copy link
Copy Markdown
Contributor Author

@PVince81 @nickvergessen @LukasReschke @DeepDiver1975 @rullzer @Raydiation @icewind1991 Some review would be really nice

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

DeepDiver1975 added a commit that referenced this pull request Mar 27, 2015
Deprecated \OCP\IAppConfig - add missing methods to IConfig
@DeepDiver1975
DeepDiver1975 merged commit 4d12c4a into master Mar 27, 2015
@DeepDiver1975
DeepDiver1975 deleted the deprecate-iappconfig branch March 27, 2015 15:07
@PVince81

Copy link
Copy Markdown
Contributor

This PR broke the unit tests on master, maybe because the results were outdated.

I have raised a revert PR here: #15284

@MorrisJobke you'll need to resubmit the changes from this PR and fix the unit test.
I suspect it is because the app config isn't reset properly to factory settings.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 13, 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.

9 participants