Auto-deploy epic ephemeral envs on PR sync and child merge - #21
Merged
Conversation
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.
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.
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.jsonkeyed by name (e.g.epic-fp-ux) withepic_branch/epic_prfields and no card number — and nothing read those fields.handle_pr_synchronizedresolved the env viaephemeral_env_for_card(alwaysfizzy-<card>), so epic pushes found no env. Child merges into the epic branch just loggednot merged into main — ignoring.Fix — two triggers
synchronize):handle_pr_synchronizednow resolves an epic env by head branch before the card lookup bails, and redeploys it.handle_pr_mergedredeploys the epic env when the merge base matches a trackedepic_branch, instead of only logging + ignoring.New
maybe_redeploy_epic_ephemeral_envresolves the env viaBeltConfig.epic_env_for_branch, verifies the epic worktree +infrastructure/<env>/,git pull --ff-onlys, and runsBeltEnvironment.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.