AL-Go icon indicating copy to clipboard operation
AL-Go copied to clipboard

Duplicate workflow runs

Open gntpet opened this issue 1 year ago • 3 comments

Hey AL-GO gurus,

I got a question about duplicate worklow runs. When i update my feature branch, for which i already have PR open, it always runs two workflows - one for CICD and one for PullRequestBuild.

Is it like this by design? If yes, what is the logic behind it? Is there a way to avoid it? In the end, it doubles ours billing hours.

image

Best Regards, Gintautas

gntpet avatar Nov 28 '23 19:11 gntpet

Interesting Problem.

Why do you automatically run builds on the feature branches?

We usually only run in PRs and for commits in main.

We switched to self-hosted runners that mitigates the billed hour problem at least a bit. But running duplicate builds is not a good solution. But I'm not sure if there is a good solution, if you need to run builds for every commit in your feature branches.

I think if the PR is a Draft it won't automatically trigger a build. Maybe that's viable?

jonaswre avatar Nov 28 '23 22:11 jonaswre

The default CICDPushBranches value (https://aka.ms/algosettings#CICDPushBranches) does include feature/*. This means that if you have an open PR, you will get double builds - I will investigate whether there is anything we can do about that, but until then you have two options:

  1. you can use a different name for your feature branch
  2. you can change the CICDPushBranches in your repository or for the entire organization if you like.

freddydk avatar Nov 28 '23 22:11 freddydk

Thanks @freddydk , We already adjusted the CICDPushBranches. Just wanted to bring it to your awareness, since it's default behavior of AL-GO

p.s. having CI/CD on feature branch, might be nice for the bigger developments, that you want to deploy to dedicated environment for testing. We used it basically for running autotests without creating PR (or draft PR) yet.

gntpet avatar Nov 29 '23 09:11 gntpet