-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make remote sharee search configurable #40577
Conversation
I'll try to add some tests! |
phpstan complains: "Instantiated class OCA\ScienceMesh\Plugins\ScienceMeshSearchPlugin not found." |
The ShareesController doesn't have any unit or acceptance tests, so I'm unable to add them for this PR. |
phpstan fixed by copying the pattern from https://github.com/owncloud/core/blob/v10.11.0/lib/private/Server.php#L896 |
I got my dev env into a state where I can run |
Can someone re-run "apiShareManagementToRoot-mariadb10.2-php7.4"? |
The pipeline step hung for more than 4 hours. I guess drone eventually killed it. It looks like some drone agent problem happened. I restarted the whole drone CI. |
That helped, thanks a lot! @phil-davis can you also do the review maybe, or should we try to find someone else available? |
@michielbdejong see #40587 - we can actually use a default call to Maybe you could cherry-pick the commit from there, and squash all the commits in this PR, and we can get it reviewed. |
45aa63e
to
fc16243
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny thing!
Technically, I'm ok with the solution. My worry is that neither core nor any ownCloud app uses that feature, so it's possible that we see it as dead code in the future. Any idea how we can make it more visible to prevent the feature from being removed? Maybe adding a comment saying that it's being used in the 3rd party sciencemesh app could be enough. Another thing that worries me is that there is no documentation available about the expectation of the plugin class. If I (or anyone else) want to provide a custom implementation, I simply can't without seeing your code. I also don't know if your code works as expected. I mean, it could return some results, but I don't know if it should return more results or not. It might be better if ownCloud core provides some kind of interface that the sciencemesh app can implement, and take advantage of the interface to document the expected behavior. |
Ah no, but it's used by https://github.com/pondersource/oc-sciencemesh which will be installed on many production systems in various universities and research institutes across Europe. |
$pluginClass = $this->config->getSystemValue('sharing.remoteShareesSearch'); | ||
if ($pluginClass !== '') { | ||
$this->result['remotes'] = []; | ||
$plugin = new $pluginClass($this->config, $this->userManager, $this->userSession); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ctor args might change over time.
Can we use dependency injection here?
Good idea! I can add that. |
In addition, make sure there is some kind of reference that the interface is being used and implemented by 3rd party apps so we know that we need to be careful with it. We might want to change the interface at some point and that would break your app, so a warning would help to prevent that problem in the future. |
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
code-style is complaining. It needs: I tried to do it, but I can't push to this branch in |
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
Ah yes, b8f9fdf broke it! Sorry. |
SonarCloud Quality Gate failed. |
fe2bbf6
to
ac6ff69
Compare
In https://drone.owncloud.com/owncloud/core/37988/28/2 the 'skip-if-unchanged' step of Sonar failed, apparently unrelated to this PR. I'll try what happens if I push a whitespace change. |
Signed-off-by: Michiel de Jong <michiel@unhosted.org>
💥 Acceptance tests pipeline apiFederationToShares1-latest-mariadb10.2-php7.4 failed. The build has been cancelled. |
💥 Acceptance tests pipeline apiFederationToShares1-git-mariadb10.2-php7.4 failed. The build has been cancelled. |
💥 Acceptance tests pipeline apiSharingNotificationsToRoot-mariadb10.2-php7.4 failed. The build has been cancelled. |
💥 Acceptance tests pipeline apiWebdavUpload2-mariadb10.2-php7.4 failed. The build has been cancelled. |
💥 Acceptance tests pipeline cliBackground-mariadb10.2-php7.4 failed. The build has been cancelled. |
💥 Acceptance tests pipeline apiWebdavUpload1-mariadb10.2-php7.4 failed. The build has been cancelled. |
@phil-davis what is the next step now? |
https://drone.owncloud.com/owncloud/core/37990/88/6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@DeepDiver1975 please review again. IMO this is ready to merge. |
@DeepDiver1975 Please merge this today if possible. |
The CI fail is https://drone.owncloud.com/owncloud/core/38013/28/2
I suppose that will be something to do with the fork that this branch comes from and??? But all tests passed. |
Yes, Sonar wants you to put the |
@DeepDiver1975 ? Anyone else? |
https://drone.owncloud.com/owncloud/core/38013 For inclusion in 10.12.0, please redirect this PR to the |
See PR #40667 |
Merged in #40667 |
Description
When the 'sciencemesh' app is installed, use it instead of the federatedfilesharing app to
find sharee matches for OCM sharing.
Related Issue
Motivation and Context
This is needed for OC-10 instances that want to join https://sciencemesh.io
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist:
Unit tests addedAcceptance tests addedDocumentation ticket raised