AzureDevOps API to retrieve build results based on build id - azure-devops-rest-api

We are trying to use Microsoft Azure DevOps API and retrieve following information for each build under each project in Azure DevOps organization. Ultimate goal is to retrieve these datils using C# code and use as a data to make some decisions in one of our dashboard. As we can see, these details available in the summary of the build once build completed (in Azure DevOps build summary page).
Unit Test Status
Code Coverage
Build Status
Deployment Status
Automated Test Execution Status
We have referred this Microsoft official documentation in our research. And found that below GET methods has some information that may help with our research, but unfortunately these does not contains all the information that we are looking for.
Build
Builds
History
Could someone help us by recommending possible candidate API's to efficiently extract this data?

Related

Pass data from Azure DevOps release to release tab

I am developing an extension for Azure DevOps. Details of my extension are as below
Supported environment
Azure DevOps
TFS 2017
TFS 2018
DevOps server 2019
DevOps server 2020
Language: Typescript
Contribution Points :
ms.vss-distributed-task.task
ms.vss-releaseManagement-web.release-summary-tab
Scopes :
vso.build
vso.build_execute
vso.work_write
vso.release
vso.release_execute
My task is running in the release pipeline and generates some data. I want to pass these data to the release tab once the release is completed. And display some arranged information in the release tab. further user should able to view information related to a particular old release in the tab by navigating to that relase as well.
Please be kind enough to provide some guidelines for achieving this task. Please let me know if you need any additional information.
Here are two ideas for getting data from release pipeline:
Present the data you need in the task's running log and then use REST APIs to get the log. Here are several REST APIs:
Releases - Get Task Log: This REST API can get log of a specific task, which only supports plain texts.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/environments/{environmentId}/deployPhases/{releaseDeployPhaseId}/tasks/{taskId}/logs?api-version=6.0-preview.2
Releases - Get Logs: This REST API download a zip file that contains log of all the tasks.
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}/logs?api-version=6.0-preview.2
Write the data you need to a file and then use Copy Files task to get the file outside the release.

REST API for associating Xray configuration/coverage with jira project programmatically

I want to automate the manual process of associating a jira project with xray so that projects can leverage the features of xray.
I have explored various jira and xray api's available at https://confluence.xpand-it.com/display/public/XRAY/REST+API but could not find any API which can help in doing so.
Automating this with selenium or htmlunit is one option but it will be time consuming if there are more projects.
Is there any workaround/trick to automate this or if there's any undocumented api which can help in associating jira projects to xray plugin. Any suggestions please?
I have found a way to do this programmatically. No need of using ScriptRunner's custom REST API capabilities as documented here
Configure the headers as below,
Content-Type:application/x-www-form-urlencoded
X-Atlassian-Token:no-check
Access the below GET call with the required query parameters,
https://{YOUR_JIRA_HOME_URL}/XrayRequirementProjectsConfiguration.jspa?makeCompatible={PROJECT_KEY}
Specify the project key of the project for which you would like to enable the XRAY coverage.

How to publish jmeter run results to TFS

We have TFS 2017 installed on our server and JMeter performance tests which i want to run through non-gui mode on TFS build agent.
I can't find way how to publish jmeter results to TFS?
There is no approved plugin for JMeter (at least none I could find) that incorporate your results into VSTS test results. You would need to dump your JMeter results locally, add a task that captures the output and puts it with the $(build.artifactstagingdirectory) path. You will then need to make sure that your final task is a Publish Build Artifacts. This will ensure that your JMeter results will get published as artifacts as part of the build.
Now the fun part, you obviously want to view the results so you are left with two options. The first is to create a web app that contacts VSTS via the API, pulls the JMeter artifact and displays the results as desired. There may actually be
Last option is to create a hub page for VSTS. This could query the build, get the JMeter artifacts and render them as desired.
These are the best options I could find for you at present. You can always request such a feature in the VSTS User Voice Forum.
There is not any build-in tool to integrate the JMeter with TFS for now.
You can have a try for Cloud-based Apache JMeter Load Test task. However it's cloud based, and need Visual Studio Team Services account.
There are detailed reports and analysis tool when using could based jmeter test such as this tutorial.
Please reference this article for detail steps : Running Apache JMeter based load tests in the cloud – how to
In your case, the simplest way is as virusstorm suggested using custom extensions to catch your test results and publish test results. If you are not familiar with this area, there are detail tutorials here. Moreover you could also ask help of some ALM company and team.

How can I create a new GitLab Project Service?

I am currently evaluating GitLab for the development process in a new team. For reasons that are beyond my control I need to integrate with TFS build (so that a merge request kicks off a new build and the build reports status to the merge request, etc). It seems, from what I have learned so far, that the only way to achieve this seamlessly would be with a new Project Service.
Is this true and if so how would I go about creating one?
I have searched through the relevant docs and forums and I can't find much information of use so I suspect that Project Services are less of an arbitrary, open plug-in style model but rather more a core part of the product. I am hoping to be proved wrong...
If the integrate of GitLab and TFS build means you want through GitLab to queue the TFS build automatically.
You may have to create your own service to receive the webhooks form Gitlab(How do I create a GitLab webhook?). And then trigger TFS build.
You might have a look at:
(paths taken from docker container)
/opt/gitlab/embedded/service/gitlab-rails/…
…/app/models/project_services/
have a look at the template: app/models/project_services/ci_service.rb
…/app/models/project.rb
…/app/models/service.rb
…/lib/api/v3/services.rb
…/lib/api/services.rb
where the first three are the most relevant, the api to complete the REST services.
But no, I wasn't able to find any documentation either...

Build overview of TFS azure (Preview)

We are in a process of evaluating tfs azure.
We've migrated three of our projects(solutions) and created a specific project for each of the solutions in tfs azure.
Now we are looking for something to enable a visual overview of the current build status for all the three projects.
I know that I can get a overview of each project, by going to it's site, but I'd like an gathered overview of all the projects.
Today we are using Jenkins, connected to our local tfs 2010, and that gives us an direct overview of all the build statuses.
Does anybody know a tool for that?
After discussion with the Windows Azure team, the respons is that they don't support this at the moment. You can get a build overview on the project level, but not on the collection level.

Resources