user feedback in MergeValidationListener

28 views
Skip to first unread message

Steffen

unread,
Jun 24, 2015, 9:06:42 AM6/24/15
to repo-d...@googlegroups.com
Hello,

based on the cookbook MergeUserValiadtor sample I write a plugin which connects Gerrit to a problem tracking system. The plugin throws a MergeValidationException exception if no work item is specified as topic or the work item in the problem tracking system is in a wrong state. 
What I'm missing is a way to give the user an indication why the operation failed so the user can fix this.
Is there a way to add a comment to the change from the MergeValidationListener?

regards Steffen

Alex Blewitt

unread,
Jun 24, 2015, 9:28:36 AM6/24/15
to Steffen, repo-d...@googlegroups.com
Instead of failing at the merge step, why not add a label saying "OK" for pieces where the state is correct? Then have a system monitor for changes and add/remove the label as appropriate.

Then they won't be able to submit if the label is missing, and you'll have a break glass mechanism of adding the label manually (by a suitably empowered admin) if you need to push something through in emergencies. 

Oh and if the remote tracking system falls over or suffers from poor load/design then at least it won't hose your repository and have users blaming that instead :-)

Alex

Sent from my iPhat 6
--
--
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.

Steffen

unread,
Jun 24, 2015, 9:43:22 AM6/24/15
to repo-d...@googlegroups.com, skr...@de.ibm.com
If possible I would not use a polling approach. I assume I will have 100+ reviews open in parallel. Asking every minute for all open reviews "what is the work item state" seams not the best idea to me.  Steffen

Edwin Kempin

unread,
Jun 24, 2015, 9:44:22 AM6/24/15
to Steffen, Repo and Gerrit Discussion
2015-06-24 15:43 GMT+02:00 Steffen <skr...@de.ibm.com>:
If possible I would not use a polling approach. I assume I will have 100+ reviews open in parallel. Asking every minute for all open reviews "what is the work item state" seams not the best idea to me.  Steffen
You don't need to poll, but you can just listen and react to the Gerrit stream-events.

Alex Blewitt

unread,
Jun 24, 2015, 1:47:49 PM6/24/15
to Edwin Kempin, Steffen, Repo and Gerrit Discussion

On 24 Jun 2015, at 14:44, Edwin Kempin <edwin....@gmail.com> wrote:



2015-06-24 15:43 GMT+02:00 Steffen <skr...@de.ibm.com>:
If possible I would not use a polling approach. I assume I will have 100+ reviews open in parallel. Asking every minute for all open reviews "what is the work item state" seams not the best idea to me.  Steffen
You don't need to poll, but you can just listen and react to the Gerrit stream-events.

Exactly. You get notified when the change is created and updated and can react accordingly. You can also periodically check for the state of tickets for open changes in case there has been variation in the states. 

Alex 
Reply all
Reply to author
Forward
0 new messages