badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
22.95k stars 5.47k forks source link

Badge request: TFS/Azure DevOps Server #3429

Open eberkund opened 5 years ago

eberkund commented 5 years ago

Hello, I was wondering is Azure DevOps self hosted supported? I see several shields for Azure DevOps are there but is it possible to use a self hosted version of shields to work with a self hosted version of Azure DevOps? I was trying to do it through the custom badge method but I couldn't figure out how to enter my personal auth token.

calebcartwright commented 5 years ago

Hi @eberkund - to clarify, are you asking if you can use the Shields.io service for badges from TFS/Azure DevOps Server?

eberkund commented 5 years ago

Not exactly, I am currently using the built in DevOps badges:

image

However I would like to add a new custom badge for code coverage. DevOps server provides a JSON API with this information so I believe it is possible.

calebcartwright commented 5 years ago

We provide native badges for code coverage from Azure Pipelines already: https://img.shields.io/azure-devops/coverage/swellaby/opensource/49.svg

https://shields.io/ image

eberkund commented 5 years ago

Isn't that only for the cloud hosted one?

image

I didn't see a way to customize the URL to use my self-hosted server.

calebcartwright commented 5 years ago

Okay, as I had asked before, you are using a self-hosted TFS/Azure DevOps Server?

eberkund commented 5 years ago

Yep, that is what I am using

calebcartwright commented 5 years ago

Thank you for confirming. The short answer is that no it's not possible today to use Shields to create badges for a self-hosted TFS/Azure DevOps Server instance. We'd be more than happy to review a PR if anyone is interested in adding this! There's two key points to consider:

1) the main Shields.io service can only be used to interface with internet-accessible services/tools that do not require user/account specific authentication. That's why Shields.io can work with AzDO accounts, including coverage and test results badges for public projects. If your target tool/service does not meet both of those criteria (for example the tool/service runs on your private intranet, etc.) then you have to run your own self-hosted Shields instance. I suspect that anyone using the self-hosted AzDO Server/TFS will almost certainly be running it within a private network. 2) The Azure DevOps badges we have today are based off the URL pattern and APIs explicitly for the SaaS Azure DevOps (formerly known as VSTS), which may or may not be compatible with the self-hosted Azure DevOps Server (formerly known as TFS).

If the latest version of the self-hosted AzDO Server has identical APIs as the main SaaS service, then a relatively simply solution would be to add an optional server query parameter that folks (again probably using their own self-hosted Shields server) can use to specify their self-hosted AzDO Server endpoint to override the default dev.azure.com base that's currently always used (something similar was done for the Bitbucket badges not too long ago).

However, if the API sets are completely different then we'd have to discuss whether support for self-hosted AzDO servers is something we want to incorporate, as we do not really add badges to Shields that only work for private/self-hosted services.

eberkund commented 5 years ago

Okay, thanks for the response.