Re: Need help to build a plugin for gerrit

29 views
Skip to first unread message
Message has been deleted

Zaro

unread,
Jun 13, 2016, 3:12:14 PM6/13/16
to repo-d...@googlegroups.com
> If the reviewer does a code-review vote of +1 on all the commits(except 'cset/evo-cset...'), the code-review vote 
> for 'cset/evo-cset...' should be changed to +1 by the plugin. First, I just need a basic working plugin which reads and prints 
> code-review votes of all the commits(whether it is +2, +1, 0, -1 or -2). Then, I can try building my plugin further.

To answer your question the existing labelui plugin[1] can give you an idea how to get access to vote info from a plugin.  However I would probably advise you to think whether what your doing is a good idea.  Your use case doesn't really make sense to me since you are inferring that a Code-Review+1 vote on a parent change should automatically set Code-Review+1 vote on a child change.  A parent change may be ok but a child change could be completely wrong so you should really vote on them independently.


     
On Mon, Jun 13, 2016 at 11:43 AM, Sharath Gupta <sharath...@gmail.com> wrote:
Hi Zaro, replies inline.

On Mon, Jun 13, 2016 at 11:25 AM, Zaro <zaro...@gmail.com> wrote:
> I have a requirement that whenever reviewers do a +1 on the commits, "csets/evo-csets master :test_change_set_2" should automatically change to +1. Please let me know if there are any APIs that helps me build this. Any code snippets or any kind of helps are appreciated. As I am new to it, I don't know from where to start or how to start.

Your questions is unclear.   In this case it looks like you have 3 changes (commits), which change are you referring to when you say 'reviewer do a +1 on the commits'?  Any of them or just 'cset/evo-cset...'?  Also what do you mean by 'automatically change to +1'?  Are you referring to the Code-Review vote?

If the reviewer does a code-review vote of +1 on all the commits(except 'cset/evo-cset...'), the code-review vote for 'cset/evo-cset...' should be changed to +1 by the plugin. First, I just need a basic working plugin which reads and prints code-review votes of all the commits(whether it is +2, +1, 0, -1 or -2). Then, I can try building my plugin further.

Thanks
Sharath  
 
 

On Mon, Jun 13, 2016 at 11:13 AM, Sharath Gupta <sharath...@gmail.com> wrote:
Hi Folks

I am a newbie for gerrit and it's plugin development. I have given a project to develop plugin for gerrit in JAVA. The requirements are as follows:

I have a sandbox with a repository in it. I can make several "git commit"s on it. When I do a "sb upload" on that repository, a "changeset" commit is created and uploaded to gerrit for review. (So, now you have several commits that you have done and a changeset commit associated to it).

Example snapshot : 

 

In this screenshot, "jim:master commit Makefile" and "jim:master commit export.mk" were commits that were created by me(this was created when git commit -am "<message>" was run. "csets/evo-csets master :test_change_set_2" was created automatically when ""sb upload" command was executed.

I have a requirement that whenever reviewers do a +1 on the commits, "csets/evo-csets master :test_change_set_2" should automatically change to +1. Please let me know if there are any APIs that helps me build this. Any code snippets or any kind of helps are appreciated. As I am new to it, I don't know from where to start or how to start.

I have the gerrit environment setup.

Thanks in advance.
Sharath

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




--
-Sharath P S
Believe you can and you're halfway there.

Reply all
Reply to author
Forward
0 new messages