So, it seems that it has been recently introduced by Dave in [1] to speed-up the Queries like "is:submittable" (see [1]).However, this may be really misleading because if you imagine this scenario:- I am a user without the *full power* on a change C- I am posting a score on C which update its statusThe fact of being "submittable" by that user
--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Fri, Dec 9, 2016 at 2:36 PM, lucamilanesio <luca.mi...@gmail.com> wrote:So, it seems that it has been recently introduced by Dave in [1] to speed-up the Queries like "is:submittable" (see [1]).However, this may be really misleading because if you imagine this scenario:- I am a user without the *full power* on a change C- I am posting a score on C which update its statusThe fact of being "submittable" by that userIt's not telling if the change submittable by a certain user.The submit records just tell you whether the change fulfills all pre-conditions to be submittable (if it has all required approvals + no veto votes according to the submit rules). It doesn't take any submit permissions into account.
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
On Friday, December 9, 2016 at 1:44:33 PM UTC, Edwin Kempin wrote:On Fri, Dec 9, 2016 at 2:36 PM, lucamilanesio <luca.mi...@gmail.com> wrote:So, it seems that it has been recently introduced by Dave in [1] to speed-up the Queries like "is:submittable" (see [1]).However, this may be really misleading because if you imagine this scenario:- I am a user without the *full power* on a change C- I am posting a score on C which update its statusThe fact of being "submittable" by that userIt's not telling if the change submittable by a certain user.The submit records just tell you whether the change fulfills all pre-conditions to be submittable (if it has all required approvals + no veto votes according to the submit rules). It doesn't take any submit permissions into account.But from what I've seen in the code stack trace, the prolog rule is actually going to check the current user's permissions on the required review labels: the permissions validation and associated results are dependent on the current user and may give different values by different users.
I believe this was exactly the discussion thread pointed out by Bjorn were Saša had similar concerns.
Additionally, the current user permissions and ability to access the labels may be completely wrong during off-line reindexing (e.g. we don't load plugins and thus we don't evaluate for instance the user's LDAP groups ownership), giving as a result that is potentially incorrect.
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
On Fri, Dec 9, 2016 at 8:58 AM, lucamilanesio <luca.mi...@gmail.com> wrote:
On Friday, December 9, 2016 at 1:44:33 PM UTC, Edwin Kempin wrote:On Fri, Dec 9, 2016 at 2:36 PM, lucamilanesio <luca.mi...@gmail.com> wrote:So, it seems that it has been recently introduced by Dave in [1] to speed-up the Queries like "is:submittable" (see [1]).However, this may be really misleading because if you imagine this scenario:- I am a user without the *full power* on a change C- I am posting a score on C which update its statusThe fact of being "submittable" by that userIt's not telling if the change submittable by a certain user.The submit records just tell you whether the change fulfills all pre-conditions to be submittable (if it has all required approvals + no veto votes according to the submit rules). It doesn't take any submit permissions into account.But from what I've seen in the code stack trace, the prolog rule is actually going to check the current user's permissions on the required review labels: the permissions validation and associated results are dependent on the current user and may give different values by different users.It doesn't depend on the calling user. It's going through each PatchSetApproval and checking whether *the user who gave that approval* still has permission to give that approval.(PRED__user_label_range_4 takes as one of its arguments a CurrentUser, but that's the Gerrit CurrentUser type, which just means "some user". The actual CurrentUser object passed in varies depending on the PSA being inspected.)I believe this was exactly the discussion thread pointed out by Bjorn were Saša had similar concerns.Yeah but the conclusion from that thread was that squashing votes based on *current* permissions is an important feature, so we couldn't really change it, so here we are.Maybe we can optimize the permissions checking? Or, just for offline reindexing, have a cache of (account ID, dest ref, label) -> permission range?Additionally, the current user permissions and ability to access the labels may be completely wrong during off-line reindexing (e.g. we don't load plugins and thus we don't evaluate for instance the user's LDAP groups ownership), giving as a result that is potentially incorrect.I'm not sure I follow. What plugins can affect LDAP groups?
On 9 Dec 2016, at 14:30, Dave Borowitz <dbor...@google.com> wrote:On Fri, Dec 9, 2016 at 8:58 AM, lucamilanesio <luca.mi...@gmail.com> wrote:
On Friday, December 9, 2016 at 1:44:33 PM UTC, Edwin Kempin wrote:On Fri, Dec 9, 2016 at 2:36 PM, lucamilanesio <luca.mi...@gmail.com> wrote:So, it seems that it has been recently introduced by Dave in [1] to speed-up the Queries like "is:submittable" (see [1]).However, this may be really misleading because if you imagine this scenario:- I am a user without the *full power* on a change C- I am posting a score on C which update its statusThe fact of being "submittable" by that userIt's not telling if the change submittable by a certain user.The submit records just tell you whether the change fulfills all pre-conditions to be submittable (if it has all required approvals + no veto votes according to the submit rules). It doesn't take any submit permissions into account.But from what I've seen in the code stack trace, the prolog rule is actually going to check the current user's permissions on the required review labels: the permissions validation and associated results are dependent on the current user and may give different values by different users.It doesn't depend on the calling user. It's going through each PatchSetApproval and checking whether *the user who gave that approval* still has permission to give that approval.
(PRED__user_label_range_4 takes as one of its arguments a CurrentUser, but that's the Gerrit CurrentUser type, which just means "some user". The actual CurrentUser object passed in varies depending on the PSA being inspected.)
I believe this was exactly the discussion thread pointed out by Bjorn were Saša had similar concerns.Yeah but the conclusion from that thread was that squashing votes based on *current* permissions is an important feature, so we couldn't really change it, so here we are.Maybe we can optimize the permissions checking?
Or, just for offline reindexing, have a cache of (account ID, dest ref, label) -> permission range?
Additionally, the current user permissions and ability to access the labels may be completely wrong during off-line reindexing (e.g. we don't load plugins and thus we don't evaluate for instance the user's LDAP groups ownership), giving as a result that is potentially incorrect.I'm not sure I follow. What plugins can affect LDAP groups?
We've been talking about this a bit internally, and we have come to the tentative decision to just kill the whole retroactive vote-squashing "feature" entirely, both during indexing and in the frontend. AFAIK that is the only way that permission evaluation should be happening during reindexing.Vote squashing has quite a few downsides:
* It doesn't (and can't feasibly) mention in the change message log that this has happened.
* Thus there may be an inconsistency in the UI between the value on the reviewer chip and the value in the message.
* The submit rule evaluator has confusing notions of strict/slow vs. lenient/fast evaluations scattered throughout.
* Permissions checks are either slow during batch indexing (aka the original complaint on this thread).
The upsides are...slimmer. Basically it feels like we have been doing this forever just because we can.
Arguably, admins revoking a voting permission want to be able to limit the damage of an unintentionally broad permission. But:
* We never really polled anyone to determine whether they actually do care or expect it to work this way.
* The threat model is preventing submission of changes by people who shouldn't have permission. If someone has CR+2 permission, they probably also have Submit. Any reasonably determined attacker would just CR+2 and submit immediately, which retroactively squashing votes wouldn't prevent.
* No other permission (other than Read) has this kind of retroactive behavior.
So I say, let's just kill it. We can delete code, unconfuse users, and speed up indexing with one fell swoop.
We've been talking about this a bit internally, and we have come to the tentative decision to just kill the whole retroactive vote-squashing "feature" entirely, both during indexing and in the frontend. AFAIK that is the only way that permission evaluation should be happening during reindexing.Vote squashing has quite a few downsides:
* It doesn't (and can't feasibly) mention in the change message log that this has happened.
* Thus there may be an inconsistency in the UI between the value on the reviewer chip and the value in the message.
* The submit rule evaluator has confusing notions of strict/slow vs. lenient/fast evaluations scattered throughout.
* Permissions checks are either slow during batch indexing (aka the original complaint on this thread).
The upsides are...slimmer. Basically it feels like we have been doing this forever just because we can.
Arguably, admins revoking a voting permission want to be able to limit the damage of an unintentionally broad permission.
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
-Martin
--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation