nomaddave
nomaddave

Reputation: 1

Identify Devops Github repo with friendly name

We are building out some reporting from Azure DevOps with linked GitHub repos on projects. GitHub repos are returned as artifacts in the REST API in the form (for example):

vstfs:///GitHub/PullRequest/f63734d4-faa1-468a-b54f-8c8c529e5177%2f83

The bolded portion is some GUID or perhaps base64 encoding for the external GitHub repo. (The part after being the PR ID.)

The problem is with trying to derive a friendly name for the repo from this, eg. the GH repo name or URL. None of the DevOps REST documentation provides a way of retrieving this as of today. None of the DevOps odata service points provides this that I have found.

Is there an MS-friendly way to decode the GUID above into something meaningful for users or otherwise derive a relational context from that GUID/encoding into an actual GH repo?

  1. REST documentation provides no relational context for the above relative to an actual GH repo
  2. ODATA feeds from DevOps do not either
  3. While the artifact *format *for this GUID/encoding seems to be the same in use for other types of ADO artifacts like Azure Repos, packages, etc, I have not found any direct means of translating those GUIDs either

Upvotes: 0

Views: 179

Answers (1)

Arko
Arko

Reputation: 3731

As of now, there isn't a direct method or official feature provided by Microsoft Azure DevOps to decode the GUID in the artifact URL into a GitHub repository's friendly name or URL. The GUID appears to be an internal identifier used by Azure DevOps to reference artifacts, including GitHub repositories, but does not directly expose repository details through the API. There is no provided means within Azure DevOps documentation or ODATA feeds to translate these GUIDs into more meaningful, user-friendly information regarding the actual GitHub repositories.

I found a GitHub issue discussion on the Azure DevOps Docs repository. Although the discussed case, may not apply directly to your scenario with GitHub repositories but it confirms that there is no direct method in Azure DevOps REST API to map the GUID in the artifact URL to the GitHub repository's friendly name or URL.

Here the repository was not listed in the visualstudio.com/_apis/git/repositories/ API response, making it challenging to find the GUID to address the specific repo. The discussion suggests using the WIKI REST APIs to extract the repo ID or name but nothing to convert it to a friendly name.

Reference Doc naming restrictions AZDO rest API reference MS rest API reference

Upvotes: 0

Related Questions