Help with Variable Scoping using multiple Tags

Hi there!
I’m not sure if I understood things right or found a bug here…
I have a project variable with two values:


The Scope for Value “1” is defined like this: (This is the default value I need for almost all of my tenants)

The Scope for Value “2” is defined like this: (This is the value I need for a few very special tenants, so I added a Tag from the AllInOneHelper Tagset to define a smaller scope)

One of these special tenants looks like this:

All of my other tenants have a different Tag from the AllInOneHelper Tagset, for example this one:
image

Now, if i check my deployments or the variable preview, my special tenant is using the default value:

For me, it looks like the scoping mechanism is not using all Tagsets to find out the most specific variable value :frowning:
Is this behaviour by design or maybe a bug?
As a workaround, if have added a specific target to my special variable value’s scope. But this may not work for all my use cases.

Thx!

(I’m using version 2023.2.13113)

Hi @dennis.h,

Thank you for contacting Octopus Support. In this case, to create the Variable scoping you require, I recommend creating an additional Tagset for the special Tenants.

Essentially, the reason for this is that Octopus evaluates scoping as logical AND and OR operators.

In my screenshot example below, Octopus would evaluate this as (Dev OR Test) AND (TagName1 OR TagSet1).

With this example, both Tenant1 and Tenant2 would qualify for this scoping, despite Tenant2 only having one TagSet.

  • Does Tenant2 have a Dev OR Test Environment? Yes
  • Does Tenant2 have TagName1 OR TagSet2? Yes
  • Does Tenant2 satisfy the Environments requirement AND the TagSet requirement? Yes

Hopefully you find this explanation helpful. If you have any additional questions or if we can assist with anything else, please don’t hesitate to reach out.

Best Regards,
Donny