owners.py: per-file permissions seem to leak across a 'set noparent' directive |
|||||||
Issue descriptionif you have an OWNERS structure like this: =============== /OWNERS: per-file *.ext=alice@chromium.org darin@chromium.org /base/OWNERS: set noparent bob@chromium.org /ipc/OWNERS: per_file *.ext=set noparent charlie@chromium.org ================ then currently: - alice can LGTM a change that touches both ['/base/foo.ext', '/ipc/bar.ext'] - alice cannot LGTM a change that touches just ['base/foo.ext'] - alice cannot LGTM a change that touches just ['ipc/bar.ext'] - darin cannot LGTM a change that touches both ['/base/foo.ext', '/ipc/bar.ext'] The above behaviors are inconsistent -- adding a file to a CL should never enhance a reviewer's power. Unittest demonstrating the above problems is here: https://codereview.chromium.org/2295723007/
,
Sep 16 2016
Sorry for the delay in responding to this; I was out on vacation and then busy catching back up on things. OWNERS as currently implemented is not meant to have per-file rules apply to subdirectories. That is an often-requested feature, but it requires new syntax. So, if the code was working correctly, we would break the *.mm rules. The syntax we should have which would indicate whether something should apply to subdirs should be to say `per-file .../*.ext=alice@chromium.org`, i.e. the triple-dot ellipsis indicates "this dir and all subdirs". Option C is correct; if that's not how things work today, that's a bug. Yes, `set noparent` on per-file rules is very confusing, but I think it can be implemented in a consistent way in conjunction with the ellipses.
,
Sep 16 2016
Thanks for the clarification. My understanding is that perfile rules like io_thread* don't propagate to subdirs (though it would apply to all files under possible subdirs io_thread/ and io_thread_test/), but perfiles rules based on the extension, like *.mm, or *_mac.cc, do effectively propagate. The ... syntax looks like a nice idea. To implement transitive perfile rules consistent with noparent (i.e. to get the above test to pass), we need to store additional information in the _paths_to_owners struct: in particular, we need to know the PATH of the owners file from which the glob rule (or whatever) emanated, and we need to make sure there's not stop_looking entry between the authorizing OWNERS file and the file being checked.
,
Sep 16 2016
Feel free to steal this. I might be able to come back to it in a couple weeks, but all I've done so far is write the above unittest.
,
Sep 16 2016
> My understanding is that perfile rules like io_thread* don't propagate > to subdirs (though it would apply to all files under possible subdirs > io_thread/ and io_thread_test/), but perfiles rules based on the > extension, like *.mm, or *_mac.cc, do effectively propagate. If there is a difference, that's not intentional and probably just an obvious bug resulting from trying to convert a glob to a regex. > The ... syntax looks like a nice idea. I didn't invent it; this is how this is done in google3 (internally) and comes from the way Perforce refers to things in subdirs :). Yes, implementing transitive rules requires a non-trivial revamp of the implementation, which is why I've never gotten around to doing it. I think it is quite doable, and the implementation as a whole just isn't that big or complicated, but probably takes at least multiple hours if not a couple days.
,
Jan 18 2017
If this is really a Pri-1, find an owner and update the priority. This is the result of a bulk edit that moved high priority available bugs to a lower priority in an attempt to be more honest with bug filers.
,
Feb 21 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Feb 21 2018
This is still worth digging into.
,
Mar 2 2018
I'd like to start working on this. To make sure I understand: - 'per-file <glob>=<something>' means <something> applies to files in the <glob>, but *only* for the current directory. - 'per-file .../<glob>=<something>' means <something> applies also to files in subdirectories. It's not clear to me what 'per-file <glob>=set noparent' or 'per-file .../<glob>=set noparent' mean.
,
Mar 3 2018
Where possible, we should match what google3 does (as documented in go/OWNERS). I think I'd expect things to work like the following: % ls -F OWNERS foo bar baz/ quux % ls -F baz quux % cat OWNERS alice per-file bar=set noparent per-file bar=bob per-file quux=bob per-file .../quux=set noparent per-file .../quux=charlie % alice@ can approve foo, but not bar or quux. bob@ can approve bar and quux, but not foo or baz/quux. charlie@ can approve quux and bar/quux, but not foo or bar. There's probably weirder corner cases that I haven't thought of yet :). If google3 does something different than the above, (a) I'd like to know, and (b) we should probably do what they do.
,
Jul 28
,
Jul 28
,
Jul 31
Related to bug 869232 (which is about per-file rules needing to be recursive in all situations). |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by nick@chromium.org
, Sep 1 2016