Skip to content

Auto-deploy epic ephemeral envs on PR sync and child merge - #21

Merged
ardavis merged 2 commits into
mainfrom
discord-epic-autodeploy-1788744443
Sep 7, 2026
Merged

Auto-deploy epic ephemeral envs on PR sync and child merge#21
ardavis merged 2 commits into
mainfrom
discord-epic-autodeploy-1788744443

Conversation

@galen-brainiac

@galen-brainiac galen-brainiac Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Wires epics into the ephemeral auto-deploy path (both triggers Andy asked for).

Problem

Auto-deploy on PR update worked for normal card PRs but never for epics. Epic envs are tracked in ephemeral_envs.json keyed by name (e.g. epic-fp-ux) with epic_branch/epic_pr fields and no card number — and nothing read those fields. handle_pr_synchronized resolved the env via ephemeral_env_for_card (always fizzy-<card>), so epic pushes found no env. Child merges into the epic branch just logged not merged into main — ignoring.

Fix — two triggers

  1. Push to the epic PR branch (synchronize): handle_pr_synchronized now resolves an epic env by head branch before the card lookup bails, and redeploys it.
  2. Child PR merged into the epic branch: handle_pr_merged redeploys the epic env when the merge base matches a tracked epic_branch, instead of only logging + ignoring.

New maybe_redeploy_epic_ephemeral_env resolves the env via BeltConfig.epic_env_for_branch, verifies the epic worktree + infrastructure/<env>/, git pull --ff-onlys, and runs BeltEnvironment.deploy.

Dependency

Requires stowzilla/brainiac#62 (adds BeltConfig.epic_env_for_branch / epic_env_for_pr). Merge that first.

Testing

Existing suite green (43 runs, 0 failures). New epic paths need coverage — over to @GLaDOS.

Epics were never wired into the ephemeral auto-deploy path. Two triggers
now redeploy an epic's env:

1. Push to the epic PR's head branch (synchronize) — mirrors the card flow.
   handle_pr_synchronized resolves an epic env by head branch before the
   card lookup bails, since epic envs have no card number.

2. A child PR merging into the epic branch — handle_pr_merged redeploys the
   epic env when the merge base matches a tracked epic_branch, instead of
   only logging 'not merged into main, ignoring'.

New maybe_redeploy_epic_ephemeral_env resolves the env via
BeltConfig.epic_env_for_branch, pulls the epic worktree, and redeploys.

Depends on stowzilla/brainiac epic_env_for_branch helper.
@ardavis
ardavis merged commit 0e1832d into main Sep 7, 2026
4 checks passed
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