CandyShop / gerrit

Automatically exported from code.google.com/p/gerrit
Apache License 2.0
1 stars 0 forks source link

Gerrit Merge Order issue #3456

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version: Gerrit 2.10

What steps will reproduce the problem?
1. Change 338 is sent for code-review of same file
2. Change 339 is sent for code-review of same file
3. Change 338 got +2 code review value
4. Change 339 got +2 code review value
5. Reviewer clicked on "submit" for change 339
   change is not merged.... since 338 is not yet merged
6. Now, reviewer clicked on "submit" for change 338
   Both the changes are merged automatically.

But the issue is, Gerrit is merging the changes order in a strange way. First 
389 is merged and then 338 got merged.

What is the expected output? What do you see instead?
338 should be merged first, not the 339. Please fix this.

Please provide any additional information below.
I am using Gerrit 2.10

Original issue reported on code.google.com by arunjobe...@gmail.com on 25 Jun 2015 at 11:03

Attachments:

GoogleCodeExporter commented 9 years ago
 > But the issue is, Gerrit is merging the changes order in a strange way. First 389 
 > is merged and then 338 got merged.

I doubt that Gerrit did this merge in the wrong order. Have you checked the 
commit graph of your repository?

Original comment by edwin.ke...@gmail.com on 26 Jun 2015 at 5:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You are correct. When I checked the commit graph, It is in the correct order.

But I dont know why the page "http://ip_address:8080/#/q/status:merged" (please 
see the screen shot attached) is showing the merge order in the wrong order. 

Whenever "submit" button is clicked on gerrit code-review screen, I am calling 
the hook "change-merged" and in the hook I am using the below command to read 
all the list of changes got merged. 

GET http://ip_address:8080/changes/?q=status:merged

So, here this page status:merged is getting updated in the wrong order thats 
why my list is also in the wrong when I am reading them.  How can I read the 
commits which got merged in the correct order.

Original comment by arunjobe...@gmail.com on 26 Jun 2015 at 1:47

GoogleCodeExporter commented 9 years ago
 > But I dont know why the page "http://ip_address:8080/#/q/status:merged (please 
 > see the screen shot attached) is showing the merge order in the wrong order. 
Query results like this are always sorted by last-updated timestamp and not by 
merge order. It is not possible to choose a different sorting.

 > How can I read the commits which got merged in the correct order.
Use git to fetch the branch and inspect the branch history.

Original comment by edwin.ke...@gmail.com on 26 Jun 2015 at 1:54

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
> How can I read the commits which got merged in the correct order.
Use git to fetch the branch and inspect the branch history.

I am not sure if I can use git fetch or not. Because, multiple commits come 
from multiple projects(repositories). For all the projects we are using this 
Gerrit code review process. All of them must go through code review process. If 
that is the case, each change could be from different every other.

No matter what projects I get, I am trying to populate the list and trying to 
connect them with a ticketing system.

I am still confused :(

Original comment by arunjobe...@gmail.com on 26 Jun 2015 at 2:07

GoogleCodeExporter commented 9 years ago
Then you should maybe listen to the Gerrit stream-events [1]. This will give 
you the merged events in the right order.

[1] https://gerrit-review.googlesource.com/Documentation/cmd-stream-events.html

Original comment by edwin.ke...@gmail.com on 26 Jun 2015 at 2:14

GoogleCodeExporter commented 9 years ago
Thank you for the link. I think stream events are using ssh, but in my case 
both git and gerrit are on the same linux box. I am wondering that, I can not 
ssh to the same box.

Original comment by arunjobe...@gmail.com on 26 Jun 2015 at 2:17

GoogleCodeExporter commented 9 years ago
You should be able to connect via SSH to Gerrit from the same machine. Pay 
attention that Gerrit's SSH daemon by default listens on port 29418. Have a 
look at [1].

[1] https://gerrit-review.googlesource.com/Documentation/user-upload.html#ssh

Original comment by edwin.ke...@gmail.com on 26 Jun 2015 at 2:25

GoogleCodeExporter commented 9 years ago
As the documentation says... I have generated the ssh keys from the box (where 
actually Gerrit and Git both are residing in the same box) and pasted the keys 
in Gerrit web interface.

This is like doing the ssh to the same box

and also "change-merged" hook file is obviously on the same box...

however, i tried as the document says to see my luck.. but this is what i am 
getting .. below is the error:

[gerrituser@gerritbox01 .ssh]$ ssh -p 29418 gerrituser@gerritbox01
Warning: the RSA host key for '[gerritbox01]:29418' differs from the key for 
the IP address '[##.##.##.##]:29418'
Offending key for IP in /home/gerrituser/.ssh/known_hosts:1
Matching host key in /home/gerrituser/.ssh/known_hosts:2
Are you sure you want to continue connecting (yes/no)? yes
Permission denied (publickey).
[gerrituser@gerritbox01 .ssh]$

Original comment by arunjobe...@gmail.com on 26 Jun 2015 at 2:55

GoogleCodeExporter commented 9 years ago
Also for your information, we are not using ssh to clone/push. we are using http

git clone http://username@##.##.##.##:8080/repository_name

Original comment by arunjobe...@gmail.com on 26 Jun 2015 at 3:52