Open-sourcing internal plugin: admin-tools

114 views
Skip to first unread message

JouYoung Suh

unread,
Mar 28, 2022, 2:17:27 PM3/28/22
to Repo and Gerrit Discussion

Hi,

We have an internal plugin called admin-tools that we are considering to open source. It is a plugin that provides various administrator tools through ssh commands and REST API. However, before requesting to open source it, we would like to ask if there would be anyone interested in such plugin.

To help understand functionality of admin tools, I have listed its functionality as below:


SSH commands:

NAME: check-project-visibility
DESCRIPTION: Check project readability to a specific user. Allows any user to query if a specific user can read non-config references in the specific project.

NAME: flush-jgit-cache
DESCRIPTION: Flush JGit repositories in-memory cache.  Flush JGit repositories in-memory cache. The command will wait until cache is flushed before returning, it can take some time if the cache is big.

NAME: reset-jgit-cache-counters
DESCRIPTION: Reset JGit repositories in-memory cache usage counters. 

NAME: show-jgit-cache
DESCRIPTION: Show JGit repositories in-memory cache. The command will display jgit cache information. It can take some time if the cache is big.  .


REST API:

REQUEST
GET /plugins/admin-tools/check-project-visibility?project=All-Projects&user=admin HTTP/1.0

Allows admin user to query for a specific user can read non-config references in the specific project.


REQUEST
POST /plugins/admin-tools/archive HTTP/1.0

Allows admin to archive the repository. This request is equivalent to git archive command


REQUEST
POST /plugins/admin-tools/jgit/flush HTTP/1.0

Allows admin to flush JGit repositories in-memory cache


REQUEST
POST /plugins/admin-tools/jgit/reset HTTP/1.0

Allows admin to reset JGit repositories in-memory cached usage counters.


REQUEST
GET /plugins/admin-tools/jgit/show HTTP/1.0

Allows admin to reset JGit repositories in-memory cached usage counters.


Thank you

JouYoung

 

Nguyen Tuan Khang Phan

unread,
Mar 28, 2022, 4:04:30 PM3/28/22
to Repo and Gerrit Discussion
Hi,

JouYoung is our new Intern at Ericsson. Regarding this plugin, I opened a discussion during the last community meeting regarding a new plugin. This is the plugin we want to propose.

Thanks,
Khang

Martin Fick

unread,
Mar 28, 2022, 4:34:41 PM3/28/22
to JouYoung Suh, Repo and Gerrit Discussion
On 2022-03-24 09:49, JouYoung Suh wrote:>
> We have an internal plugin called admin-tools that we are considering
> to open source. It is a plugin that provides various administrator
> tools through ssh commands and REST API. However, before requesting to
> open source it, we would like to ask if there would be anyone
> interested in such plugin.
>
> To help understand functionality of admin tools, I have listed its
> functionality as below:

These are really cool, and I do think they would provide great value.
Thank you for your proposal to publish these! Perhaps it makes sense
to propose to split these into more focused and tightly scoped plugins,
or even to push some/all of these into core?

> SSH COMMANDS:
>
> NAME: check-project-visibility
> DESCRIPTION: Check project readability to a specific user. Allows any
> user to query if a specific user can read non-config references in the
> specific project.

Would this make sense as an extension to the existing ls-user-ref
command?

> NAME: flush-jgit-cache
> DESCRIPTION: Flush JGit repositories in-memory cache. Flush JGit
> repositories in-memory cache. The command will wait until cache is
> flushed before returning, it can take some time if the cache is big.

I would support this ability in core, or a jgit-admin specific plugin.

> NAME: reset-jgit-cache-counters
> DESCRIPTION: Reset JGit repositories in-memory cache usage counters.

I would support this ability in core, or a jgit-admin specific plugin.

> NAME: show-jgit-cache
> DESCRIPTION: Show JGit repositories in-memory cache. The command will
> display jgit cache information. It can take some time if the cache is
> big. .

I would support this ability in core, or a jgit-admin specific plugin.


> REST API:
> ...

Same basic comments for those above,

-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

Sven Selberg

unread,
Mar 29, 2022, 3:38:15 AM3/29/22
to Repo and Gerrit Discussion
+1 on Martins comments, I too don't see any good reason to not add all/most of this functionality to core.

Matthias Sohn

unread,
Mar 29, 2022, 5:18:09 AM3/29/22
to Sven Selberg, Repo and Gerrit Discussion
+1 



-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

--
--
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/f59c7856-42db-4d0d-bd7c-0c9364850b07n%40googlegroups.com.

Luca Milanesio

unread,
Mar 29, 2022, 5:21:12 AM3/29/22
to Repo and Gerrit Discussion, Luca Milanesio, Sven Selberg, Matthias Sohn
+1, though the JGit-related ones should be exposed by JGit as an API and then leveraged by Gerrit.

@ JouYoung are you happy to provide those new commands as contribution to Gerrit core in master?

Luca.




-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

--
--
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/f59c7856-42db-4d0d-bd7c-0c9364850b07n%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.

Matthias Sohn

unread,
Mar 29, 2022, 5:34:12 AM3/29/22
to Luca Milanesio, Repo and Gerrit Discussion, Sven Selberg
JGit exposes cache stats and allows to reset stats counters via the interface WindowCacheStats, see 
They are optionally exposed via JMX.

I am not sure what's the purpose of flushing JGit's WindowCache. It can be reconfigured at runtime by changing
config options supported by WindowCacheConfig and calling its install() method.

-Matthias

Han-Wen Nienhuys

unread,
Mar 29, 2022, 9:14:17 AM3/29/22
to JouYoung Suh, Repo and Gerrit Discussion
On Mon, Mar 28, 2022 at 8:17 PM JouYoung Suh <suh...@gmail.com> wrote:
> REQUEST
> GET /plugins/admin-tools/check-project-visibility?project=All-Projects&user=admin HTTP/1.0
>
> Allows admin user to query for a specific user can read non-config references in the specific project.

this already exists in core, see
https://gerrit-review.googlesource.com/Documentation/rest-api-projects.html#check-access


--
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.

JouYoung Suh

unread,
Mar 29, 2022, 2:28:24 PM3/29/22
to Repo and Gerrit Discussion
@MartinFick
Thank you for the input! Yes its functionality is broader since any any user who has configured an SSH key can use it. 
Also, we are currently planning to submit them individually to the core, and JGit-related ones to be exposed by JGit as an API as @Lucamilanesio advised. 

@lucamilanesio
Thank you for the advise! Yes, I will be happy to start working on providing these commands as a contribution to Gerrit core in Master.

@Matthias Sohn
Thank you for pointing out! I will exclude supporting flush-jgit-cache command. 

@Han-wen
Thank you again for pointing out! I will exclude supporting this endpoint
Reply all
Reply to author
Forward
0 new messages