| Summary: | Id should not have trailing slash in git api | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> |
| Component: | Git | Assignee: | Tomasz Zarna <tomasz.zarna> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | minor | ||
| Priority: | P4 | CC: | johnjbarton, Szymon.Brandys |
| Version: | 0.4 | ||
| Target Milestone: | 0.5 M1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
John Arthorne
In case you need to know, the slash is also in the response, not just in the documentation. Git elements' locations contain .../file/[path] part which is derived from file locations in Orion workspace. Git locations may point at the root of a repo like http://localhost:8080/gitapi/remote/file/u/, but also at files inside e.g. http://localhost:8080/gitapi/remote/file/u/myFolder or http://localhost:8080/gitapi/remote/file/u/myFolder/myFile.txt. When you use such Git location, you could for instance get a log narrowed to folder or file. So there is a hierarchy and GET on http://localhost:8080/gitapi/remote/file/u/ could also return children that contain Git locations narrowed to this particular child. Tomek, what do you think? So you have some responses where the id is something like "a/b/c" ? What does the id mean in that case... is it used for something on the client? Perhaps the solution is a new property "projectId" that will be character identical to the value of one of the project ids. In my case I need to find the project that matches the repo. (In reply to comment #4) > In my case I need to find the project that matches the repo. You may clone/init a repo in a subfolder, then its 'Id' would be something like 'projectId/subFolder'. So clone 'Id' can't be directly mapped to top-level folder 'Id'. BTW in comment 2 I confused clone 'Id' with 'Location. As I said the trailing slash in 'Location' is justified, but I'm not sure about clone 'Id'. (In reply to comment #3) > So you have some responses where the id is something like "a/b/c" ? What does > the id mean in that case... An id like that would mean that a clone has been created in the "c" folder. However, if this is part of a Location, and the clone has been created in the "a" folder calling Git Log for "a/b/c" will return a list of commits for the "c" file only. In other words, you have to remember about two things: * clones don't have to be located in top level folders (Szymon already mentioned that in comment 5) * some git ops accept full path in the Location to narrow their scope ie. Log, Status, Diff, ... Rewinding the discussion to comment 0, I do agree the trailing slash on the Id element looks bad. Is it something we would like to have fixed for .4? Why don't remove 'Id' from the clone JSON? I can't find any Orion Git API that uses it. All methods uses clone 'Location' what is the right thing. JJ, if you want to find a workspace location for a clone, you could use clone 'ContentLocation' instead of mapping clone and project Ids. The property has been removed in 56d328dbc35ca4eda2b7e7c0d74e3efd474fc484. No side effects noticed in the UI so far. |