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

Bug 473952

Summary: Cannot save Git author on repo page
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: GitAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: gheorghe, Silenio_Quarti
Version: 10.0   
Target Milestone: 10.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2015-07-30 12:51:44 EDT
0. Open the Chrome Network log
1. Go to Git repository page
2. In the right-hand pane, type a commit message, then click "more..."
3. Change the Author Name to something else, and check the "Save" box.
4. Now click "Commit"
5. The commit works, but a 400 error occurs while trying to save the author info, so the info is not persisted. Also the UI does not refresh.

Request:
> PUT https://orion.eclipse.org/gitapi/config/user.name/clone/file/mamacdon-OrionContent/org.eclipse.orion.client/
> 
> { "Value": "My New Author Name" }
> 

Response:
> {"Severity":"Error",
>  "Message":"Config entry value must be provided",
> "HttpCode":400,
> "BundleId":"org.eclipse.orion.server.core",
> "Code":0}

The server expects Value to be an array. It is unclear whether this is an API change (in which case the client and the docs [1] are both outdated) or just a bug in the server.


[1] https://wiki.eclipse.org/Orion/Server_API/Git_API#Updating_repository_option
Comment 1 Silenio Quarti CLA 2015-08-25 17:46:02 EDT
The API was changed to optionally support multiple values for a given key, but it should still work for single values.

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit?id=1b4199269503e2f04ce52fd8837a59562546f9e2
Comment 2 Mark Macdonald CLA 2015-08-25 17:55:54 EDT
One comment: optString() never returns null, it returns the empty string if the key doesn't exist. So the null check should be checking for the empty string instead.
Comment 3 Silenio Quarti CLA 2015-08-25 18:07:41 EDT
(In reply to Mark Macdonald from comment #2)
> One comment: optString() never returns null, it returns the empty string if
> the key doesn't exist. So the null check should be checking for the empty
> string instead.

Added the check for empty string. Thanks!

http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=5e411f749c2916d1fbe6d075f53e9b669f3f73f5