microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 924 forks source link

by design there´s not available option in DeVops Service to create a new pipeline yaml for "existing" branch #585

Closed msdansau closed 1 year ago

msdansau commented 1 year ago

I have a sample DevOps service organization which have 1 project which have 1 repository with 3 branches (which have the same cloned code which have some modifications each)

image

I then created a simple pipeline in main branch to compile the net core code, but I want to use from the same pipeline another branch such as “testing”. and unfortunatelly the only way to achieve this is copy and paste the created yaml file from master to existing branch so that the CI triger takes effect when there´s a change in branch such yaml can be trigered.

why there´s not any available option in devops service portal when creating a new pipeline to choose to which BRANCH it should be created for existing branches????

Build pipeline..

image

if you happen to see an available option or technic please let me know .Any sample or help for this would be appreciated. it looks like by desing which in not right or practical having to create it in master branch each pipeline and then copy and paste it to each "existing" branches and modify the triger instead of master to the respective branch.

sergey-koryshev commented 1 year ago

Hi @msdansau, as far as understand your question, you want to checkout multiple branches. Please follow this guide to achieve this: https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/multi-repo-checkout?view=azure-devops

msdansau commented 1 year ago

@sergey-koryshev thank you so much for your help and sharing this link. Yes I saw it, but this is the real issue .

clarification: the link you shared is intnded for repos of the same devops or from other external repos, not for branches of same devops repo. the only way i observe to achieve this is a) create a .yaml pipeline in master , b) copy that yaml to the branch c) modify the trigger to be the branch name. this way whenever the branch have a commit or change this yaml is going to be trigered. but what i mean is , we need to copy manually from the master branch to the branch to have effect.

this is the bug in the devops service portal design - it does not allow to create a pipeline ( .yaml file) directly to the branch which already exist. the only way is to copy and paste the created pipeline yaml file to the branch. it does allow create a pipeline yaml by creating new branch, but not for "existing" branches. that´s a design bug in devops.

GOAL : there shuld be an option in devops service portal when it comes to create a new pipeline that says something like " which existing branch you want to create this pipeline". thereps not option for that not using clasic view mode. can you process that ? it helps customers when they want to create specific pipeline on existing branches so that each branch (eg: testing, production, development, etc) can run its own pipeline and deploy to respective azure slots .

msdansau commented 1 year ago

image here is an example that demostrate there`s not option in devops service portal to create a new pipeline yam to specific branch.

sergey-koryshev commented 1 year ago

Yes, you are right, this pipeline architecture is by design. You create one pipeline and then you can manage triggers to be able to run this pipeline against any branches but the branches should have related YAML-files. You can reduce duplicated YAML-code by using external repository to store it and then in target branches you can just checkout the YAML-repository and include related YAML-templates or something like this.

Actually this repository is wrong place for such type of request. Could you please create a ticket on https://developercommunity.visualstudio.com ?

msdansau commented 1 year ago

thank you we can close it now. i´ll request a "request feature" to MS engineering team so that they can add an option into the new pipeline wizard to choose which branch to create the pipeline (yaml file). much appreciated.