Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The ownership lookup can treat an ambiguous run as uniquely owned after branch retirement, causing a retired prototype’s preview URL to serve another prototype’s content.
9 open issues
Filtering ineligible Builds can misroute ambiguous owners · New Screenshot capture rejects valid percent-sign filenames · New Slashless routes incorrectly serve a nested index.html · New Add an index for workflow run ID owner lookups · New Retired prototypes expose preview URLs that cannot be served · New Unauthorized errors disclose repository and Build existence · New Valid asset filenames containing percent signs are rejected · New Missing validators force unchanged assets to be read and transferred again · New Public share requests are intercepted by the private 404 fallback · New
6 files not reviewed
.github/extensions/replica-prototype/assets/canvas-bridge.js: Generated file.github/extensions/replica-prototype/assets/renderer-improvement-notes-prototype.js: Generated file.github/extensions/replica-prototype/assets/renderer-prototype-canvas-improvement-threads.js: Generated file.github/extensions/replica-prototype/assets/renderer.js: Generated filehub/.storybook/preview-fixtures/build-controls/controls.js: Generated filehub/client/features/install-replica-controls-bridge/bridge.js: Generated file
What changed in this PR
Moves private GitHub Build previews onto Hub’s existing hostname using fixed repository and owning-run paths. This connects saved artifacts to Hub’s preview, template, Controls, and review flows without requiring wildcard infrastructure. Public sharing retains its separate configuration; local Builds no longer receive private previews.
Changes:
- Adds session-authorized path serving and reuses the shared 100 MiB response allowance introduced in #329.
- Preserves preview prefixes across templates, Controls, review anchors, navigation, and copied URLs.
- Adds screenshot capture at the original compiled base, switches Starter to relative output, and removes private wildcard authorization.
| File | Description |
|---|---|
starter/vite.config.ts |
Emits relative asset URLs. |
starter/README.md |
Explains preview-base compatibility and rebuilding. |
hub/vite.config.ts |
Proxies private preview requests locally. |
hub/test/local-smoke/browser.js |
Checks unavailable local-preview states. |
hub/server/utils/create-build-preview-path/index.ts |
Constructs canonical GitHub preview paths. |
hub/server/routes/index.ts |
Registers private mounts and retained public serving. |
hub/server/routes/build-preview/types.ts |
Defines path-target dependencies and optional wildcard origin. |
hub/server/routes/build-preview/share-authorize/get/index.ts |
Guards public authorization without wildcard configuration. |
hub/server/routes/build-preview/share-authorize/get/index.test.ts |
Removes obsolete private-preview fixture dependencies. |
hub/server/routes/build-preview/serve/get/index.ts |
Retains public-only wildcard serving. |
hub/server/routes/build-preview/serve/get/index.test.ts |
Updates public serving and revocation coverage. |
hub/server/routes/build-preview/path/get/index.ts |
Serves private resources with live access checks. |
hub/server/routes/build-preview/path/get/index.db.test.ts |
Covers composed URLs, sessions, and repository access. |
hub/server/routes/build-preview/create-preview-response-reservation/index.ts |
Shares byte-reservation lifecycle handling. |
hub/server/routes/build-preview/create-build-preview-route-dependencies/index.ts |
Enables private serving without a wildcard origin. |
hub/server/routes/build-preview/create-build-preview-route-dependencies/index.test.ts |
Covers wildcard-free preview composition. |
hub/server/routes/build-preview/authorize/get/index.ts |
Removes private grant exchange. |
hub/server/routes/build-preview/authorize/get/index.test.ts |
Removes obsolete grant-exchange tests. |
hub/server/routes/api/repositories/templates/index.ts |
Redirects template access to canonical mounts. |
hub/server/routes/api/repositories/templates/index.test.ts |
Covers mounted and identifier-less templates. |
hub/server/routes/api/repositories/templates/index.db.test.ts |
Updates persisted template preview coverage. |
hub/server/routes/api/repositories/prototypes/builds/access/get/index.ts |
Redirects Build access to its fixed prefix. |
hub/server/routes/api/repositories/prototypes/builds/access/get/index.test.ts |
Covers canonical redirects and denied access. |
hub/server/routes/api/public-sharing/hosted-sharing.db.test.ts |
Separates product URLs from wildcard configuration. |
hub/server/routes/api/product/create-product-route-dependencies/index.ts |
Generates canonical artifact URLs. |
hub/server/repositories/prototype-index/find-prototype-detail/index.ts |
Projects preview URLs from GitHub identifiers. |
hub/server/repositories/prototype-index/find-prototype-detail/index.db.test.ts |
Covers canonical detail URLs. |
hub/server/repositories/build-artifacts/find-path-preview-targets/index.ts |
Resolves owning runs and detects ambiguous targets. |
hub/server/repositories/build-artifacts/find-path-preview-targets/index.db.test.ts |
Covers ownership, eligibility, and exact identifiers. |
hub/server/repositories/build-artifacts/find-default-template-build/index.ts |
Adds canonical mounts to template snapshots. |
hub/server/repositories/build-artifacts/find-build-preview-target/index.ts |
Returns mount paths for Build access. |
hub/server/integrations/express/create-preview-cookie/index.ts |
Removes private wildcard cookie creation. |
hub/server/index.ts |
Composes private previews whenever storage is available. |
hub/server/index.test.ts |
Covers startup without wildcard configuration. |
hub/server/domains/local-builds/synchronize-local-builds/index.db.test.ts |
Expects no canonical mount for local Builds. |
hub/server/domains/build-preview/read-preview-session/index.ts |
Removes private wildcard session decoding. |
hub/server/domains/build-preview/read-preview-session/index.test.ts |
Removes obsolete private-session tests. |
hub/server/domains/build-preview/read-preview-grant/index.ts |
Removes private preview grant decoding. |
hub/server/domains/build-preview/read-preview-grant/index.test.ts |
Removes obsolete private-grant tests. |
hub/server/domains/build-preview/read-build-preview-file/types.ts |
Accepts a preview mount prefix. |
hub/server/domains/build-preview/read-build-preview-file/index.ts |
Passes the prefix into bridge injection. |
hub/server/domains/build-preview/inject-preview-bridge/index.ts |
Injects the bridge beneath the active mount. |
hub/server/domains/build-preview/create-preview-session/index.ts |
Removes private wildcard session creation. |
hub/server/domains/build-preview/create-preview-grant/index.ts |
Removes private preview grant creation. |
hub/server/create-app/index.ts |
Applies security middleware to private preview paths. |
hub/server/create-app/index.test.ts |
Updates authorization logging and serving fixtures. |
hub/docs/testing-and-operations.md |
Describes revised local smoke behavior. |
hub/docs/share-links.md |
Clarifies the retained public-preview boundary. |
hub/docs/github-actions-builds.md |
Documents compiled bases and screenshot inputs. |
hub/docs/frontend.md |
Describes canonical previews and local limitations. |
hub/docs/development.md |
Updates proxy guidance and local-preview availability. |
hub/docs/build-previews.md |
Defines serving, trust, compatibility, and rollout contracts. |
hub/docs/architecture.md |
Describes same-origin private preview architecture. |
hub/client/utils/prototype-controls/preview-base-path.mjs |
Extracts canonical preview prefixes. |
hub/client/utils/prototype-controls/preview-base-path.d.mts |
Types the prefix helper. |
hub/client/utils/prototype-controls/browser-entry.mjs |
Derives the screenshot adapter’s base path. |
hub/client/utils/prototype-controls/bindings.mjs |
Loads Controls definitions beneath the preview base. |
hub/client/utils/prototype-controls/bindings.d.mts |
Types optional Controls base paths. |
hub/client/utils/get-url-origin/index.ts |
Removes private wildcard origin hints. |
hub/client/utils/get-url-origin/index.test.ts |
Covers canonical Hub origins. |
hub/client/utils/create-preview-prototype-prompt/index.ts |
Uses logical routes in prototype prompts. |
hub/client/pages/replica-browse-page/index.tsx |
Preserves mounts in displayed template addresses. |
hub/client/pages/replica-browse-page/index.test.tsx |
Covers template addresses after navigation. |
hub/client/pages/prototypes-show-page/index.tsx |
Preserves canonical prefixes in preview links. |
hub/client/pages/prototypes-show-page/index.test.tsx |
Covers copying the current canonical route. |
hub/client/hooks/use-prototype-viewer-url/index.ts |
Stores logical return routes without mount prefixes. |
hub/client/hooks/use-preview-bridge/index.ts |
Matches logical routes during fragment restoration. |
hub/client/hooks/use-canvas-preview-navigation/index.ts |
Reapplies mounts during navigation and history changes. |
hub/client/hooks/use-canvas-preview-navigation/index.test.tsx |
Covers prefixed navigation and history travel. |
hub/client/features/prototype-canvas-improvement-notes/index.tsx |
Keeps note navigation within the preview mount. |
hub/client/features/install-replica-preview-bridge/index.test.ts |
Covers anchors across owning-run mounts. |
hub/client/features/install-replica-preview-bridge/index.js |
Reports and compares logical review paths. |
hub/client/features/install-replica-preview-bridge/create-preview-bridge-test-harness/index.ts |
Supports custom mounted preview URLs. |
hub/client/application/prototype-preview-bridge/index.ts |
Recognizes prefixed hosted bridges and logical routes. |
hub/client/application/prototype-preview-bridge/index.test.ts |
Covers hosted bridge ownership at both bases. |
hub/client/application/hub/view-models/product-share-links-data/index.ts |
Keeps sharing independent of private-preview availability. |
hub/client/application/hub/view-models/product-share-links-data/index.test.ts |
Covers sharing without a private mount. |
hub/client/application/hub/routes/real-local-review-flow.test.tsx |
Uses canonical URLs in review-flow fixtures. |
hub/client/application/hub/routes/expanded-flows.test.tsx |
Updates successful-Build sharing expectations. |
hub/.env.example |
Clarifies the wildcard setting in comments. |
actions/build/scripts/normalize-base-path/index.mjs |
Validates screenshot capture base paths. |
actions/build/scripts/create-static-server/index.test.mjs |
Covers prefixed static serving and template routes. |
actions/build/scripts/create-static-server/index.mjs |
Mounts captured output beneath its compiled base. |
actions/build/scripts/capture-screenshots/index.test.mjs |
Covers fixed-base apps, lazy modules, and Controls. |
actions/build/scripts/capture-screenshots/index.mjs |
Applies the original base throughout capture. |
actions/build/scripts/action-contract/index.test.mjs |
Covers forwarding the capture base input. |
actions/build/screenshots/action.yml |
Exposes base-path for separate capture. |
actions/build/action.yml |
Exposes base-path for inline capture. |
.github/extensions/replica-prototype/assets/renderer-prototype-canvas-improvement-threads.js |
Refreshes generated renderer imports. |
.github/extensions/replica-prototype/assets/renderer-improvement-notes-prototype.js |
Includes mount-aware note navigation in generated output. |
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
weastler
force-pushed
the
weastler-private-path-previews
branch
from
November 21, 2026 05:10
6fa5d05 to
ab9cc77
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.


Why
Private Build previews should work on the Hub's existing hostname. Requiring a separate wildcard preview domain currently leaves preview and screenshot URLs unavailable on installations that have artifact storage but no wildcard configuration.
What changes
/previews/github/<repository-id>/<workflow-run-id>/.Compatibility: prototypes must be built for their preview URL, or use relative asset URLs and hash routing as Starter now does. Older prototypes built for
/need a new commit and rebuild to load correctly; their saved Builds and files are not modified. Local Builds and other Builds without GitHub repository/run IDs do not receive private preview URLs.Browser trust: prototype JavaScript runs on the same website address as Hub and can act with the viewer's Hub permissions. This relies on trusting the people who publish prototypes.
This PR does not deploy Hub, update Mini Foundry's workflow, or repair author data. Production behavior has not been verified end-to-end. The optional Linux browser smoke check was not run because its
playwright-cliprerequisite is unavailable.