Programmatically add commentlink section in project.config

149 views
Skip to first unread message

Inderjot Kaur Ratol

unread,
Dec 7, 2017, 12:42:25 PM12/7/17
to Repo and Gerrit Discussion
Hi All,

I need to write the commentlink section in project.config file from the code. I do not want to edit the project config file from UI or console each time I need to change the commentlink section. As far as I know, gerrit provides a way to add entries in project.config using `ProjectConfigEntry` exntension. My requirements does not allow me to put anoher field in the UI to get "commentlink" configuration for each project.

As per the existing code (based on my understanding), one can directly edit the project.config to add commentlink section and gerrit will respect those config settings over the global settings in gerrit.config. However, I failed to find how it can be done programmatically. Please point me to the right code if it already exists. If not, is it something that is under consideration for implementation currently or in future.

Thank you.

Inderjot Kaur Ratol

unread,
Jan 10, 2018, 4:07:57 PM1/10/18
to Repo and Gerrit Discussion

Hi All,

Does anyone have any idea about how to solve the above mentioned problem?

Thanks.

Marcelo Ávila de Oliveira

unread,
Jan 11, 2018, 5:48:12 AM1/11/18
to Inderjot Kaur Ratol, Repo and Gerrit Discussion
I'm not sure if I understood your question but... what about the following commands?

$ git clone https://USER@GERRIT-SERVER/a/REPO-PATH
$ git fetch refs/meta/config
$ git checkout FETCH_HEAD

CHANGE-ANY-WAY-YOU-LIKE-IT project.config

$ git add project.config
$ git commit
$ git push origin HEAD:refs/meta/config

--
Marcelo Ávila de Oliveira

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

Inderjot Kaur Ratol

unread,
Jan 11, 2018, 1:08:23 PM1/11/18
to Repo and Gerrit Discussion

Thank you Marcelo for your reply.

I apologize for not phrasing it clearly. My requirement is not to use command line or GUI to manually change the project.config. I am looking for already existing Gerrit API or functionality which allows me to write "commentlink" section in project.config.

For example:

I am able to write configuration related to any plugin using PluginConfig class and then attaching it to the ProjectConfig instance. But, I cannot find a similar way to write "commentlink" section.

So my question is if there exists a way already or is it something that will need to be implemented in order to achieve this functionality.

Thank you.

On Thursday, January 11, 2018 at 5:48:12 AM UTC-5, Marcelo Ávila de Oliveira wrote:
I'm not sure if I understood your question but... what about the following commands?

$ git clone https://USER@GERRIT-SERVER/a/REPO-PATH
$ git fetch refs/meta/config
$ git checkout FETCH_HEAD

CHANGE-ANY-WAY-YOU-LIKE-IT project.config

$ git add project.config
$ git commit
$ git push origin HEAD:refs/meta/config

--
Marcelo Ávila de Oliveira

2018-01-10 19:07 GMT-02:00 Inderjot Kaur Ratol <inderjo...@gmail.com>:

Hi All,

Does anyone have any idea about how to solve the above mentioned problem?

Thanks.

On Thursday, December 7, 2017 at 12:42:25 PM UTC-5, Inderjot Kaur Ratol wrote:
Hi All,

I need to write the commentlink section in project.config file from the code. I do not want to edit the project config file from UI or console each time I need to change the commentlink section. As far as I know, gerrit provides a way to add entries in project.config using `ProjectConfigEntry` exntension. My requirements does not allow me to put anoher field in the UI to get "commentlink" configuration for each project.

As per the existing code (based on my understanding), one can directly edit the project.config to add commentlink section and gerrit will respect those config settings over the global settings in gerrit.config. However, I failed to find how it can be done programmatically. Please point me to the right code if it already exists. If not, is it something that is under consideration for implementation currently or in future.

Thank you.

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

Julian Di Leonardo

unread,
Jan 15, 2018, 2:07:01 PM1/15/18
to Repo and Gerrit Discussion
Reply all
Reply to author
Forward
0 new messages