feat: run PR previews on ECS - #647
Merged
Merged
Conversation
daithihearn
requested review from
Agilulfo1820 and
davidecarpini
as code owners
August 27, 2026 10:06
|
PR bloat check passed - nothing left to fix. |
daithihearn
force-pushed
the
feat/preview-per-pr-stack
branch
2 times, most recently
from
August 27, 2026 11:59
3984a66 to
f31f0d0
Compare
PR Docker Image PublishedRun locallydocker run --rm -p 3000:3000 ghcr.io/vechain/block-explorer:pr.647.59d5634 |
daithihearn
force-pushed
the
feat/preview-per-pr-stack
branch
from
August 27, 2026 12:01
f31f0d0 to
5c8b6da
Compare
There was a problem hiding this comment.
Pull request overview
Migrates PR previews from App Runner to per-PR ECS services behind the shared preview ALB.
Changes:
- Adds the
frontend-previewTerraform stack. - Promotes tested multi-architecture images from GHCR to ECR.
- Adds ECS preview deployment, teardown, and reconciliation workflows.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
terraform/README.md |
Documents ECS previews. |
terraform/modules/ecs-webservice/variables.tf |
Adds task-definition ownership mode. |
terraform/modules/ecs-webservice/outputs.tf |
Supports either ECS service resource. |
terraform/modules/ecs-webservice/main.tf |
Adds Terraform-managed rolling services. |
terraform/frontend-preview/variables.tf |
Defines preview inputs. |
terraform/frontend-preview/terraform.tf |
Configures isolated workspace state. |
terraform/frontend-preview/providers.tf |
Configures preview resource tags. |
terraform/frontend-preview/outputs.tf |
Exposes deployment metadata. |
terraform/frontend-preview/main.tf |
Provisions per-PR ECS resources. |
terraform/frontend-preview/locals.tf |
Derives names, URL, and priority. |
terraform/environments/preview/preview.yaml.example |
Removes obsolete App Runner template. |
terraform/environments/preview/preview.yaml |
Defines ECS preview sizing. |
.github/workflows/README.md |
Documents the new lifecycle. |
.github/workflows/preview-reconcile.yml |
Reaps orphaned previews. |
.github/workflows/destroy-preview.yml |
Destroys ECS preview workspaces. |
.github/workflows/deploy-preview.yml |
Promotes and deploys preview images. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
daithihearn
force-pushed
the
feat/preview-per-pr-stack
branch
from
August 27, 2026 12:11
5c8b6da to
987d88e
Compare
Second half of phase 3. frontend-preview creates one target group, one host-header rule and one ECS service per PR in workspace pr-N; the workflows promote the multi-arch GHCR PR image into ECR rather than rebuilding, so previews run the same arm64 image as dev. preview-reconcile sweeps every six hours for workspaces whose PR is closed or unlabelled. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Preview images now expire by age rather than a global count of ten, which any mix of PRs could spend and leave a live preview unable to replace a task. The reconcile sweep fails loudly on a backend it cannot reach, instead of reading it as an empty workspace list. Preview instructions in DEPLOYMENT.md and the App Runner README pointed at a deleted template and the wrong stack. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
daithihearn
force-pushed
the
feat/preview-per-pr-stack
branch
from
August 27, 2026 12:28
15d6645 to
59d5634
Compare
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.
Second of two PRs for phase 3, on top of #645.
terraform/frontend-previewcreates one target group, one host-header rule and one ECS service per PR in workspacepr-N; priority is2000 + pr_number, so there is no allocator and no scan for a free slot. Previews reuse dev's indexer bypass token, since they share its NAT IP.deploy-preview.ymlnow promotes the multi-arch GHCR PR image into ECR instead of rebuilding amd64, so previews run the same arm64 image dev does. It waits for that image rather than racing it — the unit tests have to pass first.preview-reconcile.ymlsweepspr-*workspaces every six hours and reaps the ones whose PR is closed or unlabelled, skipping on any failed query rather than risking a live preview.modules/ecs-webservicegainsterraform_owns_task_definition: previews needignore_changesoff, which only a second copy of the resource can express. Amovedblock keeps the applied dev service in place.Concurrent previews cap at 100 — the target-group-per-ALB quota AWS does not raise.