Skip to content

feat: enable Superset feature flags via GitHub PR labels#9

Draft
EnxDev wants to merge 1 commit into
preset-io:mainfrom
EnxDev:enxdev/feat/feature-flag-labels
Draft

feat: enable Superset feature flags via GitHub PR labels#9
EnxDev wants to merge 1 commit into
preset-io:mainfrom
EnxDev:enxdev/feat/feature-flag-labels

Conversation

@EnxDev

@EnxDev EnxDev commented Feb 26, 2026

Copy link
Copy Markdown

Summary

  • Add support for enabling/disabling Superset FEATURE_FLAGS directly from GitHub PR labels using the format 🎪 🚩 FLAG_NAME=true|false
  • Feature flags are PR-level labels that persist across SHA rebuilds and flow through to ECS containers as SUPERSET_FEATURE_* environment variables
  • Supports hot-updating running environments without full Docker rebuilds — when sync determines no_action but flags exist on a running environment, it updates the ECS task definition in-place and triggers a rolling restart
Screenshot 2026-02-26 180045

Key changes

File Change
showtime/core/feature_flags.py New — parsing, creation, and AWS conversion utilities
showtime/core/pull_request.py Thread flags through sync() pipeline + fix sync_needed=False bug
showtime/core/show.py Add deploy_aws(feature_flags=...), update_feature_flags(), config overlay injection
showtime/core/label_colors.py Purple color scheme + 31 predefined Superset feature flag labels
showtime/cli.py Add showtime flags CLI command (--add, --remove, list)
showtime/data/superset_config_docker.py New — config overlay ensuring SUPERSET_FEATURE_* env vars override FEATURE_FLAGS dict
tests/unit/test_feature_flags.py New — 44 unit tests

Bug fix: sync_needed=False prevented hot-updates

analyze() returned sync_needed=False for NO_ACTION, which caused the GitHub Actions workflow to skip the sync step entirely when a feature flag label was added to a running environment. The hot-update code in sync() never ran. Fixed by returning sync_needed=True when feature flags exist on a running environment.

Test plan

  • All 174 tests pass (pytest tests/ -v)
  • Ruff passes (ruff check .)
  • Add feature flag label to a PR with a running environment → verify window.featureFlags shows the flag as enabled
  • Add flag to PR before first deployment → verify flag is included in initial ECS task definition
  • Hot-update: add/remove flag on running env → verify ECS rolling restart picks up change

Add support for enabling/disabling Superset FEATURE_FLAGS directly from
GitHub PR labels using the format `🎪 🚩 FLAG_NAME=true|false`.

Feature flags are PR-level labels that persist across SHA rebuilds and
flow through to ECS containers as SUPERSET_FEATURE_* environment
variables. Supports hot-updating running environments without full
Docker rebuilds.

Changes:
- New `showtime/core/feature_flags.py` module for parsing, creating,
  and converting feature flag labels
- Register 🚩 emoji and add purple color scheme for flag labels
- Thread feature flags through sync → deploy_aws pipeline
- Add hot-update path: when sync determines no_action but flags exist
  on a running environment, update ECS task definition in-place
- Fix sync_needed=False bug in analyze() that prevented hot-updates
  from triggering via GitHub Actions
- Add `showtime flags` CLI command for managing flags
- Add superset_config_docker.py overlay injected during Docker builds
  to ensure SUPERSET_FEATURE_* env vars override FEATURE_FLAGS dict
- Predefined labels for 31 Superset feature flags (GitHub 50-char limit)
- 44 unit tests covering parsing, extraction, AWS conversion,
  hot-updates, label colors, and sync_needed behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant