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

Move more logic from addMountPoint into separate functions #8583

Closed
wants to merge 3 commits into from

Conversation

RobinMcCorkell
Copy link
Member

I will get Scrutinizer to give something higher than an F for addMountPoint... also this reduces duplicated code and (IMO) makes the logic a bit clearer

@ghost
Copy link

ghost commented May 13, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/4769/

@LukasReschke
Copy link
Member

Create some unit tests and you will get my +1 ;-)

@RobinMcCorkell
Copy link
Member Author

@LukasReschke The new functions are private, and are used in existing functions (which have unit tests already), so how would that work?

@LukasReschke
Copy link
Member

@LukasReschke
Copy link
Member

Btw. I can't find an unittest for removeMountPoint. If we have unittests for all public functions then testing the private ones is not relevant anymore.

@RobinMcCorkell
Copy link
Member Author

@LukasReschke Done 😄

@ghost
Copy link

ghost commented May 14, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/4794/

if (is_null($user)) {
return true;
} else {
if (isset($personalBackends[$backend])) {
Copy link

Choose a reason for hiding this comment

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

Merge into "else if"

@ghost
Copy link

ghost commented May 16, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/4825/

@PVince81
Copy link
Contributor

@Xenopathic before refactoring, please make sure that we're fixing an actual issue and that there is a direct need for it.
The reason is that there is always a risk of breaking existing functionality and it requires taking time for regression testing. But if there is another bugfix or something that will need regression testing anyway, it would also cover the refactoring.
Best practice is to only refactor when it fixes an actual issue, for which the tests will cover the refactoring as well, as to save testing time.

The code looks good but haven't had time to test it yet.

@PVince81
Copy link
Contributor

Still, kudos for making the code more readable 😄

@PVince81
Copy link
Contributor

Please rebase

@RobinMcCorkell
Copy link
Member Author

I split the new priority code into a separate function - see getBackendDefaultPriority()

@ghost
Copy link

ghost commented May 22, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/4947/

@ghost
Copy link

ghost commented May 22, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/4954/

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2014

I didn't have time to test this yet, sorry.

@DeepDiver1975 are you ok with this PR ?

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2014

@LukasReschke the unit tests are here, can you have a another look ?

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2014

I had a quick test and adding mount points still work.
Also, the merging of configs when updating them work as well.

👍

Needs a second reviewer @LukasReschke @icewind1991

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2014

@Xenopathic please rebase

@ghost
Copy link

ghost commented Jun 6, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5466/

@scrutinizer-notifier
Copy link

A new inspection was created.

@RobinMcCorkell
Copy link
Member Author

Is this something that we want merged then? As you say @PVince81, it does make the code significantly more readable, but it also paves the way for another PR I have planned (when I get the next version my other project released). In that case, this needs a second reviewer. @LukasReschke you happy with this now?

@PVince81
Copy link
Contributor

Trouble is we are already past feature freeze, so it might need to wait for OC 8 to be merged, sorry :-/

@ghost
Copy link

ghost commented Jun 17, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5644/

@RobinMcCorkell
Copy link
Member Author

OK, in that case this can wait: it doesn't significantly affect performance

@PVince81
Copy link
Contributor

@bantu you'll probably enjoy reviewing this refactoring ?

@ghost
Copy link

ghost commented Oct 6, 2014

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

@ghost
Copy link

ghost commented Oct 15, 2014

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

@PVince81
Copy link
Contributor

@Xenopathic do we still want this ?
I'd vote to rather work on improving the whole thing radically as discussed in #11261

@RobinMcCorkell
Copy link
Member Author

@PVince81 Yeah, let's kill it. I'll leave the branch though, in case someone can benefit from the changed code

@MorrisJobke MorrisJobke deleted the better-addmountpoint branch January 6, 2015 16:14
@MorrisJobke
Copy link
Contributor

@Xenopathic You can always restore the branch here on github, if you want ;)

@RobinMcCorkell
Copy link
Member Author

@MorrisJobke For the time being, at least until GitHub does garbage collection :)

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

6 participants