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

Bug 355549

Summary: [client] Merge failure not being shown to user
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: GitAssignee: Tomasz Zarna <tomasz.zarna>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Szymon.Brandys
Version: unspecified   
Target Milestone: 0.3 M2   
Hardware: All   
OS: All   
Whiteboard:

Description John Arthorne CLA 2011-08-23 14:03:26 EDT
I have a failure merging from remote master, but the Orion git UI is not telling me. I select "Merge" in the Git Status view, and then some redraws occur but the merge did not happen. When I inspect the reponse in the browser console I see:

POST http://localhost:8080/gitapi/commit/HEAD/file/e/

{"Result": "FAILED"}

The failure doesn't seem to be propagating back to the client at all...
Comment 1 John Arthorne CLA 2011-08-23 14:05:25 EDT
I was able to merge the change on the command line without conflicts, so I have no idea what the problem was...
Comment 2 John Arthorne CLA 2011-09-02 11:38:01 EDT
I had a very similar problem again today. I attempted merge from Git Status page and nothing happens. Luckily I was running a local server so I debugged the server side and found the root cause:

org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of merge command. org.eclipse.jgit.errors.CheckoutConflictException: Checkout conflict with files: 
bundles/org.eclipse.orion.client.core/web-ide.conf

So, the main problem here seems to be that the error message isn't propagating back to the client UI. Here is the JSON that comes back to the client:

Code: 0
DetailedMessage: "Checkout conflict with files: ↵bundles/org.eclipse.orion.client.core/web-ide.conf"
HttpCode: 500
Message: "An error occured when merging."
Severity: "Error"

Maybe the server should take the exception message straight from JGit, rather than inserting the generic "An error occurred when merging". It's not really an error that occurred during merging, but instead the client isn't allowed to perform a merge because of the current resource state. Also this shouldn't be a 500 error since it is not an internal server problem. I think 409 CONFLICT is the closest match for this.
Comment 3 John Arthorne CLA 2011-09-02 11:38:30 EDT
Marking major, because without access to the server the user doesn't know how to proceed.
Comment 4 Tomasz Zarna CLA 2011-09-02 11:51:07 EDT
I will look at the server side next week.
Comment 5 Tomasz Zarna CLA 2011-09-07 10:18:05 EDT
Fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=345faa8f01ae86752edb8d38e350677997442bc5 and http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=f6da91d3c5cd743d4735ad4f2f38256dc567af56, but logged bug 356943 to remove the ugly workaround for bug 356918.

I'm aware that the UI part can be done better, so if you don't like feel free to open a new bug for that part.