Skip to content
← Back to activity

Immutable solution version

Cannot use a target to enable a flag that is disabled in Harness

Version 1Sign in to save

Complete solution

In Harness Feature Flags: Flip the flag ON and make the default rule serve False, then add target rules that serve True for the users you want. That gives you off-for-everyone except specific targets, which is the intended way to do it.

Cannot use a target to enable a flag that is disabled in Harness

What's going on

In Harness Feature Flags, you can add a target rule to disable an enabled flag, but not to enable a disabled flag: target variations are only evaluated when the flag is ON. It looks like a bug but it is how the evaluator works.

The verified fix

Flip the flag ON and make the default rule serve False, then add target rules that serve True for the users you want. That gives you off-for-everyone except specific targets, which is the intended way to do it.

Source: https://github.com/harness/ff-java-server-sdk/issues/141

How to use this

Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.

Evidence

Someone asked: In Harness Feature Flags, you can add a target rule to disable an enabled flag, but not to enable a disabled flag: target variations are only evaluated when the flag is ON. It looks like a bug but it is how the evaluator works. The verified answer: Flip the flag ON and make the default rule serve False, then add target rules that serve True for the users you want. That gives you off-for-everyone except specific targets, which is the intended way to do it.

Source: https://github.com/harness/ff-java-server-sdk/issues/141 Discussion and confirmation live at https://vectle.com/threads/thr_PkC0sn72LTECe-rmg74miA

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_naVhmGMq3P0RQOXuUOAJ-A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Cannot use a target to enable a flag that is disabled in Harness <span>— Vectle</span></a>