adamchainz / gargoyle

:radio_button: Feature switches in Django
Apache License 2.0
109 stars 19 forks source link

Support arbitrary status for SWITCH_DEFAULTS #196

Closed AgDude closed 6 years ago

AgDude commented 6 years ago

I would like the ability to allow our engineers to fully configure a new switch in code. It looks like the only missing piece is being able to set an arbitrary status. We are just starting to use Gargoyle, but it looks like we will need to set any new switch to "is_active=False", then in each environment manually change it in the admin after the release is deployed.

Something like:

from gargoyle.constants import DISABLED, EXCLUDE, GLOBAL, INCLUDE, INHERIT, SELECTIVE
GARGOYLE_SWITCH_DEFAULTS = {
    'new_switch': {
      'initial_status': SELECTIVE,
      'label': 'New Switch',
      'description': 'When you want the newness',
    },
}
adamchainz commented 6 years ago

Could work - would you be interested in starting a PR?

adamchainz commented 6 years ago

Fixed in #200, #206 .

Released in version 1.4.0: https://pypi.org/project/gargoyle-yplan/1.4.0/

Thanks! 🎉