Skip to main content

Library and utilities for feature toggles

Project description

PyPI Github CI Codecov Documentation Supported Python versions License

Library and utilities for implementing and reporting on feature toggles.

Documentation is on Read the Docs. Code repository is on GitHub.

See the scripts README for more information on the scripts for reporting on the status of feature toggles.

License

The code in this repository is licensed under the AGPL 3.0 unless otherwise noted.

Please see LICENSE.txt for details.

How To Contribute

Contributions are very welcome.

Please read How To Contribute for details.

Even though they were written with edx-platform in mind, the guidelines should be followed for Open edX code in general.

PR description template should be automatically applied if you are sending PR from github interface; otherwise you can find it it at PULL_REQUEST_TEMPLATE.md

Issue report template should be automatically applied if you are sending it from github UI as well; otherwise you can find it at ISSUE_TEMPLATE.md

Reporting Security Issues

Please do not report security issues in public. Please email security@edx.org.

Getting Help

Have a question about this repository, or about Open edX in general? Please refer to this list of resources if you need any assistance.

Change Log

[2.0.0] - 2020-11-05

  • BREAKING CHANGE: The WaffleFlagNamespace and WaffleSwitchNamespace classes have been removed. You can either rename to LegacyWaffleFlagNamespace and LegacyWaffleSwitchNamespace, which are deprecated, or you can move to the newer waffle classes that no longer use these Namespace classes (see below).

  • BREAKING CHANGE: The WaffleFlag and WaffleSwitch classes exposed in toggles no longer use the Namespace classes and are now the classes which were previously only available in toggles.__future__.

    • If you were importing from edx_toggles.toggles.__future__ before, then you simply need to import from edx_toggles.toggles. Importing from __future__ will continue to work but will trigger a deprecation warning.

    • If you were importing from edx_toggles.toggles, then you either need to:

      • Migrate your legacy namespaced classes to the new-style classes (see the new behaviour below), or

      • Import LegacyWaffleFlag instead of WaffleFlag and LegacyWaffleSwitch instead of WaffleSwitch. Note that these classes will be removed soon, so it’s preferable to migrate to the new classes already.

    • The new Waffle classes introduce the following changes:

      • They no longer use Namespace classes like WaffleSwitchNamespace or WaffleFlagNamespace.

      • The WaffleSwitchNamespace._namespaced_name and WaffleFlagNamespace._namespaced_name methods are replaced by the WaffleSwitch.name and WaffleFlag.name attributes.

      • The WaffleSwitchNamespace.is_enabled method is replaced by the WaffleSwitch.is_enabled method.

      • The WaffleSwitchNamespace.set_request_cache_with_short_name method has no replacement because an alternative solution should be found. You could (but really shouldn’t) use the WaffleSwitch._cached_switches property.

      • The WaffleSwitch.switch_name attribute is deprecated: switches should only ever be referred to using their fully namespaced names.

      • The WaffleSwitch.switch_name attribute no longer exists. Switches should only ever be referred to using their fully namespaced names. If you need the non-namespaced name, it must be parsed from the namespaced name.

      • The WaffleFlagNamespace.is_flag_active method is replaced by WaffleFlag.is_enabled.

      • The WaffleFlagNamespace._monitor_value method is replaced by WaffleFlag.set_monitor_value.

      • The WaffleFlagNamespace._cached_flags attribute is replaced by the WaffleFlag.cached_flags method.

      • The WaffleFlag and WaffleSwitch module_name constructor argument is now mandatory.

      • The WaffleFlag.flag_name attribute is deprecated.

      • The WaffleFlag.flag_name attribute no longer exists. Flags should only ever be referred to using their fully namespaced names. If you need the non-namespaced name, it must be parsed from the namespaced name.

      • The WaffleFlag.waffle_namespace attribute no longer exists, since there is no longer a separate namespace object.

[1.2.2] - 2020-12-22

More improvements to monitoring of legacy waffle class imports.

  • Add deprecated_incompatible_legacy_waffle_class custom attribute to any class (including subclasses), using the backward-incompatible imports that will be removed in 2.0.0.

  • Add deprecated_compatible_legacy_waffle_class custom attribute to any class (including subclasses) using the legacy classes compatible with 2.0.0 imports, but which should be removed in 3.0.0 (or some future major version).

  • Remove deprecated_edx_toggles_waffle custom attribute. In two cases, it was replaced by the new *_legacy_waffle_class custom attributes. In one case, it was replaced with the already existing and more appropriate deprecated_waffle_legacy_method custom attribute.

[1.2.1] - 2020-12-17

  • Improve monitoring of legacy Waffle class imports. We should watch for “edx_toggles.toggles.internal.waffle.legacy.WaffleSwitch” custom attributes.

[1.2.0] - 2020-11-05

  • Start the deprecation process of the waffle namespace classes:

    • Introduce LegacyWaffleFlag, LegacyWaffleSwitch for use with namespaces.

    • Begin deprecation/refactoring of namespacing code, including deprecation monitoring and warnings.

    • Note: WaffleFlag and WaffleSwitch still use namespaces as well (for now).

    • Introduce the toggles.__future__ module for applications that need to be forward-compatible right away.

[1.1.1] - 2020-10-27

  • Fix cache-checking in WaffleSwitchNamespace

[1.1.0] - 2020-10-23

  • Backport override_waffle_switch test utility function from edx-platform

[1.0.0] - 2020-10-13

  • Fix missing module_name argument in SettingDictToggle constructor.

  • Extract waffle classes from edx-platform and move them here following ADR #2, #3, #4. This does not introduce backward-incompatible changes, yet.

  • Fix pinned requirements and incorrect root url that overrode edx-platform’s.

[0.3.0] - 2020-09-23

First release to PyPI (2020-10-02)

  • Implement SettingToggle and SettingDictToggle.

[0.2.2] - 2020-09-11

  • Document the writing of feature toggles annotations.

[0.2.1] - 2020-08-03

  • Add ADR for the purpose of this repository.

  • Add ADR for implementing a Toggle State endpoint.

  • Add toggles report with CSV output using new CsvRenderer.

  • Add CourseWaffleFlag and course override data to toggle report.

  • Add output for waffle flag course overrides to data gatherer

  • Add additional options to scripts/feature_toggle_report_generator

    • filter toggle types and envs, add github_url, and change name of ida in report

  • Modified scripts/feature_toggle_report_generator to work based on envs

  • Removed confluence integration

  • Moved HtmlRenderer to its own file

  • Add ADR for new SettingToggle. (see 0003-django-setting-toggles.rst)

[0.2.0] - 2020-05-27

  • Removed caniusepython3.

[0.2.0] - 2020-05-05

  • Added support for python 3.8 and dropped support Django versions older than 2.2

[0.1.0] - 2019-04-08

  • Initial version

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edx-toggles-2.0.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edx_toggles-2.0.0-py2.py3-none-any.whl (32.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file edx-toggles-2.0.0.tar.gz.

File metadata

  • Download URL: edx-toggles-2.0.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for edx-toggles-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3afbfd954d4a88273941b830f02e172d67b2753e6b3662f4553364d759503642
MD5 8e098d1554b6fa11fe15863bb6aac57d
BLAKE2b-256 ec2ba5980259db9326614b5e7d80f1875c4de36033a7aa817cc9be278c026da2

See more details on using hashes here.

File details

Details for the file edx_toggles-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: edx_toggles-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.7

File hashes

Hashes for edx_toggles-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4f06061da1a1219247340f6d47a1bf5d78649ea27231b7177ce74b468e559e8e
MD5 4a7b088d8e0b3cfcea252944802a13f5
BLAKE2b-256 46a06bac7d31667a318f4f076bd164a7309c0a354d3ffe6de0c98731ae0b8ce4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page