reviewers plugin: multiple filter rule matches

237 views
Skip to first unread message

euphxenos

unread,
Aug 29, 2018, 2:33:18 PM8/29/18
to Repo and Gerrit Discussion
The documentation for the reviewers plugin states that it supports multiple filter rule matches.  I have a reviewers.config that looks like this:

[filter "*"]
    reviewer = usera
[filter "file:^src/path/to/some/file"]
    reviewer = groupa
[filter "file:^src/.*"]
    reviewer = groupb


If I push a change in that adds a new file in the root of this repo, it correctly adds usera as a reviewer.  However, if I make a change to src/path/to/some/file, it does not add any reviewers.  I would expect that to hit all three of these filter rules, adding usera, groupa, and groupb.  I'm currently testing this with Gerrit 2.15.3, with reviewers plugin version 7b6ad0e881 (downloaded from gerritforge a couple of weeks ago).  I've seen similar behavior with Gerrit 2.14.1 and a correspondingly older version of the reviewers plugin (f04ea42).  The behavior I'm seeing now is a bit worse than what I've seen in the past, where a review that matches multiple filter rules would only add reviewers from the first matching filter rule, where now I'm not getting reviewers added from any of the rules when multiple rules should match.

Is there a configuration option I have to turn on in gerrit.config for reviewers to support matching multiple filter rules, or something else that I'm missing?


thanks,
--Andrew

David Ostrovsky

unread,
Aug 30, 2018, 5:04:36 PM8/30/18
to Repo and Gerrit Discussion

On Wednesday, August 29, 2018 at 8:33:18 PM UTC+2, euphxenos wrote:
The documentation for the reviewers plugin states that it supports multiple filter rule matches.  I have a reviewers.config that looks like this:

[filter "*"]
    reviewer = usera
[filter "file:^src/path/to/some/file"]
    reviewer = groupa
[filter "file:^src/.*"]
    reviewer = groupb


If I push a change in that adds a new file in the root of this repo, it correctly adds usera as a reviewer.  However, if I make a change to src/path/to/some/file, it does not add any reviewers. 

I cannot reproduce that here. On Gerrit and reviewer's plugins master branch
it correctly adds both reviewers from both sections. I've tested this configuration:

[filter "*"]
    reviewer = usera
[filter "file:^src/path/to/some/file"]
    reviewer = userb

Pushing a change with src/path/to/some/file file included, correctly adds both usera
and userb as reviewers. I also added this unit test for test adding reviewers from
multiple configuration section and this test is passing: [1].


euphxenos

unread,
Aug 31, 2018, 7:47:24 PM8/31/18
to Repo and Gerrit Discussion
Thanks for trying it, and I'm glad to see a test in place for this.  We've also found that we can't add reviewers to a review unless they come up in the initial ten suggested reviewers.  If I start typing someone's name, autocomplete doesn't find the user.  If I type in a user's entire name and try to add them, I get the error that the name "does not identify a registered user or group".  If I type in a group name, it autocompletes and lets me add everyone in that group.  Between these two problems, I'm wondering if something went wrong in the conversion of our account information from reviewdb to notedb during the upgrade.  Is there some way to verify that that conversion took place correctly?


thanks,
--Andrew

David Ostrovsky

unread,
Sep 1, 2018, 1:01:23 AM9/1/18
to Repo and Gerrit Discussion

On Saturday, September 1, 2018 at 1:47:24 AM UTC+2, euphxenos wrote:


On Thursday, August 30, 2018 at 2:04:36 PM UTC-7, David Ostrovsky wrote:

On Wednesday, August 29, 2018 at 8:33:18 PM UTC+2, euphxenos wrote:
The documentation for the reviewers plugin states that it supports multiple filter rule matches.  I have a reviewers.config that looks like this:

[filter "*"]
    reviewer = usera
[filter "file:^src/path/to/some/file"]
    reviewer = groupa
[filter "file:^src/.*"]
    reviewer = groupb


If I push a change in that adds a new file in the root of this repo, it correctly adds usera as a reviewer.  However, if I make a change to src/path/to/some/file, it does not add any reviewers. 

I cannot reproduce that here. On Gerrit and reviewer's plugins master branch
it correctly adds both reviewers from both sections. I've tested this configuration:

[filter "*"]
    reviewer = usera
[filter "file:^src/path/to/some/file"]
    reviewer = userb

Pushing a change with src/path/to/some/file file included, correctly adds both usera
and userb as reviewers. I also added this unit test for test adding reviewers from
multiple configuration section and this test is passing: [1].



Thanks for trying it, and I'm glad to see a test in place for this.  We've also found that we can't add reviewers to a review unless they come up in the initial ten suggested reviewers.  If I start typing someone's name, autocomplete doesn't find the user. 

Can you uninstall reviewers plugin to confirm that this problem is related/unrelated to the reviewers plugin?
 
If I type in a user's entire name and try to add them, I get the error that the name "does not identify a registered user or group".  If I type in a group name, it autocompletes and lets me add everyone in that group.  Between these two problems, I'm wondering if something went wrong in the conversion of our account information from reviewdb to notedb during the upgrade.  Is there some way to verify that that conversion took place correctly?

Have you tried to re-run reindex accounts?
 


thanks,
--Andrew

Reply all
Reply to author
Forward
0 new messages