Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 389083 - Repository page URI template for cloning no longer working (again)
Summary: Repository page URI template for cloning no longer working (again)
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Git (show other bugs)
Version: 0.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.0 M2   Edit
Assignee: Maciej Bendkowski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 382604 (view as bug list)
Depends on: 387398
Blocks:
  Show dependency tree
 
Reported: 2012-09-07 14:27 EDT by Susan McCourt CLA
Modified: 2012-09-26 12:23 EDT (History)
7 users (show)

See Also:
susan: review+
susan: review? (malgorzata.tomczyk)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2012-09-07 14:27:38 EDT
+++ This bug was initially created as a clone of Bug #387398 +++

If you chose either the getting started button on the Navigator page or the greasemonkey script for cloning from Github, the page opens but no input area for the URL is displayed.

I tested the original bug on the 9/5 build and it was working.
In the 9/7 build this has stopped working again.
It seems like the behavior is getting broken/unbroken as the load sequence of the page changes.  

For example:
Load this URL:
http://orion.eclipse.org:8080/git/git-repository.html#,cloneGitRepository=foo
No slideout.
Now change the last part of the URL
http://orion.eclipse.org:8080/git/git-repository.html#,cloneGitRepository=bar

You'll see the slideout, but then you get a progress message, the page starts to reload, and the slideout disappears.

So there are multiple issues here:
1) why reload the page at all if only a UI parameter changed?  No need to fetch everything again if we didn't update the resource part of the hash 
2) if we do need to reload the page, we need to process the UI parameters after we have flushed and repopulated all the commands.
Comment 1 Susan McCourt CLA 2012-09-07 14:31:51 EDT
Hoping that Maciej can look at this first, or at least look at issue 1) so that we aren't repopulating the page when the resource did not change.

If that doesn't clear up the problem, I can help investigate.

What I believe is happening is that:

- the URL is processed for the slideout (processURL)
- then the resource is parsed and page loaded
- commands are rerendered (which will close open slideouts)

The process URL should happen once the other state is established, and there shouldn't be any need to reload the page if only the UI parameters changed.

ie...changing the resource part of the URL should reload the page, such as changing from A to B like this:
http://orion.eclipse.org:8080/git/git-repository.html#A,cloneGitRepository=C
to:
http://orion.eclipse.org:8080/git/git-repository.html#B,cloneGitRepository=C

but there shouldn't be a need to reload the page when changing from C to D (and keeping A) like this:
http://orion.eclipse.org:8080/git/git-repository.html#A,cloneGitRepository=C
to:
http://orion.eclipse.org:8080/git/git-repository.html#A,cloneGitRepository=D
Comment 2 Maciej Bendkowski CLA 2012-09-10 10:21:32 EDT
(In reply to comment #1)
> Hoping that Maciej can look at this first, or at least look at issue 1) so
> that we aren't repopulating the page when the resource did not change.

I've applied your suggestions and came up with a fix: https://github.com/maciej-bendkowski/orion.client/commit/0cb221def6e7f78817a3a835176d2bff99b14272

> What I believe is happening is that:
> 
> - the URL is processed for the slideout (processURL)
> - then the resource is parsed and page loaded
> - commands are rerendered (which will close open slideouts)

I also share those believes and it seems they are true. I added a processURL after the loading deferred is resolved and the slideout did not disappear - as we wanted. To make it finally disappear while switching resources I had to close all parameter collectors on the hash change event. One more thing - I changed the hash change event so it will redisplay resources only when necessary.

Sorry I didn't used the requestReview feature - the orion.eclipse.org build has a bug in the gitCredentialsDialog so I'm unable to provide any credentials at the moment. Simon already pushed a fix.
Comment 3 Susan McCourt CLA 2012-09-11 11:33:47 EDT
(In reply to comment #2)
> Sorry I didn't used the requestReview feature - the orion.eclipse.org build
> has a bug in the gitCredentialsDialog so I'm unable to provide any
> credentials at the moment. Simon already pushed a fix.

Hi, Maciej, I wasn't sure from this comment if you were asking me to review this fix?
Comment 4 Maciej Bendkowski CLA 2012-09-12 04:36:40 EDT
(In reply to comment #3)
> Hi, Maciej, I wasn't sure from this comment if you were asking me to review
> this fix?

Sorry I confused you. Yes, I wanted you to review this fix, but fortunately you did not :) Instead I have a better one where I additionally fixed the persistent slideout after a successful clone operation. Please, review the following fix:

Fix: https://orion.eclipse.org/git/reviewRequest.html#git@github.com:maciej-bendkowski/orion.client.git_6a6cbe8054541deb6bc41fc7adfccccb630a7e49
Comment 5 Maciej Bendkowski CLA 2012-09-12 04:48:01 EDT
*** Bug 382604 has been marked as a duplicate of this bug. ***
Comment 6 Susan McCourt CLA 2012-09-20 14:25:25 EDT
Maciej, my apologies for waiting so long on this bug.
The slideout links seem to be working (again) on I20120919-2230, but I confirmed that we still have the other issues (unnecessary reloads, etc.) so it's definitely worth getting this fix in.

I applied the fix and tested it.  The fix behaves great.
So I "+" the review, but I didn't feel comfortable committing the fix as is without someone closer to the code reviewing it.  Adding Gosia for review.

The code generally looks good, but in gitRepositoryExplorer, I just wasn't sure if
"displayRepository2" was a good approach vs. changing the function in general and making sure the callers are doing the right thing.  I think there should minimally be some comments explaining the difference between displayRepository and displayRepository2 and when to use....but Gosia would know better what is expected...
Comment 7 Maciej Bendkowski CLA 2012-09-25 10:37:18 EDT
Since Susan pushed this commit to master few days ago, I close the bug.
Comment 8 Maciej Bendkowski CLA 2012-09-25 10:41:23 EDT
Changed closed to resolved. Sorry for the mistake.
Comment 9 Susan McCourt CLA 2012-09-25 16:34:52 EDT
(In reply to comment #8)
> Changed closed to resolved. Sorry for the mistake.

I did not push this fix, I wasn't comfortable doing so. I added Gosia as an additional reviewer in comment 6.  Please see last paragraph of comment 6.
Comment 10 Maciej Bendkowski CLA 2012-09-26 03:49:10 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > Changed closed to resolved. Sorry for the mistake.
> 
> I did not push this fix, I wasn't comfortable doing so. I added Gosia as an
> additional reviewer in comment 6.  Please see last paragraph of comment 6.

I'm sorry. I thought the following commit was in master...
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=8e98231dff6e737585f7043c66bd22ea3a53f86e

Could you please confirm? Perhaps I'm somehow mistaken.
Comment 11 Susan McCourt CLA 2012-09-26 12:17:46 EDT
(In reply to comment #10)

> Could you please confirm? Perhaps I'm somehow mistaken.

Sorry, Maciej, seems that I'm the one who is mistaken!  Sorry for the confusion.  I had quite a time with the "ask for review" link during this process (see bug 390043) and I was debating on whether to push the fix or have Gosia look at it.  I'm guessing that I forgot I had cherry picked your commit into master and inadvertantly pushed it along with some other change I did afterward.

At any rate, it's released now, I'll mark fixed, but I do think that displayRepository2 could use some better comments/explanation
Comment 12 Malgorzata Janczarska CLA 2012-09-26 12:23:43 EDT
Susan. I'll look at it and correct it if necessary, even though it's in the repo now.