Custom view for parameters on Azure Devops pipelines build - azure

For some time im looking for a possibility to display parameters on build view on Azure DevOps. Unfortunately i did not found any system option to enable it. I wonder if there is a way to create a custom tab in this view to display the params used in the current build. Right now the only option of seeing the params is clicking on "Run New" button and lookup for the params used in last run. What about runtime lookup? , not possible.
The tab next to Summary, Tests called Parameters will do the trick. In example like Jenkins has it's Parameters view.
Is there any already existing way to implement such or simmilar view?
An image to imagine what view im talking about :)
Looking google for already existing possibilities or info about how to implement this.

You could check the run time parameter selected in the job log.
Pipeline summary UI -> Click the Job -> Job summary page -> Job preparation parameters
Here's the parameter defined in the test pipeline.
Another workaround is to add a script task in your pipeline to echo the parameters. So that you can check out what parameters are selected from the task log later.
-script:|
echo "name ---> ${{parameters.name}}"
displayName:'Parameters Selected'
If you want the UI section like "Tests" view, currently there's no build in feature to achieve this, you could create a suggestion via: Visual Studio Feedback

Related

How to create bug or Notification in only one task/Job when other task/Job failed in an Agent in devops in Release Pipe line

I have an pipeline which will have few task mentioned in the image. I'm creating a bug work item when a particular task failed which is working fine using logic app.
Now my problem is I don't want to add every time new task for bug creation after each deployment task mentioned in the image.
Is there any way I can create only one bug work item based on failure in any of the task in the pipeline. may be in the last or somewhere..?
Not sure why you had to go the Logic app route as there is an option to do this with Azure Pipelines itself out of the box.
Navigate to {your pipeline} > Options as shown below:
If the build pipeline fails, you can automatically create a work item to track getting the problem fixed. You can specify the work item type. You can also select if you want to assign the work item to the requestor. For example, if this is a CI build, and a team member checks in some code that breaks the build, then the work item is assigned to that person.
Additional Fields: You can also set the value of other work item fields. For example:
Field Value
------- -------
System.Title Build $(Build.BuildNumber) failed
System.Reason Build failure
Check Build Options for more details.
UPDATE:
Doing this for Release Pipelines is not supported as an out of the box feature as of today. However, there are extensions available in the Visual Studio marketplace that can be used as alternatives until it is supported.
Here are two such extensions:
Create Bug on Release failure
Create Work Item
Another idea with PowerShell tasks is discussed here.

Azure Pipeline Check is any builds are running in different azure pipeline task

So to give you a bit of context we have a service which has been split into two different services ie one for the read and one for the write side operations. The read side is called ProductStore and the write side is called ProductCatalog. The issue were facing was down the write side as the load tests create 100 products in the write side resource web app and then they are transferred to the read side for the load test to then read x number of times. If a build is launched in the product catalog because something new was merged to master then this will cause issues in the product store pipeline if it gets run concurrently.
The question I want to ask is there a way in the ProductStore yaml file to directly query via a specified azure task or via an AzurePowershell script to check if a build is currently running in the ProductCatalog pipeline.
The second part of this would be to loop/wait until that pipeline has successfully finished before resuming the product store pipeline.
Hope this is clear as I'm not sure how to best ask this question as I'm very new to the DevOps pipelines flow but this would massively help if there was a good way of checking this sort of thing.
As a workaround , you can set Pipeline completion trigger in ProductStore pipeline.
To trigger a pipeline upon the completion of another, specify the triggering pipeline as a pipeline resource.
Or configure build completion triggers in the UI, choose Triggers from the settings menu, and navigate to the YAML pane.

Export tests results from Azure DevOps

I might be missing something, but can't find a way to export tests run results from the project's build pipeline execution page in Azure DevOps.
There is a "Download logs" option, of cause, where you technically can find logs from tests execution step as well among other things, but that doesn't seems to be the best/proper way to get that kind of data on a regular basis for regulations/audit/documentation purpose compared to how it is possible to get test results from other build systems right out-of-the-box (TeamCity/Jenkins etc).
So what would be the best approach to get this kind of data out of the system - custom task or else?
There is a simpler way to download the test results in trx format if you do not have Test Plans.
Go to the Tests tab from your build pipeline run.
Select your Test Run from the bottom pane (top level row for your run). A dialog should open on your right with options like Debug, Attachments, etc.
Click on the Attachments tab and you will find your trx file here.
I found that today, it will actually work. Even if you don't have test plans or anything, published tests artifacts will go into Tests Plan -> Runs.
Then you will be able to click on Tests Runs, select the run you want to download, and simply download the attachment.
You can export test plans, test suites, and test cases from Test Plans. Select the details that you want in the report. Then email or print this report for review.

Azure Pipelines (DevOps): Custom Consumable Statistic/Metric

I have a build up on Azure Pipelines, and one of the steps provides a code metric that I would like to have be consumable after the build is done. Ideally, this would be in the form of a badge like this (where we have text on the left and the metric in the form of a number on the right). I'd like to put such a badge on the README of the repository to make this metric visible on a per-build basis.
Azure DevOps does have a REST API that one can use to access built-in aspects of a given build. But as far as I can tell there's no way to expose a custom statistic or value that is generated or provided during a build.
(The equivalent in TeamCity would be outputting ##teamcity[buildStatisticValue key='My Custom Metric' value='123'] via Console.WriteLine() from a simple C# program, that TeamCity can then consume and use/make available.)
Anyone have experience with this?
One option is you could use a combination of adding a build tag using a command:
##vso[build.addbuildtag]"My Custom Metric.123"
Then use the Tags - Get Build Tags API.
GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/tags?api-version=5.0

Adaptavist Script Runner (Groovy) - Create subtask on click

I´m a bit lost with the Adaptavist Script Runner for JIRA.
I want to create several subtasks via a clickable button within an epic.
I managed to create a subtask via script but I have not managed to find a solution where the user can click on something and then several subtasks are created at once.
Anybody got a good solution for that?
Thx!
As workaround you can create transition from any to any status and place groovy script to this transition which will be create subtasks. But also scriptrunner have ability to customize UI docs.

Resources