Level 7 / Project 11 - Pipeline Feature Flags¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| — | This project | — | — | Flashcards | — | — |
Focus¶
- runtime toggles for safe rollout
Why this project exists¶
This project gives you level-appropriate practice in a realistic operations context. Goal: run the baseline, alter behavior, break one assumption, recover safely, and explain the fix.
Run (copy/paste)¶
Use <repo-root> as the folder containing this repository's README.md.
cd <repo-root>/projects/level-7/11-pipeline-feature-flags
python project.py --input data/sample_input.txt --output data/output_summary.json
pytest -q
Expected terminal output¶
Expected artifacts¶
data/output_summary.json- Passing tests
- Updated
notes.md
Alter it (required)¶
- Add a
time_windowparameter so a flag is only active during specific hours (e.g. 09:00-17:00). - Add a
toggle()method that flips a flag's enabled state and records it in the audit log. - Re-run script and tests — verify time-windowed flags and toggle work correctly.
Break it (required)¶
- Create a circular dependency (flag A requires B, flag B requires A) and observe infinite recursion.
- Set
rollout_pctto a value above 100 or below 0. - Capture the RecursionError or unexpected always-on behavior.
Fix it (required)¶
- Track visited flags during dependency resolution to detect and break circular references.
- Clamp
rollout_pctto the 0-100 range in the Flag constructor. - Add tests for circular dependencies and out-of-range rollout percentages.
Explain it (teach-back)¶
- Why are feature flags useful for deploying risky pipeline changes?
- What caused the infinite recursion with circular dependencies?
- How did the visited-set approach break the cycle?
- How do real feature flag systems (LaunchDarkly, Unleash) handle rollout percentages?
Mastery check¶
You can move on when you can: - run baseline without docs, - explain one core function line-by-line, - break and recover in one session, - keep tests passing after your change.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|