Feature Flag Targeting allows you to serve a particular Variation of a Flag to specific Target when the Flag is enabled. Targets are anything that can be uniquely identified, we refer to these Targets as users, but they could also be apps, machines, resources, emails etc.
- You have a new feature you want your QA team to test before a general roll-out.
- You create a Boolean Feature Flag for the new feature.
- You add Targeting to the Flag so that the QA team are served the True Variation when the Flag is enabled, and the Non-QA team are served the False Variation.
- You enable the Feature Flag.
- The feature is available to the QA team but is not available to the Non-QA team.
A Flag can have values in each Environment. For example, if you have a QA Environment and a Production Environment within a single Project on the Harness Platform, the Flag could be toggled ON in QA but toggled OFF in Production.
This topic describes how to set up Targeting for a Feature Flag you’ve created.
To edit the default Variations that are served to Targets, go to Changing the Variations of Your Flags.
Target specific users or Target Groups when a Flag is enabled
After you have added the Target or Target Group, you can then choose the Variation to serve them when the Feature Flag is Enabled:
- True: The Targets are served the default True variation.
- False: The Targets are served the default False variation.
- Percentage rollout: You select a percentage of Targets to be served each Variation. For example, to increment how many users a feature is available for over time, you could use a percentage roll out to give 10% of users access to a feature, then 50%, then 100%. The users are selected randomly from the Target Group you target, and when you increase the percentage, all original users maintain their access to the feature. We can only ensure that identifiable Targets maintain their access, we can't maintain access for anonymous users.
To add specific Targets:
- Go to the Feature Flag you want to add Targets for and in the Targeting tab, under Specific Targeting, click + Add Targeting.
- Select which Variation you want to serve to the Target.
If you select one of the default Variations, for example, True or False:
- Select the Target(s) or Target Group(s), then Click Save.
Figure 1: Adding Targets and Target Groups to serve a Variation to
If you want to use a Percentage Rollout:
- Select the Target Group.
You can only use Percentage Rollouts on a single Target Group for each Flag.
- Enter the percentage of each Variation you want to serve, then click Save.
Figure 2: Using a percentage rollout for the Target Group