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

Share tags #11383

Merged
merged 11 commits into from Oct 16, 2014

Conversation

Projects
None yet
8 participants
@ockham
Contributor

ockham commented Oct 1, 2014

Supersedes #11351.

@LukasReschke

View changes

Show outdated Hide outdated lib/private/tagging/tagmapper.php
@LukasReschke

View changes

Show outdated Hide outdated lib/private/tagging/tagmapper.php
@LukasReschke

View changes

Show outdated Hide outdated lib/private/tags.php
@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 1, 2014

Contributor

CCing @babelouest

Contributor

ockham commented Oct 1, 2014

CCing @babelouest

@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tagging/tag.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tagging/tag.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tagging/tagmapper.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tagging/tagmapper.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
$this->owners = array($this->user);
if ($this->includeShared) {
$this->owners = array_merge($this->owners, \OC\Share\Share::getSharedItemsOwners($this->user, $this->type, true));
$this->backend = \OC\Share\Share::getBackend($this->type);

This comment has been minimized.

@MorrisJobke

MorrisJobke Oct 1, 2014

Member

inject the backend too. But maybe I just not get what the backend does, yet.

@MorrisJobke

MorrisJobke Oct 1, 2014

Member

inject the backend too. But maybe I just not get what the backend does, yet.

@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
@@ -203,7 +261,22 @@ public function getIdsForTag($tag) {
if(!is_null($result)) {
while( $row = $result->fetchRow()) {
$ids[] = (int)$row['objid'];

This comment has been minimized.

@MorrisJobke

MorrisJobke Oct 1, 2014

Member

What about using the mapper for this and the above stuff?

@MorrisJobke

MorrisJobke Oct 1, 2014

Member

What about using the mapper for this and the above stuff?

This comment has been minimized.

@ockham

ockham Oct 1, 2014

Contributor

This is the relation table, I don't have a mapper for that.

@ockham

ockham Oct 1, 2014

Contributor

This is the relation table, I don't have a mapper for that.

This comment has been minimized.

@MorrisJobke
@MorrisJobke
@MorrisJobke

View changes

Show outdated Hide outdated lib/private/tags.php
@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 1, 2014

Member

I just read over the code. It looks good, but I need additional time to test against the mechanism.

Member

MorrisJobke commented Oct 1, 2014

I just read over the code. It looks good, but I need additional time to test against the mechanism.

@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 1, 2014

Member

You maybe should explain (or point to the explaination) what are those types and backends. That would be nice.

Member

MorrisJobke commented Oct 1, 2014

You maybe should explain (or point to the explaination) what are those types and backends. That would be nice.

@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 1, 2014

Contributor

The backend stuff is kinda tricky, I explained it in one commit in my contacts related PR:

Fix and re-activate Contact sharing backend.

While not needed for actual contacts sharing (which is solely done via
the Addressbook sharing backend), we need its isValidSource() function
in core's \OC\Tags::getIdsForTag() (which implements \OCP\ITags::getIdsForTag()).
It is required there to test if the items that are tagged with a given
tag are actually allowed to be accessed by the user, i.e. owned by the
user or someone who is sharing it with the user.

Does that make it clearer?

Contributor

ockham commented Oct 1, 2014

The backend stuff is kinda tricky, I explained it in one commit in my contacts related PR:

Fix and re-activate Contact sharing backend.

While not needed for actual contacts sharing (which is solely done via
the Addressbook sharing backend), we need its isValidSource() function
in core's \OC\Tags::getIdsForTag() (which implements \OCP\ITags::getIdsForTag()).
It is required there to test if the items that are tagged with a given
tag are actually allowed to be accessed by the user, i.e. owned by the
user or someone who is sharing it with the user.

Does that make it clearer?

@DeepDiver1975

This comment has been minimized.

Show comment
Hide comment
@DeepDiver1975

DeepDiver1975 Oct 2, 2014

Member

@ockham your sql statements are invalid on postgres and oracle - please have a look: https://ci.owncloud.org/job/pull-request-analyser/7675/console

In case you need support on this feel free to get in touch with me - THX

Member

DeepDiver1975 commented Oct 2, 2014

@ockham your sql statements are invalid on postgres and oracle - please have a look: https://ci.owncloud.org/job/pull-request-analyser/7675/console

In case you need support on this feel free to get in touch with me - THX

@BernhardPosselt

View changes

Show outdated Hide outdated lib/private/tagging/tag.php
@BernhardPosselt

View changes

Show outdated Hide outdated lib/private/tags.php
@BernhardPosselt

View changes

Show outdated Hide outdated lib/private/tags.php
@BernhardPosselt

View changes

Show outdated Hide outdated lib/private/tags.php
@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 13, 2014

Member

Today was a PR merged, that fixed the unit tests on master. Can I ask you to rebase your branch on top of this?

Member

MorrisJobke commented Oct 13, 2014

Today was a PR merged, that fixed the unit tests on master. Can I ask you to rebase your branch on top of this?

@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 13, 2014

Contributor

@MorrisJobke ok, one moment

Contributor

ockham commented Oct 13, 2014

@MorrisJobke ok, one moment

@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 13, 2014

Contributor

Wait a second, aren't those failures due to some CI server's full hard disk?

Contributor

ockham commented Oct 13, 2014

Wait a second, aren't those failures due to some CI server's full hard disk?

@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 13, 2014

Member

@ockham THey were fixed today.

Member

MorrisJobke commented Oct 13, 2014

@ockham THey were fixed today.

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Oct 13, 2014

The inspection completed: 20 new issues, 20 updated code elements

scrutinizer-notifier commented Oct 13, 2014

The inspection completed: 20 new issues, 20 updated code elements

@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 13, 2014

Member

@ockham Usually you don't need to say "retest this" as jenkins will notice changes (if you push to a branch) So the retest was just used to test even if there was no change (regarding the commit sha sum of the last test) and somehow the jenkins infrastructure was fixed in the meantime (as this caused the false negative)

Member

MorrisJobke commented Oct 13, 2014

@ockham Usually you don't need to say "retest this" as jenkins will notice changes (if you push to a branch) So the retest was just used to test even if there was no change (regarding the commit sha sum of the last test) and somehow the jenkins infrastructure was fixed in the meantime (as this caused the false negative)

@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke

MorrisJobke Oct 14, 2014

Member

@DeepDiver1975 Looks like a problem with the filesystem:


Generating code coverage report in HTML format ...PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Could not write to coverage-html-sqlite/index.dashboard.html: failed to open stream: Read-only file system' in /usr/share/php/Text/Template.php:164
Member

MorrisJobke commented Oct 14, 2014

@DeepDiver1975 Looks like a problem with the filesystem:


Generating code coverage report in HTML format ...PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Could not write to coverage-html-sqlite/index.dashboard.html: failed to open stream: Read-only file system' in /usr/share/php/Text/Template.php:164
@LukasReschke

This comment has been minimized.

Show comment
Hide comment
@LukasReschke

LukasReschke Oct 14, 2014

Member

@MorrisJobke We're on it.

Member

LukasReschke commented Oct 14, 2014

@MorrisJobke We're on it.

@MorrisJobke

This comment has been minimized.

Show comment
Hide comment
@MorrisJobke
Member

MorrisJobke commented Oct 14, 2014

@LukasReschke Thanks

@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 15, 2014

Contributor

Review, please?
Pinging @Raydiation @DeepDiver1975

Contributor

ockham commented Oct 15, 2014

Review, please?
Pinging @Raydiation @DeepDiver1975

@ockham

This comment has been minimized.

Show comment
Hide comment
@ockham

ockham Oct 15, 2014

Contributor
Contributor

ockham commented Oct 15, 2014

@owncloud-bot

This comment has been minimized.

Show comment
Hide comment
@owncloud-bot

owncloud-bot Oct 15, 2014

Contributor

🚀 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/259/
🚀 Test PASSed. 🚀

Contributor

owncloud-bot commented Oct 15, 2014

🚀 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/259/
🚀 Test PASSed. 🚀

@LukasReschke

This comment has been minimized.

Show comment
Hide comment
@LukasReschke

LukasReschke Oct 16, 2014

Member

Well, let's make @ockham happy: 👍

Member

LukasReschke commented Oct 16, 2014

Well, let's make @ockham happy: 👍

LukasReschke added a commit that referenced this pull request Oct 16, 2014

@LukasReschke LukasReschke merged commit 5f3ddf5 into owncloud:master Oct 16, 2014

1 check passed

default Merged build finished.
Details
@LukasReschke

This comment has been minimized.

Show comment
Hide comment
@LukasReschke

LukasReschke Oct 16, 2014

Member

Merging as @MorrisJobke also 👍'd this before.

@ockham Thanks a lot for your contribution! - You rock!

Member

LukasReschke commented Oct 16, 2014

Merging as @MorrisJobke also 👍'd this before.

@ockham Thanks a lot for your contribution! - You rock!

@ockham ockham deleted the ockham:share-tags2 branch Oct 23, 2014

@jbtbnl

This comment has been minimized.

Show comment
Hide comment
@jbtbnl

jbtbnl Nov 2, 2014

Member

This breaks group removal as described in https://github.com/owncloud/contacts/issues/691 since a string containing a number will be treated as numeric as well

Member

jbtbnl commented on lib/private/tags.php in 7e9baaf Nov 2, 2014

This breaks group removal as described in https://github.com/owncloud/contacts/issues/691 since a string containing a number will be treated as numeric as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment