list all users under Gerrit 2.16

3,124 views
Skip to first unread message

RJ

unread,
Mar 8, 2019, 6:49:14 PM3/8/19
to Repo and Gerrit Discussion

Hello,

    We have upgraded to 2.16 from an older version 2.12 as well migrated to NoteDB. Under 2.16 version not able to find a way to list all the users under Gerrit. 

Previously were able to query "accounts_external_ids" table from a database. Not sure if am missing documentation here. 

Can you please let me know if we have Rest call or command line calls to capture this info

Thanks
RJ

Gert van Dijk

unread,
Mar 8, 2019, 7:46:09 PM3/8/19
to Repo and Gerrit Discussion
Gerrit core does not have this (basic) feature, opposed to included commands to list groups and projects, it can't list users by default. The admin-console plugin can help you out, though: cmd ls-users.

See also Issue 2402. In my opinion it's pretty odd to not have an ls-users command in Gerrit core, but to have many other user administrative management commands available in core.

HTH

RJ

unread,
Mar 8, 2019, 10:34:22 PM3/8/19
to Repo and Gerrit Discussion
Thanks, Gert

  Yeah, I agree that not having the option to list users under core Gerrit via command line/Rest API is odd as the newer version will be without reviewDB.  For administrative tasks like auditing/renaming/activate/deactivate this will be most useful

Ravi Jaladi

unread,
Mar 9, 2019, 4:02:26 PM3/9/19
to Repo and Gerrit Discussion
Hello Luca,

  Thanks for the update.

Yes I agree we never add this via command line but we were able to use gsql/MySQL commands to target "accounts_external_Id" table to get a full list of users

A couple of use cases which helped me with this table  in the past

Acquisitions:  If a full list of user names help us to capture and map with new usernames provided by the new company and modifying this table we were able to keep user profiles intact

LDAP: when you authenticate with LDAP, this  full list gives the ability to cross verify with the company AD database and  gives the ability to make users inactive who left the company

Miscellaneous: if a user (maybe contractor in a company) leaves the company and joins back may be in a couple of months in the same team. Now he has a new username so, replacing his Old username with a new one will have is an old profile restored


Having ReviewDB, especially "accounts_external_ID" with unique ID association with username helped with a lot of user-management use cases and with migrating to NoteDB we are losing these capabilities from Gerrit core  




Thanks,
Ravi Jaladi



On Sat, Mar 9, 2019 at 4:06 AM <luca.mi...@gmail.com> wrote:


Sent from my iPhone

On 9 Mar 2019, at 03:34, 'RJ' via Repo and Gerrit Discussion <repo-d...@googlegroups.com> wrote:

Thanks, Gert

  Yeah, I agree that not having the option to list users under core Gerrit via command line/Rest API is odd

There is a REST API for both listing and searching.

The command line over SSH for accounts listing never existed though.

If you want an external interface to query Gerrit entities without ReviewDb, you could use ElasticSearch as option for indexes instead of Lucene.

We have been without ReviewDb for 12 months so far on GerritHub.io and I do not miss any admin command so far, or any ReviewDb related task at all.

We have always space for improvement, so suggestions are more than welcome.


as the newer version will be without reviewDB.  For administrative tasks like auditing/renaming/activate/deactivate this will be most useful

Have you used the audit plugin?
Renaming accounts was never supported and is very dangerous as you may have people impersonating other accounts.

HTH

Luca





On Friday, March 8, 2019 at 4:46:09 PM UTC-8, Gert van Dijk wrote:
On Saturday, 9 March 2019 00:49:14 UTC+1, RJ wrote:

Hello,

    We have upgraded to 2.16 from an older version 2.12 as well migrated to NoteDB. Under 2.16 version not able to find a way to list all the users under Gerrit. 

Previously were able to query "accounts_external_ids" table from a database. Not sure if am missing documentation here. 

Can you please let me know if we have Rest call or command line calls to capture this info

Gerrit core does not have this (basic) feature, opposed to included commands to list groups and projects, it can't list users by default. The admin-console plugin can help you out, though: cmd ls-users.

See also Issue 2402. In my opinion it's pretty odd to not have an ls-users command in Gerrit core, but to have many other user administrative management commands available in core.

HTH

--
--
To unsubscribe, email repo-discuss...@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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edwin Kempin

unread,
Mar 11, 2019, 4:20:24 AM3/11/19
to Ravi Jaladi, Repo and Gerrit Discussion
Assuming that you can see all accounts you can list all accounts by doing an account query [1].
Just make a query that matches all accounts, such as:
https://<host>/a/accounts/?q=is:active+OR+is:inactive&o=DETAILS

Ravi Jaladi

unread,
Mar 11, 2019, 11:34:43 AM3/11/19
to Edwin Kempin, Repo and Gerrit Discussion
Hello Edwin,

    Thanks for the update. Below query gives me a "400 Bad Request" with "Invalid query"



Edwin Kempin

unread,
Mar 11, 2019, 11:45:36 AM3/11/19
to Ravi Jaladi, Repo and Gerrit Discussion
On Mon, Mar 11, 2019 at 4:34 PM Ravi Jaladi <ravi....@broadcom.com> wrote:
Hello Edwin,

    Thanks for the update. Below query gives me a "400 Bad Request" with "Invalid query"

If you open it in a browser you should remove the '/a'.
At least this query works for me:
Reply all
Reply to author
Forward
0 new messages