Bug 444616 - cannot retrieve patch set content when review contains draft patch sets
Summary: cannot retrieve patch set content when review contains draft patch sets
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P2 major (vote)
Target Milestone: 2.5   Edit
Assignee: Nicholas Folk CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2014-09-19 13:09 EDT by Marc-André Laperle CLA
Modified: 2014-11-26 18:37 EST (History)
3 users (show)

See Also:


Attachments
mylyn/context/zip (1.55 KB, application/octet-stream)
2014-11-10 12:32 EST, Sam Davis CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2014-09-19 13:09:27 EDT
Mylyn Reviews Connector: Gerrit 2.4.0.v20140903-1455

1. Open the review at https://git.eclipse.org/r/#/c/33476/
2. In the review editor, scroll to Patch set 7 and expand: No content is retrieved.

Tested on both Windows 8.1 and Ubuntu 14.04.
Comment 1 Marc-André Laperle CLA 2014-09-25 11:26:38 EDT
This review has the same problem:
https://git.eclipse.org/r/#/c/32350
Comment 2 Sam Davis CLA 2014-10-15 17:25:05 EDT
I can reproduce. I wonder if it has something to do with the fact that neither of those reviews has a patch set 1. Marc-Andre, do you know why those reviews start numbering their patch sets at numbers other than 1? Have earlier patch sets somehow been removed or was patch set 4 the initial push to https://git.eclipse.org/r/#/c/33476/ ?
Comment 3 Miles Parker CLA 2014-10-15 17:35:30 EDT
Yeah, maybe we're assuming somewhere that patch sets can never be non-consecutive. I know that it frankly never occurred to me that that might not be the case. 

It looks like the contents of patch set 4 are actually from patch set 7, which would match that theory. Same thing with 32350 -- it goes to 11, which is exactly how many patches there are.
Comment 4 Marc-André Laperle CLA 2014-10-15 17:37:48 EDT
Interesting! Those patch sets were drafts so that should be a big clue.
Comment 5 Miles Parker CLA 2014-10-15 17:44:04 EDT
So, my guess is that it is in PatchSetContentRemoteFactory or in the ui association in ReviewSetContentSection, since the other metadata like commit # is correct. But I can't see anything obviously wrong at an initial glance.
Comment 6 Sam Davis CLA 2014-10-15 19:21:44 EDT
(In reply to comment #3) 
> It looks like the contents of patch set 4 are actually from patch set 7, which
> would match that theory. Same thing with 32350 -- it goes to 11, which is
> exactly how many patches there are.

This appears to be correct. Good find!

Marc-Andre, which patch sets were drafts?
Comment 7 Sam Davis CLA 2014-10-15 19:25:11 EDT
I guess the first few patch sets were drafts and those are hidden from users who don't have permission.
Comment 8 Marc-André Laperle CLA 2014-10-15 21:57:57 EDT
(In reply to Sam Davis from comment #6)
> (In reply to comment #3) 
> > It looks like the contents of patch set 4 are actually from patch set 7, which
> > would match that theory. Same thing with 32350 -- it goes to 11, which is
> > exactly how many patches there are.
> 
> This appears to be correct. Good find!
> 
> Marc-Andre, which patch sets were drafts?

I added you to the review (33476) and Miles as well. Patch 1, 2, 3 are drafts.
Comment 9 Sam Davis CLA 2014-10-16 16:12:29 EDT
I still can't see those patch sets, but being able to see them might make this harder to investigate.
Comment 10 Sam Davis CLA 2014-11-10 12:32:17 EST
Created attachment 248550 [details]
mylyn/context/zip
Comment 11 Sam Davis CLA 2014-11-18 12:44:36 EST
The problem is that we're using the patch set number to index an array which contains only the non-draft patch sets. This will be fixed by https://git.eclipse.org/r/#/c/36532/
Comment 12 Sam Davis CLA 2014-11-26 18:37:18 EST
Thanks very much for the contribution, Nicholas!