Skip to content

Allow explicitly disabling actors #514

@jnunemaker

Description

@jnunemaker

This has come up a few times. It would be great if we could come up with a good way of explicitly enabling a feature with exceptions. For example, this feature is enabled for everyone but john. Or this feature is enabled for everyone but customers on the basic tier.

The main problem currently is that flipper is about gates and letting people through the gates. Flipper.disable is about clearing those enablements, not explicitly disabling the gate for the actor which is different.

#82 (comment) talks more about this. Storage of disabled is easy but the interface changes could cause quite a ripple for existing flipper users so we'd want to be careful.

  • enable - enables feature for gate
  • un-enable - not disable, just removes the enabled gate if it is enabled else nothing, if actor enabled then this would remove actor, if group is enabled, it would remove group, if percentage is set it would unset it
  • disable - disables feature for gate, disable actor would store actor id in set of disabled actors, disable group would store group in set of disabled groups, flipper feature enabled? checks would likely need throw catch or some other mechanism to explicitly say "even though this feature is enabled for this gate, it is explicitly disabled for this actor or group or other gate and should return false

Workarounds

  • Create a negative feature. If feature is :redesign, you create new feature :redesign_disabled. Each code point needs to check Flipper.enabled?(:redesign, actor) && !Flipper.enabled?(:redesign_disabled, actor). A bit painful but can be wrapped up in another application method (e.g. Redesign.enabled?(actor) which can check both and return value). Con: Involves checking two features. Also involves knowing what/how the negative feature works in this context.
  • Use group + application storage. If you have group and group checks attribute you can enable the group and have that group check an attribute on the actor. :redesign_enabled group, checks if redesign_enabled? (some attribute stored on actor). If that is false it returns false for group. If that is true it returns true for group. Then you just need to avoid using other gates. Con: Would break if someone fully enabled. Also involves application storage instead of all baked into flipper.
  • Use application storage + pre-feature flag check. Check something with application logic in addition to Flipper feature check. Can also do this via Redesign.enabled?(actor) or something. That can check return false if actor.redesign_disabled? or whatever. Con: Involves you storing stuff on your own instead of baked into flipper.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions