openedx / openedx/edx-toggles

Enhance BaseToggle with additional enabled/disabled toggle methods

Open
#290 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help wanted
Dominant language
Python
Stars
6
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Enhance BaseToggle with additional methods.

Add the following:

  • is_disabled: Returns not is_enabled.
  • is_toggled_on: Returns is_enabled.
  • is_toggled_off: Returns not is_enabled.

This should make a variety of conditions more readable when ENABLE_ or DISABLE_ are in the toggle name.

Example 1: is_disabled

# BEFORE: slightly less readable
not SOME_FEATURE_TOGGLE.is_enabled()

# AFTER: more clear
SOME_FEATURE_TOGGLE.is_disabled()  

Example 2: is_toggled_off

# BEFORE: brain twister
not DISABLE_SOME_FEATURE.is_enabled()

# AFTER: more clear
DISABLE_SOME_FEATURE.is_toggled_off()  

Notes:

Questions:

  • Is this in fact simpler to understand? Are there better options?
    • We've decided to move forward

Work required:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in edx_toggles/toggles/internal/base.py and review the linked access-toggles documentation section. Check pull request 293 and the CourseWaffleFlag reference in edx-platform before starting. Done means the requested BaseToggle methods, documentation updates, and corresponding CourseWaffleFlag work are addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.