Agent query targeting rule exceptions

Hi,

I’d really love to have exceptions to targeting rules applied to agents (https://buildkite.com/docs/agent/v3/queues#targeting-a-queue) . This is currently a ‘must have whatever scoped in agent metatags’ list, I’d like to say “whatever scoped in agent metatags list unless they have this”.

Context:

We have ~40 mac minis running native builds, say they’re targetted with mac_mini=true - sometimes the hardware fails or performance decreases to a point where they’re still useful to package builds but not to run GUI tests.

Ideal scenario:

mac_mini=true
!host_name=slow.mac.mini

If you inverted your logic, would that work ok?

mac_mini=true
mac_is_healthy_for_general=true # flip to false if mac degrades
mac_is_ok_for_packaging=true

yup definitely - and what I’m looking to do now - but would be better to have the ability to scope via code in pipeline - rather than updating ‘x’ number of agent configs