Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 422707

Summary: All Git commands are missing
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: GitAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.0   
Target Milestone: 5.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2013-11-27 15:24:47 EST
The basic problem is this:
1. Log out of Orion
2. Load /git/plugins/gitPlugin.html
3. You are redirected to the login page.

This is pretty bad for the new user workflow. For example I just tried this:
1. Open Incognito/Private mode browser, go to Orion
2. Create a new user account and log in
3. All Git commands are missing from the menus.

I think this happens because the gitPlugin indirectly depends on some 'i18n!' module. That causes the bootstrap code to be pulled in, which pulls in authenticationPlugin and causes a redirect.

The redirect seems to happen before gitPlugin registers any services (sometimes -- it may be a race condition). This causes gitPlugin to get "services:[]" cached in its plugin data. When you finally do log in, the cached data is used, and no Git features are shown.

You're stuck in this state until you reload the plugin data manually (and you must be logged in while you do this, or you'll be back at Step 1.)
Comment 1 Mark Macdonald CLA 2013-11-27 15:28:16 EST
Here's the dependency chain that causes the problem

git/plugins/gitPlugin.js  ->  orion/git/util.js  ->  'i18n!git/nls/gitmessages'

The message bundle is never even used inside util.js so it should be fine to remove the dependency.
Comment 2 Mark Macdonald CLA 2013-11-27 17:17:18 EST
(In reply to Mark Macdonald from comment #1)
> The message bundle is never even used inside util.js so it should be fine to
> remove the dependency.

This was not enough to fix the problem, so I moved the UI-dependent code -- which was only 1 method, createCompareWidget() -- into a separate class 'uiUtil.js' which inherits from util.js.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=4e71a28

util.js is now safe for non-UI code (like plugins) to depend on.