Re: watch project file:^REGEX in gerrit doesn't work

1,899 views
Skip to first unread message

Edwin Kempin

unread,
Dec 28, 2012, 8:23:12 AM12/28/12
to Jong Ricky, repo-d...@googlegroups.com


2012/12/20 Jong Ricky <z001...@gmail.com>
i want to watch all java file in all-project,but when i use the below setting.i didn't get any reslut in my watched project
project:All-Projects
file:^.*\.java
and then i find i can not use any  regular expression patterns in gerrit search,have i be short of anything in my gerrit?
Not sure why the watching doesn't work, but the documentation [1] says that the 'file' operator is currently only supported for watching projects but not in the search bar.

[1] https://gerrit-review.googlesource.com/Documentation/user-search.html#file
 

thanks !! 

--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

Stefan Lay

unread,
Apr 23, 2013, 8:45:01 AM4/23/13
to repo-d...@googlegroups.com
The Gerrit version we're running on is basically 2.5 with some (presumably) unrelated changes.


2013/4/23 stefanlay <stefa...@gmail.com>


On Friday, December 28, 2012 2:23:12 PM UTC+1, Edwin Kempin wrote:


2012/12/20 Jong Ricky <z001...@gmail.com>

i want to watch all java file in all-project,but when i use the below setting.i didn't get any reslut in my watched project
project:All-Projects
file:^.*\.java
and then i find i can not use any  regular expression patterns in gerrit search,have i be short of anything in my gerrit?
Not sure why the watching doesn't work, but the documentation [1] says that the 'file' operator is currently only supported for watching projects but not in the search bar.

[1] https://gerrit-review.googlesource.com/Documentation/user-search.html#file
 
I see the same issue as the OP.  When I try file:^.*\.java or any other regular expression in the "Only If" field of the Watched Projects UI I don't get search results (gerrit version2.6-internal-3)

--
---
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Zeng Lames

unread,
Aug 26, 2013, 11:49:37 PM8/26/13
to Stefan Lay, repo-d...@googlegroups.com
we met this issue also. after drill down the source code. found that the "allowFile" isn't set when create ChangeQueryBuilder in "IsWatchedByPredicate.java". then builder used default value "false" for it. when try to match, the builder throw exception boz allowFile=false but using file expression in the filter. 

we set allowFile as true and then the watched changes are there as espected.
--
Best Wishes!
Lames

Edwin Kempin

unread,
Aug 27, 2013, 1:43:03 AM8/27/13
to Zeng Lames, Stefan Lay, Repo and Gerrit Discussion



2013/8/27 Zeng Lames <lezhi...@gmail.com>

we met this issue also. after drill down the source code. found that the "allowFile" isn't set when create ChangeQueryBuilder in "IsWatchedByPredicate.java". then builder used default value "false" for it. when try to match, the builder throw exception boz allowFile=false but using file expression in the filter. 

we set allowFile as true and then the watched changes are there as espected.
It's by intension that the IsWatchedByPredicate doesn't allow the file operator. The file operator is very inefficient and this is why it is disabled for quries. You may get very bad performance by switching this one, see [1]. With the support of secondary indexes (e.g. Lucene) in master the performance of the file operator is drastically improved (since the file information is now stored in the index) so that there the file operator is allowed in queries (if secondary indexes are enabled). 

[1] https://gerrit-review.googlesource.com/#/c/47506/2/gerrit-server/src/main/java/com/google/gerrit/server/query/change/IsWatchedByPredicate.java

Shawn Pearce

unread,
Aug 27, 2013, 9:53:44 AM8/27/13
to Edwin Kempin, Zeng Lames, Stefan Lay, Repo and Gerrit Discussion
On Mon, Aug 26, 2013 at 10:43 PM, Edwin Kempin <edwin....@gmail.com> wrote:



2013/8/27 Zeng Lames <lezhi...@gmail.com>
we met this issue also. after drill down the source code. found that the "allowFile" isn't set when create ChangeQueryBuilder in "IsWatchedByPredicate.java". then builder used default value "false" for it. when try to match, the builder throw exception boz allowFile=false but using file expression in the filter. 

we set allowFile as true and then the watched changes are there as espected.
It's by intension that the IsWatchedByPredicate doesn't allow the file operator. The file operator is very inefficient and this is why it is disabled for quries. You may get very bad performance by switching this one, see [1]. With the support of secondary indexes (e.g. Lucene) in master the performance of the file operator is drastically improved (since the file information is now stored in the index) so that there the file operator is allowed in queries (if secondary indexes are enabled). 

It is somewhat likely secondary indexes will be on by default in 2.8, and 2.8 will ship when secondary indexes can be on by default. :-)

reinhar...@gmail.com

unread,
Mar 7, 2014, 12:10:32 PM3/7/14
to repo-d...@googlegroups.com
It looks like in Gerrit 2.8.1 the file search is enabled, however a secondary index is required
I found the index section in the documentation which shows how to set the index and the instructions on how to run the reindex command
However it does not tell me anywhere if I need to install additional software (Lucene?) before I can use the secondary index
Is this documented somewhere?


On Thursday, December 20, 2012 10:53:12 AM UTC-5, Jong Ricky wrote:
i want to watch all java file in all-project,but when i use the below setting.i didn't get any reslut in my watched project
project:All-Projects
file:^.*\.java
and then i find i can not use any  regular expression patterns in gerrit search,have i be short of anything in my gerrit?

thanks !! 

Dave Borowitz

unread,
Mar 7, 2014, 12:11:40 PM3/7/14
to reinhar...@gmail.com, repo-discuss
Lucene is a Java library that is compiled into the Gerrit WAR. Setting up gerrit.config and running the Reindex command should be sufficient.


--
---
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.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages