Issue 1963: fatal: "--verified" is not a valid option when running gerrit cli
Status:  Duplicate
Merged:  issue 2440
Owner: ----
Closed:  May 2014
Reported by farshid....@gmail.com, Jun 17, 2013
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version:

What steps will reproduce the problem?
1. upload a change to gerrit 
2. run this cli
ssh -p 29418 xyz@server gerrit review --verified +1 --code-review +2 --project demo-xyz 7,1
fatal: "--verified" is not a valid option
3. things work out fine if i remove the --verified

What is the expected output? What do you see instead?
i see the comments on gerrit if i remove the --verified.
when i run this against 2.5. gerrit things work just fine.

Please provide any additional information below.
Jun 20, 2013
#1 TGrigor...@gmail.com
I was facing the same problem. Then I have changed --verified with --label Verified=<N> and this has solved the problem.

(Please have a look into http://gerrit-documentation.googlecode.com/svn/Documentation/2.6/cmd-review.html)
Jul 25, 2013
#2 psz...@gmail.com
Is this a bug or a feature? is the --version feature/parameter deprecated since the gerrit 2.7 release? 

The Jenkins Trigger plugin seems to use the old "--version" syntax and this is a reason why Jenkins integration is not working with Gerrit 2.7 (tested on rc03). The Jenkins plugin needs to be updated or the bug in Gerrit needs to be fixed.
Jul 25, 2013
#3 psz...@gmail.com
"ssh  gerrit gerrit review --label Verified=1" 
 -does not work too with 2.7,  with 2.6 it works like expected.
Jul 25, 2013
#4 dborowitz@google.com
The behavior of "--verified" has not changed since pre-2.6, and "--label Verified" has not changed since 2.6. What has changed is that the Verified label is not created by default when initializing a site; if --verified is not working for you, can you check the contents of project.config in All-Projects?
Aug 2, 2013
#5 jchal...@google.com
I have the same issue with 2.6.1. 

The [label "Verified'] stanza does not exist at all in the All-Projects project.config, and when added to the specific project, the --verified flag returns the same 'fatal: "--verified" is not a valid option' message.

Changing the flag to --label Verified=1 in the cli call worked properly, however.

I followed the instructions from here: http://gerrit-documentation.googlecode.com/svn/Documentation/2.7/config-labels.html#label_Verified
Aug 2, 2013
#6 dborowitz@google.com
For sort-of backwards compatibility we do generate a list of valid flags to gerrit review according to the labels in project.config in All-Projects. (This is still not perfect, since you could define a label in All-Projects called e.g. "Help", which conflicts with an existing flag.)

It would be considerably trickier to examine the argument list and determine exactly which projects are being referenced, then populate the valid flags with the union of labels for all affected projects. And it's not clear what to do e.g. in --help when the same label in different projects has different values. So we punted and just populate flags from All-Projects.

When I say the behavior of --verified hasn't changed, what I mean is if you run it on a server that had a Verified approval category in the DB prior to upgrading to 2.6, which would subsequently have been migrated to All-Projects, --verified will still be valid. But note that for new sites we no longer create the Verified label by default, so maybe that is causing some confusion. (If your site had Verified pre-2.6 and the schema migration erased it, that's a serious bug in the migration we need to fix.)
Sep 9, 2013
#7 jede...@gmail.com
It seems rather strange that you are able to handle --label Verified=1 and not --verified +1. Those two options should be synonyms.

Apart from that, it is not at all obvious that you have to configure the Verified label at the All-Projects level and not just in the individual project. This should at least be stated in the documentation. 
May 16, 2014
Project Member #8 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 2440