feat: restore feature flag support from PR descriptions#11
Merged
Conversation
Parse FEATURE_(\w+)=(\w+) from PR descriptions and inject as SUPERSET_FEATURE_* env vars into ECS task definitions. This restores functionality that existed in the old ephemeral-env.yml workflow but was lost during the showtime migration. - Extract flags in sync() and thread through deploy_aws() - Update flags on running environments when PR description changes - Graceful degradation if PR data fetch fails - 17 new tests covering extraction, threading, and edge cases Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Restores “feature flags from PR description” support by extracting FEATURE_* assignments from PR bodies and threading them into the AWS ECS deployment flow, including attempts to update flags for already-running environments.
Changes:
- Added
parse_feature_flags()and wired extracted flags throughPullRequest.sync()→Show.deploy_aws()→AWSInterface.create_environment(). - Added logic intended to update feature flags on running environments during
no_actionsyncs. - Added unit tests covering parsing, threading, and update behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
showtime/core/pull_request.py |
Adds feature-flag parsing from PR body, threads flags into deployments, and attempts to update flags on running envs. |
showtime/core/show.py |
Extends Show.deploy_aws() to accept and forward feature_flags. |
tests/unit/test_pull_request.py |
Updates an assertion to reflect the new deploy_aws(..., feature_flags=...) call signature. |
tests/unit/test_feature_flags.py |
New tests for parsing and end-to-end threading/update behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR review feedback: - Validate feature flag values in parse_feature_flags() — only accept true/false/1/0/yes/no, skip invalid values with a warning - Add aws.get_current_feature_flags() to fetch running env's flags - Only call update_feature_flags() when desired flags differ from current, avoiding unnecessary ECS task def registrations on every no_action sync Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Normalize parse_feature_flags output to canonical "True"/"False" to prevent capitalization mismatch causing spurious ECS restarts - Add \b word boundary to regex to prevent matching prefixed forms - Replace additive update_feature_flags with reconcile_feature_flags that replaces the entire SUPERSET_FEATURE_* set (handles partial removal) - Remove dead update_feature_flags method - Skip ECS API calls on no-op syncs when PR has no feature flags - Add tests for partial flag removal, word boundary, and ECS call skipping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests for dry-run skip, reconcile failure tolerance, and destroy-path PR data fetch guard. Strengthen existing normalization test with value assertions and improve mock consistency across test class. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aminghadersohi
approved these changes
Apr 22, 2026
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_X=valueparsing from PR descriptions, injecting them asSUPERSET_FEATURE_*env vars into ECS task definitions — functionality thatexisted in the old
ephemeral-env.ymlworkflow but was lost during the showtime migrationno_actionsync, so description editstake effect without a redeploy
Changes
pull_request.pyparse_feature_flags()function: parsesFEATURE_(\w+)=(\w+)with word-boundary guard,validates values (
true/false/1/0/yes/no), normalizes to canonical"True"/"False"sync()extracts flags from PR description and threads them throughdeploy_aws()no_actionsyncs with a running env: calls_update_feature_flags_if_changed()toreconcile without a full redeploy; skips ECS API calls when PR has no flags
aws.pyget_current_feature_flags(): reads currentSUPERSET_FEATURE_*vars from the live task defreconcile_feature_flags(): replaces the entireSUPERSET_FEATURE_*set (handles removalscorrectly, unlike the old additive approach)
show.pydeploy_aws()accepts optionalfeature_flagslist and forwards toAWSInterface.deploy()Test plan
tests/unit/test_feature_flags.pycovering parsing, threading, changedetection, dry-run skipping, reconcile failure tolerance, and destroy-path guard
make test— all tests passshowtime sync <pr> --dry-run-aws --dry-run-dockerwithFEATURE_X=truein PR body