Accessing configuration as Gerrit Web UI Plugin

74 views
Skip to first unread message

Rok Lenarcic

unread,
Mar 21, 2024, 11:17:36 AM3/21/24
to Repo and Gerrit Discussion
Hello. I have been following this document, to integrate another code checker into gerrit.
https://gerrit-documentation.storage.googleapis.com/Documentation/3.7.6/pg-plugin-dev.html#loading 

However looking at the Typescript interface at "@gerritcodereview/typescript-api/gerrit", there seems to be no way for me to load any sort of plugin configuration. In particular I would need the plugin user to configure the location and authentication for the codechecker server. How can I achieve this, how do I access configuration from a frontend plugin.

I've looked at some of sample plugin and I've noted that they use many REST API endpoints that are not documented anywhere in REST API documentation for the server. For example buildbucket plugin has this code:

this.plugin.restApi().get(`/changes/${changeId}/jwts`)

and 

.get(`/projects/${encodeURIComponent(repo)}/${pluginName}~config`);

Neither of these endpoints are listed here: https://gerrit-review.googlesource.com/Documentation/rest-api.html

I'd like to somehow load plugin configuration from etc/gerrit.config or etc/{plugin}.config.

Thank you.

Martin Fick

unread,
Mar 21, 2024, 11:31:43 AM3/21/24
to Rok Lenarcic, Repo and Gerrit Discussion
I'd like to somehow load plugin configuration from etc/gerrit.config or etc/{plugin}.config

You would need to expose that info from your plugin via it's own RestAPI,

-Martin 

Nasser Grainawi

unread,
Mar 21, 2024, 12:24:46 PM3/21/24
to Martin Fick, Rok Lenarcic, Repo and Gerrit Discussion
On Thu, Mar 21, 2024 at 9:31 AM Martin Fick <mogul...@gmail.com> wrote:
I'd like to somehow load plugin configuration from etc/gerrit.config or etc/{plugin}.config

You would need to expose that info from your plugin via it's own RestAPI,

For more info on that, see the sections in https://gerrit-review.googlesource.com/Documentation/dev-plugins.html that mention "REST API".
 

-Martin 

--
--
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/CAEUc7cgkKDQLFvP9%2BHbeq7LpfmLYY0h6Or2%2BJ7PN8WPG4nK4Vw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages