feat: enable Superset feature flags via GitHub PR labels#9
Draft
EnxDev wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FEATURE_FLAGSdirectly from GitHub PR labels using the format🎪 🚩 FLAG_NAME=true|falseSUPERSET_FEATURE_*environment variablessyncdeterminesno_actionbut flags exist on a running environment, it updates the ECS task definition in-place and triggers a rolling restartKey changes
showtime/core/feature_flags.pyshowtime/core/pull_request.pysync()pipeline + fixsync_needed=Falsebugshowtime/core/show.pydeploy_aws(feature_flags=...),update_feature_flags(), config overlay injectionshowtime/core/label_colors.pyshowtime/cli.pyshowtime flagsCLI command (--add,--remove, list)showtime/data/superset_config_docker.pySUPERSET_FEATURE_*env vars overrideFEATURE_FLAGSdicttests/unit/test_feature_flags.pyBug fix:
sync_needed=Falseprevented hot-updatesanalyze()returnedsync_needed=FalseforNO_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 insync()never ran. Fixed by returningsync_needed=Truewhen feature flags exist on a running environment.Test plan
pytest tests/ -v)ruff check .)window.featureFlagsshows the flag as enabled