Issue 1237: comment-added hook does not get triggered for merge/cherry-picked comments
Status:  Submitted
Owner: ----
Closed:  Oct 2012
Reported by pravinse...@gmail.com, Jan 20, 2012
Affected Version: 2.2.1

Steps to reproduce:
1. Configure a project to cherry-pick or merge changes.
2. Submit a change
3. Comment 'Change has been successfully cherry-picked as *******' gets added on the UI and stored in the database.
4. This comment does not get published by either stream-events or the comment-added hook.

Please refer to http://groups.google.com/group/repo-discuss/browse_frm/thread/7eef1acac30c3721/66f1a4886b42f47f?lnk=gst&q=comment-added#66f1a4886b42f47f for further information.
Jan 20, 2012
#1 pravinse...@gmail.com
I have created a fix for this issue and would upload it for review.

Thanks
Jan 20, 2012
#2 wfi...@myyearbook.com
+1 for this.  Currently, I'm checking for a merge, getting the change-id, then querying the database for that comment.  It's not an elegant solution, and this would be nice to have.
Jan 20, 2012
Project Member #3 bklarson@gmail.com
Please upload your fix to gerrit-review.googlesource.com and post the link here, and we'll take a look.
Jan 23, 2012
#4 jhans...@myyearbook.com
Note that comment-2's solution no longer works in 2.2.2, because the cherry-pick comment does not even show the commit hash anymore.  What used to be commented as "Change has been successfully cherry-picked as ********" is now just "Change has been successfully cherry-picked."  The sha1 of the new ref is not being commented anymore.

The ref-updated hook can give you the newRef, which is the new cherry-picked sha1 hash, but then you don't know how to tie that back to a gerrit Change-ID.  Which means the only way to get the new cherry-picked hash is to listen for ref-updated, and then immediately after that, expect a change-merged event.  Those two events are *probably* related, but there's no way to guarantee that.
Mar 9, 2012
#5 jhans...@myyearbook.com
It appears this was fixed in 2.2.2.1.
Apr 16, 2012
#6 derek...@gmail.com
Any update on this issue?

I can see that the stream-events record the change-merged events but we are also looking for a way to process merge failed events.  There is a comment added if a merge fails:
"Your change could not be merged due to a path conflict.

Please merge (or rebase) the change locally and upload the resolution for review."

This merge fail event doesn't get sent in the stream-events or processed with the comment-added hook.
Oct 17, 2012
Project Member #7 edwin.ke...@gmail.com
(No comment was entered for this change.)
Status: Submitted
Labels: FixedIn-2.6