Skip to content

feat: restore feature flag support from PR descriptions#11

Merged
sadpandajoe merged 5 commits into
mainfrom
showtime-feature-flags
Apr 22, 2026
Merged

feat: restore feature flag support from PR descriptions#11
sadpandajoe merged 5 commits into
mainfrom
showtime-feature-flags

Conversation

@sadpandajoe
Copy link
Copy Markdown
Contributor

@sadpandajoe sadpandajoe commented Apr 12, 2026

Summary

  • Restores FEATURE_X=value parsing from PR descriptions, injecting them as
    SUPERSET_FEATURE_* env vars into ECS task definitions — functionality that
    existed in the old ephemeral-env.yml workflow but was lost during the showtime migration
  • Feature flags are reconciled on every no_action sync, so description edits
    take effect without a redeploy
  • Adds change detection to skip unnecessary ECS task-def registrations when flags haven't changed

Changes

pull_request.py

  • New parse_feature_flags() function: parses FEATURE_(\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 through deploy_aws()
  • On no_action syncs with a running env: calls _update_feature_flags_if_changed() to
    reconcile without a full redeploy; skips ECS API calls when PR has no flags

aws.py

  • get_current_feature_flags(): reads current SUPERSET_FEATURE_* vars from the live task def
  • reconcile_feature_flags(): replaces the entire SUPERSET_FEATURE_* set (handles removals
    correctly, unlike the old additive approach)

show.py

  • deploy_aws() accepts optional feature_flags list and forwards to AWSInterface.deploy()

Test plan

  • 25 unit tests in tests/unit/test_feature_flags.py covering parsing, threading, change
    detection, dry-run skipping, reconcile failure tolerance, and destroy-path guard
  • make test — all tests pass
  • Manual: showtime sync <pr> --dry-run-aws --dry-run-docker with FEATURE_X=true in PR body

sadpandajoe and others added 2 commits April 12, 2026 05:36
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 through PullRequest.sync()Show.deploy_aws()AWSInterface.create_environment().
  • Added logic intended to update feature flags on running environments during no_action syncs.
  • 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.

Comment thread showtime/core/pull_request.py Outdated
Comment thread showtime/core/pull_request.py Outdated
Comment thread showtime/core/pull_request.py Outdated
Comment thread showtime/core/pull_request.py Outdated
sadpandajoe and others added 3 commits April 14, 2026 04:17
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>
@sadpandajoe sadpandajoe merged commit 7ae4210 into main Apr 22, 2026
2 checks passed
@sadpandajoe sadpandajoe deleted the showtime-feature-flags branch April 22, 2026 23:59
@sadpandajoe sadpandajoe mentioned this pull request Apr 23, 2026
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.

3 participants