-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSTS badge instructions no longer work for Azure DevOps #2082
Comments
Thanks for raising this. I've never used Visual Studio Team Services, so this is a bit hard for me to debug/advise. Working backwards from our example, it does seem to be valid to call a URL like: https://larsbrinkhoff.visualstudio.com/953a34b9-5966-4923-a48a-c41874cfb5f5/_apis/build/status/1 @Thilas - you've recently made a useful contribution to the Visual Studio integrations which uses a similar URL pattern to extract data from visualstudio.com . Are you able to provide advice on how to find the correct 'project id' and 'build definition id' to make this badge? |
To my understanding, the project guid is expected instead of its name when getting a badge from the "public" API (i.e. that does not require any authentication). @MichaelMauderer, the url you mentioned is using the "private" API therefore accept the project name. But for the shield.io badge, you have to find the guid of your project which is the only one accepted here. You can get it using VSTS api from a browser where you already are authenticated:
Look at the FYI:
|
Ah yes, that api call showed the correct id/giud. Thanks! |
Thanks for helping out here @Thilas 👍 Do you think we need to change the documentation? This is the current help we provide: shields/lib/all-badge-examples.js Lines 5 to 29 in f75cbf0
|
@chris48s, I'll try to find some time for this. There's one thing I'm not comfortable with though, it's that for now I don't fully understand what inputs are expected by VSTS API: it's like there was multiple behaviors in VSTS depending on how old are your build/release definitions... So I have to figure this out first. |
Probably also worth nothing that as part of the rebrand to Azure DevOps that there is a new URL used to access (https://dev.azure.com/account-name/project-name/…) Folks that had VSTS prior to the re-brand can still choose to use the old url format (for the foreseeable future) or they can switch to the new one (which will support redirects from the old url to the new for the forseeable future). However, net-new accounts that are created will all be using the new url, details can be found here There's also a new build status badge url. I believe with these new APIs you have the option to use the project name (instead of GUID) as well as the definition name/path (instead of the definition Id). For example here is the url to the status badge for one of my builds in a public project: https://dev.azure.com/swellaby/opensource/_apis/build/status/captain-githook/captain-githook-PR-Linux?branchName=master&label=linux%20build And I think the corresponding API call to get the latest build is: Corresponding API call for my definition linked above: |
As requested, here is a PR (#2206) that renames VSTS service to Azure DevOps (and uses the new URLs). It also updates its documentation. |
When trying to create a badge for Azure DevOps I was trying to follow the instructions for VSTS, but it seems that the ULR scheme has changed and the project ID and is no longer exposed (or a different name-based identifier is used instead).
Example for the current badge url scheme:
The text was updated successfully, but these errors were encountered: