Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Restores the per-PR preview hosting stack (PreviewHost service + Preview AppHost) and re-enables PR-scoped frontend artifact builds plus GitHub workflows to register/clean up previews and update PR descriptions.
Changes:
- Reintroduces
PreviewHost(API + storage + artifact download/extraction +/prsUI) including hardened extraction modes for large artifacts. - Updates the frontend build pipeline to produce per-PR artifacts and build with a PR-scoped Astro base path.
- Adds GitHub workflows to register preview builds on successful CI runs, update PR bodies with a preview badge block, and clean up on PR close.
Reviewed changes
Copilot reviewed 31 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/statichost/PreviewHost/wwwroot/_preview/status.js | Client-side status page logic (SSE, cancel/retry, progress UI). |
| src/statichost/PreviewHost/wwwroot/_preview/status.html | Status page shell for /prs/{number}/ while preparing. |
| src/statichost/PreviewHost/wwwroot/_preview/index.js | Client-side /prs/ catalog UI (filters, reset action). |
| src/statichost/PreviewHost/wwwroot/_preview/index.html | Catalog page shell for /prs/. |
| src/statichost/PreviewHost/wwwroot/_preview/preview.css | Shared styling for preview catalog/status shells. |
| src/statichost/PreviewHost/wwwroot/_preview/aspire-mark.svg | Aspire mark used by preview shells. |
| src/statichost/PreviewHost/wwwroot/_preview/github-mark.svg | GitHub icon asset for preview shells. |
| src/statichost/PreviewHost/wwwroot/_preview/left-arrow.svg | Navigation icon asset. |
| src/statichost/PreviewHost/wwwroot/_preview/retry-arrow.svg | Retry icon asset. |
| src/statichost/PreviewHost/Properties/launchSettings.json | Local launch settings for PreviewHost. |
| src/statichost/PreviewHost/Program.cs | PreviewHost endpoints, routing, auth token check, SSE, registration APIs. |
| src/statichost/PreviewHost/Previews/PreviewStateStore.cs | Persistent registry + content root management + snapshot APIs. |
| src/statichost/PreviewHost/Previews/PreviewRequestDispatcher.cs | Routes /prs requests and serves prepared preview files with rewriting support. |
| src/statichost/PreviewHost/Previews/PreviewModels.cs | Options + request/response models + snapshot/work-item types. |
| src/statichost/PreviewHost/Previews/PreviewCoordinator.cs | Orchestrates discovery/loading, download/extraction progress, eviction, activation. |
| src/statichost/PreviewHost/Previews/PreviewBufferSettings.cs | Adaptive buffer sizing based on available memory. |
| src/statichost/PreviewHost/Previews/GitHubArtifactClient.cs | GitHub API integration for PR catalog + workflow runs + artifact downloads. |
| src/statichost/PreviewHost/Previews/CommandLineExtractionSupport.cs | Validates/locates tar.exe/unzip when command-line extraction is selected. |
| src/statichost/PreviewHost/PreviewHost.csproj | PreviewHost project definition + GitHub client dependencies. |
| src/statichost/PreviewHost/Dockerfile | Container build and chiseled runtime image w/ unzip copied in. |
| src/statichost/PreviewHost/appsettings.json | Default PreviewHost configuration (logging + max active previews). |
| src/statichost/PreviewHost/appsettings.Development.json | Development logging overrides. |
| src/statichost/PreviewHost/.dockerignore | Docker ignore rules for build output. |
| src/frontend/astro.config.mjs | Adds env-driven Astro base for PR-scoped builds. |
| src/apphost/Aspire.Dev.Preview.AppHost/Properties/launchSettings.json | Local launch settings for Preview AppHost. |
| src/apphost/Aspire.Dev.Preview.AppHost/Aspire.Dev.Preview.AppHost.csproj | New AppHost project referencing PreviewHost. |
| src/apphost/Aspire.Dev.Preview.AppHost/appsettings.json | AppHost logging configuration. |
| src/apphost/Aspire.Dev.Preview.AppHost/appsettings.Development.json | Development logging overrides. |
| src/apphost/Aspire.Dev.Preview.AppHost/AppHost.cs | Aspire AppHost wiring for PreviewHost + env parameters (tokens, extraction mode, GitHub auth). |
| Aspire.Dev.slnx | Adds PreviewHost + Preview AppHost projects to the solution. |
| .github/workflows/pr-preview-register.yml | Registers preview builds on successful CI runs + updates PR body preview block. |
| .github/workflows/pr-preview-cleanup.yml | Removes preview registrations + PR body block on PR close. |
| .github/workflows/frontend-build.yml | Makes artifact name/retention/base-path configurable for PR builds. |
| .github/workflows/ci.yml | Configures CI to publish PR-scoped artifacts and base paths. |
| .github/workflows/apphost-build.yml | Builds AppHost artifacts via a matrix (AppHost + Preview AppHost). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/apphost/Aspire.Dev.Preview.AppHost/Aspire.Dev.Preview.AppHost.csproj
Outdated
Show resolved
Hide resolved
This reapplies the per-PR preview implementation that was reverted by PR #642, restoring the PreviewHost, preview AppHost, workflow automation, UI, and performance hardening work onto the redraft branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pass exact preview artifact metadata from the parent CI run into register-preview so the workflow no longer guesses artifact details across workflow_run boundaries. Also use the Aspire bot GitHub App token for PR body updates and artifact access when available. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix the AppHost workflow indentation, validate preview registrations against the configured repository, make registry writes durable, harden cleanup deletes, and align the Preview AppHost to the repo's current Aspire package versions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
622a72f to
3144450
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.
Summary
This restores the per-PR preview system onto a fresh branch after the earlier revert.
PreviewHostapp and isolatedAspire.Dev.Preview.AppHost/prscatalog and/prs/{number}preview/status UX, including reset/cancel behaviorunzipsupport and temp content roots## 🌐 Previewshields badge formatValidation
dotnet build src\statichost\PreviewHost\PreviewHost.csproj -nologodotnet build src\apphost\Aspire.Dev.Preview.AppHost\Aspire.Dev.Preview.AppHost.csproj -nologonode --check src\statichost\PreviewHost\wwwroot\_preview\index.jsnode --check src\statichost\PreviewHost\wwwroot\_preview\status.jsFollow-up
Live workflow/deployment validation is still needed after redeploy to confirm PR body updates, cleanup, and end-to-end preview behavior in the hosted environment.