Conditional Locks

I want to create a delivery task with many branches.
Every delivery to branch should be queued in such way that deliveries to different branches can run in parallel.
Is there any possibility to have a “conditional” lock ?
Or check what builds (on what branches) are currently running ?

Hi Michal,

I’m not sure what you mean by “delivery task” - I’ll assume you mean build?

All builds can run in parallel, providing you have enough concurrent build licenses, and builds can be triggered from multiple different repository branches.

Continua CI includes the concept of Share Resources. Each build can acquire a lock on a Share Resource, preventing other builds from running until the lock is released. This can be used to block builds from running in parallel.

There are some expressions such as $Configuration.RunningBuilds$ which can be used in configuration conditions to check the running build count but it’s usually preferable to use shared resource locks.

If you are able to provide further details of your use case and scenario, then we may be able to suggest a more specific solution.

Yes, using Continua nomenclature, I want to create a Build.
I am aware of Shared Resources.

Let me explain as an example.
We have two branches: branch1 and branch2
And we have three users: user1, user2 and user3

I want such configuration that:
user1 starts build for branch1 → build starts
user2 starts build for branch1 → build is queued until user1 builds finishes
user3 starts build for branch2 → build starts
user1 build finishes → user2 builds starts

There is a quota list lock, but label can be chosen only manually.

Unfortunately, this is not currently possible, unless you create a configuration per branch.

If we allowed you to enter an expression such as $Source.RepoName.Branch$ into the label for the quota list lock, then I think this may achieve the result you are looking for. However, you would still need to enter a label into the shared resource quote list for every branch.

I’ll change this to a feature request, and we’ll look into whether this is something that we can do.

1 Like

v1.9.2.688 adds the ability to acquire a shared resource lock on a quota list shared resource using an expression. There is also a new option on a quota list shared resources to allow automatic creation of new labels as required to match a lock expression.

1 Like