Azure DevOps - Pipeline CI/CD - PR automated - azure-devops

Is it normally when creating a pull request manually in bitbucket, to see on Azure DevOps for the pipeline runs:
PR automated for branc_name like below:
I don't want that a pr will be created automatically. I want that the developer create a pr manually and only if the team leader merge, so the pipeline CI/CD is running.
Now what is happened is:
I create a pr manually
Azure DevOps displays that PR automated for branch-name
The pipeline CI/CD is running automatically even i didn't merge the code in the dev branch.

Related

trigger azure devops pipeline server from bitbucket server with different branch

using azure devops server 2020
i have the following issue:
i want to trigger azure devops pipeline every time a pull request is opened on any source branch in bitbucket (both azure devops and bitbucket are on-prem servers).
i've managed to trigger a pipeline from bitbucket using bitbucket webhooks, but it triggers the pipeline with the default repo/branch that is conigured - and PRs can be opened on any branch.
I moved to postman to see if i can add a body with some other branch name,
but it doesn't work.
Thank you for the help.

How to retrieve artifacts from AZ pipeline triggered by PR in subsequent pipeline triggered by merge from the PR branch

When a developer raises a PR to a branch we have a branch policy that runs a build/test pipeline. If the pipeline is successful and the dev gets an approver they can merge to master.
There is a policy on master branch that kicks off a similar build/test/deploy pipeline. It would seem safe and quicker to pull the built artifact from the PR build pipeline since that actually built based off a git MERGE target to master. But I can't work out if there is an inherent relationship in Azure Devops between what is essentially the last green pipeline on a branch and the pipeline triggered by that branches merge to master.
Any pointers?

Azure Devops Pipelines integration with Bitbucket not showing users who triggered builds

I setup an Azure CI/CD to build my project from a Bitbucket location with a YAML pipeline
However whenever I push to my branch that is included in the trigger branches, Azure Pipelines keeps saying that it's been triggered by:
If I wanted to make change using the web UI editor and push, it will show to run under my username.
How can make all triggers to look under usernames?

Devops Pull Request workflow validations

We are using Azure devops with the workflow for each task as:
Task branch to Release branch
Then Release branch to master
The reviewer will approve each pull request.
However, a user creating a PR can also create one from task branch directly to master.
Is there any way, by policies/validations that the system can prevent creation of the PR itself, which is from task to master.
Currently azure devops doesnot have the policies/validations to prevent creating a pr which is task to master.
However, there is workaround to prevent merging the PR which is task to master.
You can create a pipeline with a script task to check the source branch of the PR. See below:
$sourceBranch = "$(System.PullRequest.SourceBranch)"
if($sourceBranch -ne "refs/heads/release")
{
exit 1
}
For example add a powershell task with above script. The script will check if the PR source branch is release branch, and fail the pipeline if it is not.
Then you can add above pipeline to the branch policy of master branch. See below:
Then any PR which is not release to master will fail to be validated and cannot be completed. (But it still cannot prevent creating a PR from test to master)
You can also click here to submit a feature request(Click Suggest a feature and select Azure Devops. ) to Microsoft development team. Hopefully they will consider adding this feature in the future.
See below screenshot from my test pipeline.
If you only want a subset of users to manage the merge to master, you can setup branch security on the master branch that prevents contributing to pull requests that would target that branch.

Git branching strategies for CI/CD on Azure Devops 2019

I am setting a CI/CD pipeline on Azure devops.
This one gets executed when a Build for the master branch is completed.
I was asked to set the stages of the image above, which description is the next one:
Development, QA and Production : Publish the build artifacts on a server (each one).
Testing: Execute some automated test with katalon studio.
My problem is that, when I create a Development branch this pipeline cannot be executed for the build, because the pipeline is just executed when I commit to the master branch, then I create another CI/CD pipeline for Development branch, remove Development stage from Master CI/CD pipeline and incorporate it in this new pipeline.
My question is... is that correct ? , what´s the best estrategy for git branching when you have this kind of pipelines?
My problem is that, when I create a Development branch this pipeline
cannot be executed for the build, because the pipeline is just
executed when I commit to the master branch, then I create another
CI/CD pipeline for Development branch
For this issue, you don't need to do that. You only need to add the Development branch to the Branch filters of Continuous Integration in build Triggers.
Then add the Development branch to the Build branch filters of the Continuous deployment trigger.
After this setting, when you commit to development branch, build and release pipeline will also be triggered.