Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Is there a way to find out the location of an SCM artifact when only having the UUID available?

Is there a way to find out the location of an SCM artefact (e.g. a file, baseline, snapshot etc.) when only having the UUID available e.g. when a link to a file is not valid anymore because it has been moved to a different project-area? An idea could be to implement a search which supports UUIDs as a search parameter…

0 votes

Comments

 Hi Philipp,


Could you please give us more details about how do you move the file, baseline from one project area to another ?

Whats your expectation from the above use case ?

Using the search option in RTC ecplise client >> Jazz Source Control

You can search using components,snapshots,changsets,repository workspace and lock etc..

Regards,
Arun.

Hi Arun,

imagine you have a link (URL) to a certain file inside SCM (e.g. provided in a work-item) and this has been moved (using a script) to a different project-area(PA), so it is not available anymore in the original PA. So from the link itself you do not get the name of the file and also not the name of the component/stream etc. you just have the UUID and some other cryptic strings which does not tell you at all what file it is and where it was located. So supposing the UUID did not change after the file has been moved to the new PA, how can I find out which file it is and where to find it in the new PA?

Thanks and regards,
Philipp

Hi all,
to get a better understanding of this: generally speaking, how do I find an artefact inside the system when I am only having the UUID available. One other use-case could be that a UUID of a snapshot is stamped into a hex-file (binary which is going to be flashed onto an ECU) for later reproducibility (in case of field problems). So now how do I find the snapshot which is referred by this UUID?

Thanks and regards,

Philipp



4 answers

Permanent link
Geoff, Philipp,
just to give a simpler example involving only one UUID, this would be how we can access (i.e. browse to the web-interface of) a snapshot, whose repository we know:

https://<jazz_repositoryURL>/ccm/resource/itemOid/com.ibm.team.scm.BaselineSet/<SnapshotUUID>

1 vote

Comments

Hi Dorian,
I agree that this is the right URL for a snapshot.   Could you post the corresponding URL's for the other types of SCM objects?  And for completeness, could you post how you came up with this URL?


Hi Geoff,
unfortunately, I don't have a complete list. But this is what I found from right-clicking a few items in the eclipse client:

Build-Result Object:

https://<jazz_repositoryurl>/ccm/resource/itemOid/com.ibm.team.build.BuildResult/<buildresultuuid>
Single Change Set:
https://<jazz_repositoryurl>/ccm/resource/itemOid/com.ibm.team.scm.ChangeSet/<changesetuuid>?Workspace=<WorkspaceForPathResolution>
There doesn't seem to be a documentation of these things. Are they considered private interfaces?


Permanent link
If by "location", you mean "a mechanism for accessing the object", then you can use the Java API to find any SCM object based on its UUID (different kinds of SCM objects are accessed by different APIs).

But if by "location", you mean a URL for an SCM object based on its UUID, probably the easiest way to determine such a URL is to open the WebUI, and browse around until you see a UUID-based URL for that kind of object.

For example, if you browse for a directory in a workspace, you will see a URL like:

https://clmwb.ibm.com:9443/ccm/web/projects/my-proj#action=com.ibm.team.scm.browseElement&workspaceItemId=_FBLbECAKEeWbgqBaDWsPHQ&componentItemId=_FB8QECAKEeWbgqBaDWsPHQ&itemType=com.ibm.team.scm.Folder&itemId=_1HZDACB5EeWhVMAQ6keEUA

This is the URL for the version of the directory visible in the workspace _FBLbECAKEeWbgqBaDWsPHQ, the component _FB8QECAKEeWbgqBaDWsPHQ, and the item _1HZDACB5EeWhVMAQ6keEUA.

This URL is valid, independent of the current pathname of that directory within that component.

Note that the RTC URI's often introduce unnecessary segments.   For example, the "project" segment is irrelevant (you could replace that project area name with any other project area name that you can access, and the URL would still work).

Note that there are SCM objects that do not currently have a URL, such as a "component".

0 votes

Comments

Hi Geoff,

thanks for the answer but maybe I misunderstood about what is meant by SCM artifact. I didn't mean SCM artifacts in the sense of files and folders within a component (i.e. artifacts you check-in and deliver) but artifacts in the sense of "objects" (might be the better word) which can be created inside SCM, such as Streams/Snapshots, Components/baselines etc. So referring to the use-case mentioned in my second comment from above, I would like to know how to (easily) locate a certain SCM object (for ex. a snapshot) in RTC  when only having the UUID of this object available.

Thanks and regards,

Philipp

My answer above applies to both kinds of "artifacts" (i.e., there is always a Java API, and there sometimes is a URL that can be used in the WebUI).   But first, we should clarify what you mean by "locate".   Do you mean "read or manipulate that artifact in a script/program" or did you mean "allow a human to locate that object in a given UI"?   (If the latter, then the answer will depend on which UI you are using ... Eclipse, VisualStudio, Web Browser, etc.)

OK, from what I have understood so far is that there is a possibility to use the Java API to get the location of a certain snapshot from its UUID (this is convenient for automating the use-case for reproducing a certain SW version. But if you'd like to reproduce the SW manually (in case the reprocucibility use-case occurs only once in while) then it is required  to locate the object (i.e. for our specific use-case it would be a snapshot) in a given UI (preferably in Eclipse in order to be able to create a repository workspace out of it and load it on disc right away and build the SW which is going to be reproduced)  but Web-UI would also be OK (if it tells you in which stream it is contained). So for the latter I would be grateful if you could give me some hints.


Permanent link
see the accepted answer here
https://jazz.net/forum/questions/94538/get-iversionablehandle-from-uuid

it shows how to get the object handle from the UUID, and once u have the handle, you can get the object and all its reference info

0 votes

Comments

I believe Philipp was looking for a way to manually create a URL from the UUID, rather than using API calls, but I agree it is still useful to cross-reference the API mechanism here, in case folks interested in the API mechanism run across this question.


Permanent link
Philipp,

to open a snapshot from the Eclipse UI when only knowing its UUID you need to prepend the UUID with the URI part given by Dorian (https://<serverName>:<port>/ccm/resource/itemOid/com.ibm.team.scm.BaselineSet/), then copy into clipboard, then navigate to Eclipse menu --> navigate --> Open Team Artifact from Clipboard: the snapshot object will open if the UUID is that of a snapshot and the prepended URI part is correct. Otherwise nothing will happen.

- Arne

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,020

Question asked: Jul 30 '15, 5:44 a.m.

Question was seen: 3,837 times

Last updated: Sep 08 '15, 9:33 a.m.

Confirmation Cancel Confirm