Add per-PR frontend preview environments#102
Merged
Merged
Conversation
Deploy an ephemeral preview of the web-client for PRs touching the frontend. On open/sync, the PR's web-client is built, pushed to GHCR, and deployed into a preview-pr-<N> namespace; the production backend is reused via a spring-api ExternalName alias, so it's one ~50m/64Mi pod against real data. A sticky comment posts the per-PR URL (wildcard DNS + per-host Let's Encrypt). The namespace is torn down when the PR is closed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The AET cluster token is namespace-scoped and cannot create namespaces, so the per-PR-namespace approach failed with a Forbidden error. Deploy preview resources into the existing `app` namespace instead, named/labelled per PR (web-client-pr-<N>, preview-pr=<N>). The production spring-api Service is already in this namespace, so the web-client's nginx proxy reaches it directly and the ExternalName alias is dropped. Teardown deletes by the preview-pr label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The deploy step captures the script's stdout into a step output; kubectl's "... created" lines made it multi-line and broke the key=value GITHUB_OUTPUT format. Route command output to stderr (still shown in logs) and write only the URL to fd 3 / stdout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🧹 The preview environment was removed because this PR was closed. |
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.
Spins up a live preview of the web-client for every PR that touches the frontend, so reviewers get a clickable link.
appnamespace asweb-client-pr-<N>.spring-api(same namespace), so a preview is one ~50m/64Mi pod.https://pr-<N>.devsecops.stud.k8s.aet.cit.tum.de/team-devsecops/.preview-prlabel) when the PR is closed.Frontend-only by design — backend/DB changes aren't exercised (those are covered by per-service CI).