Account status from All-Users repository

775 views
Skip to first unread message

Mk

unread,
Apr 22, 2024, 2:55:23 AM4/22/24
to Repo and Gerrit Discussion
In gerrit 3.2.3 version, How do I view gerrit account status (Active or Inactive) from All-Users repository.

I could able to view using RestApi and Ssh Admin-console methods. However for our use case need to fetch it from All-Users repository side. So,please guide to view the same.

Edwin Kempin

unread,
Apr 22, 2024, 2:58:57 AM4/22/24
to Mk, Repo and Gerrit Discussion
On Mon, Apr 22, 2024 at 8:55 AM Mk <moha...@gmail.com> wrote:
In gerrit 3.2.3 version, How do I view gerrit account status (Active or Inactive) from All-Users repository.

I could able to view using RestApi and Ssh Admin-console methods. However for our use case need to fetch it from All-Users repository side. So,please guide to view the same.

Fetch and checkout the user branch via git [1] and then inspect the 'active' properties in the 'account.config' file [2].

 

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/b39bedff-7850-4bd5-ac84-349513d39397n%40googlegroups.com.

Mk

unread,
Apr 22, 2024, 3:18:53 AM4/22/24
to Repo and Gerrit Discussion

Hi Edwin,

Ok, I’m trying below way, but unable to checkout the user branch.

 1)     git clone  "ssh://gerrit...@gerrit.codereview.com:29418/All-Users"

2)     cd All-Users

3)     git checkout user-1

error: pathspec ' user-1' did not match any file(s) known to git

Fabio Ponciroli

unread,
Apr 22, 2024, 3:53:51 AM4/22/24
to Mk, Repo and Gerrit Discussion
Hi,


On Mon, 22 Apr 2024 at 09:18, Mk <moha...@gmail.com> wrote:

Hi Edwin,

Ok, I’m trying below way, but unable to checkout the user branch.

 1)     git clone  "ssh://gerrit...@gerrit.codereview.com:29418/All-Users"

2)     cd All-Users

3)     git checkout user-1

error: pathspec ' user-1' did not match any file(s) known to git


this is how you can checkout your user account

> git ls-remote | grep users
From ssh://admin@localhost:29418/All-Users
bbd027b4d113fe9976821f5544c3520759ab5916 refs/users/00/1000000
bbd027b4d113fe9976821f5544c3520759ab5916 refs/users/self

> git fetch origin refs/users/00/1000000 && git checkout FETCH_HEAD
Warning: Permanently added '[localhost]:29418' (ED25519) to the list of known hosts.
remote: Counting objects: 9, done
remote: Finding sources: 100% (9/9)
remote: Total 9 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (9/9), 1.23 KiB | 315.00 KiB/s, done.
From ssh://localhost:29418/All-Users

> ls -lrt
-rw-r--r--  1 user  wheel    72B 22 Apr 09:50 account.config
-rw-r--r--  1 user  wheel   391B 22 Apr 09:50 authorized_keys
-rw-r--r--  1 user  wheel    32B 22 Apr 09:50 preferences.config

HTH
Ponch

 

On Monday, April 22, 2024 at 12:28:57 PM UTC+5:30 Edwin Kempin wrote:
On Mon, Apr 22, 2024 at 8:55 AM Mk <moha...@gmail.com> wrote:
In gerrit 3.2.3 version, How do I view gerrit account status (Active or Inactive) from All-Users repository.

I could able to view using RestApi and Ssh Admin-console methods. However for our use case need to fetch it from All-Users repository side. So,please guide to view the same.

Fetch and checkout the user branch via git [1] and then inspect the 'active' properties in the 'account.config' file [2].

 

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/b39bedff-7850-4bd5-ac84-349513d39397n%40googlegroups.com.

--
--
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.

Mk

unread,
Apr 22, 2024, 6:30:07 AM4/22/24
to Repo and Gerrit Discussion
Thanks a lot Ponch. I could able to get the details.

Matthias Sohn

unread,
Apr 22, 2024, 6:35:58 AM4/22/24
to Mk, Repo and Gerrit Discussion
On Mon, Apr 22, 2024 at 12:30 PM Mk <moha...@gmail.com> wrote:
Thanks a lot Ponch. I could able to get the details.

Another way to read information from notedb is using git log and git show on these custom refs.
This works without checking out the ref.

Mk

unread,
Apr 22, 2024, 7:33:50 AM4/22/24
to Repo and Gerrit Discussion
Hi Matthias, Can you please share the steps to read the information from notedb. it would be great helpful.

Thanks in advance.

Matthias Sohn

unread,
Apr 22, 2024, 8:30:36 AM4/22/24
to Mk, Repo and Gerrit Discussion
On Mon, Apr 22, 2024 at 1:33 PM Mk <moha...@gmail.com> wrote:
Hi Matthias, Can you please share the steps to read the information from notedb. it would be great helpful.


to get a log of configuration changes run
$ git log -p refs/users/00/1000000

show the configuration files:

$ git show refs/users/00/1000000:account.config
[account]
        fullName = Administrator
        preferredEmail = ad...@example.com

$ git show refs/users/00/1000000:preferences.config
[general]
        downloadScheme = ssh

$ git show refs/users/00/1000000:watch.config
fatal: path 'watch.config' does not exist in 'refs/users/00/1000000'

$ git show refs/users/00/1000000:authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMHTMchX...

similarily you can inspect groups stored in gerrit

$ git show refs/groups/6a/6a2da5383088549f6b6e1adca278b9d8e96e474a:group.config
[group]
        id = 2
        name = Service Users
        description = Users who perform batch actions on Gerrit
        ownerGroupUuid = 119b74c4b9feb5576e471e4748b684bb8760379f
        visibleToAll = false


You can use git grep to search for externalids

$ git grep admin refs/meta/external-ids
refs/meta/external-ids:2e13b73bf295005d5503223fa8ba56eb52707301:[externalId "mailto:ad...@example.com"]
refs/meta/external-ids:2e13b73bf295005d5503223fa8ba56eb52707301:        email = ad...@example.com
refs/meta/external-ids:b54915000d281bb92f990131b8356c67fa065353:[externalId "username:admin"]

to read the externalid configuration of a user show the respective object found by git grep:

$ git show refs/meta/external-ids:2e13b73bf295005d5503223fa8ba56eb52707301
[externalId "mailto:ad...@example.com"]
        accountId = 1000000
        email = ad...@example.com
 
Reply all
Reply to author
Forward
0 new messages