ci: replace Vercel previews with UiPath Coded App previews#896
ci: replace Vercel previews with UiPath Coded App previews#896fikewa-olatunji wants to merge 3 commits into
Conversation
|
Apollo Coded App preview deployments are ready.
|
Dependency License Review
License distribution
Excluded packages
|
There was a problem hiding this comment.
Pull request overview
This PR replaces the existing Vercel-based preview deployment system with per-PR preview deployments hosted as UiPath Coded Apps (via @uipath/uip-go). It also introduces “coded-app” build gating for the Next.js-based apps (docs/vertex) so they can be statically exported under a sub-path, and updates the Apollo Vertex AI Chat demo to support direct platform calls in coded-app previews.
Changes:
- Removes the Vercel preview workflow and adds a new GitHub Actions workflow that deploys/updates/cleans up UiPath Coded App previews per PR and posts preview links back to the PR.
- Adds
.uip-go.jsondeployment recipes (build/export/postprocess/pagefind/AI Chat redirect metadata) and ignores local packaging artifacts. - Updates
apollo-docsandapollo-vertexto support static exports under a basePath and to avoid redirects that can’t be served in static export mode; updates Vertex AI Chat to use coded-app-injected platform settings.
Reviewed changes
Copilot reviewed 14 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| turbo.json | Adds APOLLO_CODED_APP* env vars to Turbo build hashing to avoid cache collisions between coded-app and regular builds. |
| pnpm-lock.yaml | Lockfile update to reflect the new pagefind dependency. |
| apps/apollo-vertex/templates/AiChatTemplate.tsx | Passes coded-app-specific auth config into the chat/auth providers and adds a coded-app “disabled” state. |
| apps/apollo-vertex/templates/ai-chat/AiChatLoginGate.tsx | Uses baked-in org/tenant info for coded-app builds and adjusts identity logout origin for direct platform auth. |
| apps/apollo-vertex/templates/ai-chat/AiChatAgentHubMode.tsx | Switches Data Fabric / AgentHub base URLs to direct platform calls when in coded-app mode. |
| apps/apollo-vertex/templates/ai-chat/ai-chat-example-utils.ts | Adds coded-app-aware env plumbing for AI Chat configuration (base URL, redirect path, org/tenant injection). |
| apps/apollo-vertex/next.config.ts | Adds coded-app static export mode + basePath handling and injects NEXT_PUBLIC_* AI Chat values for previews. |
| apps/apollo-vertex/mdx.d.ts | Adds MDX module typing to support importing .mdx files into TS/TSX. |
| apps/apollo-vertex/app/layout.tsx | Prefixes the logo path with the coded-app basePath to make static export assets resolve correctly. |
| apps/apollo-vertex/app/components/page.tsx | Replaces redirect with inline MDX rendering in coded-app static export mode. |
| apps/apollo-docs/package.json | Adds pagefind as a devDependency for coded-app/static export indexing. |
| apps/apollo-docs/next.config.mjs | Adds coded-app static export mode + basePath handling for previews. |
| apps/apollo-docs/mdx.d.ts | Adds MDX module typing to support importing .mdx files into TS/TSX. |
| apps/apollo-docs/app/page.tsx | Replaces redirect with inline MDX rendering in coded-app static export mode. |
| .uip-go.json | Adds uip-go deployment recipes for docs/landing/design/vertex coded-app previews (including AI Chat redirect metadata). |
| .gitignore | Ignores local UiPath coded-app packaging artifacts. |
| .github/workflows/vercel-deploy.yml | Removes the Vercel preview deployment workflow. |
| .github/workflows/preview-deploy.yml | Adds the coded-app preview deployment workflow (deploy, PR comment update, cleanup). |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
📊 Coverage + size by packagePer-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.
"Coverage" is each package's own |
02aba86 to
2cfffe1
Compare
CalinaCristian
left a comment
There was a problem hiding this comment.
this PR removes the functionality of having previews of merged to develop (production) pages.
We need to maintain this
2cfffe1 to
ff62fd1
Compare
ff62fd1 to
81ca2bc
Compare
|
@CalinaCristian good catch, restored in the latest push. Merged pages now stay deployed too: a new |
81ca2bc to
a0f403b
Compare
a0f403b to
f1798a8
Compare
f1798a8 to
1f71289
Compare
Deploys per-PR previews of apollo-docs, apollo-landing, apollo-design, and apollo-vertex as UiPath Coded Apps via @uipath/uip-go 0.2.1, replacing the Vercel preview workflow. All deployment knowledge lives in this repo, so deploy changes never require a uip-go release: - .uip-go.json holds the four deployment recipes (staged Next.js static exports, pagefind indexing, static-next-export post-processing, AI Chat platform context via aiChat redirectPath + scope) - APOLLO_CODED_APP=1 gates static-export mode in the docs and vertex next configs (basePath from APOLLO_CODED_APP_PATH); index pages render the overview inline in coded app builds since static exports cannot redirect - the vertex AI Chat demo reads NEXT_PUBLIC_APOLLO_VERTEX_AICHAT_* (mapped from the UIP_GO_AICHAT_* values uip-go resolves at deploy time) to call the platform directly; dev keeps the same-origin proxies, and the demo renders a disabled state when no client id is configured - the preview workflow builds, deploys, comments preview links, registers the AI Chat redirect URI, and cleans up on PR close (checkout of the PR head so the recipes are present; app deletion stays best-effort) - turbo hashes APOLLO_CODED_APP/APOLLO_CODED_APP_PATH; pagefind is a real devDependency of apollo-docs
1f71289 to
77e491b
Compare
The four preview apps were deploying sequentially in one job (~8 min wall clock = sum of all four builds). Split into a per-app matrix (fail-fast: false) so each app builds and deploys on its own runner in parallel, matching the structure the Vercel workflow already used. Wall clock now floors at the slowest single app (apollo-design Storybook) rather than the sum. - Each leg writes url/outcome to a deploy-result-<app> artifact; a new update-comment job fans them in to rebuild the PR comment (same pattern as vercel-deploy.yml), replacing the single deploy job's outputs. - Per-app Turborepo cache keys so parallel legs don't race on one shared key. - --auth-client-id (platformAuth) applied only to the apollo-vertex leg, which is also the only leg that requires UIPATH_RUNTIME_CLIENT_ID. - Cleanup job unchanged.
| ## 🎨 Live Demos | ||
|
|
||
| Explore our components in interactive Storybook environments: | ||
| Explore our components in interactive Storybook environments. The sites are hosted as UiPath Coded Apps on the staging environment (internal access): |
There was a problem hiding this comment.
not internal access, they are public
There was a problem hiding this comment.
The Coded App demo sites are publicly reachable, not internal-access. Per review feedback on #896.
| const codedApp = process.env.APOLLO_CODED_APP === "1"; | ||
| const codedAppPath = process.env.APOLLO_CODED_APP_PATH?.replaceAll( | ||
| /^\/+|\/+$/g, | ||
| "", | ||
| ); |
| tenantName: orgTenant.tenantName, | ||
| clientId: AICHAT_CLIENT_ID, | ||
| redirectUri: `${origin}/auth_callback`, | ||
| redirectUri: `${origin}${AICHAT_REDIRECT_PATH}`, |
There was a problem hiding this comment.
seems weird we have to change this? Why make this an env variable?
| // In Coded App builds the identity endpoints live on the platform host, | ||
| // not on the origin serving the static export. | ||
| const identityOrigin = AICHAT_DIRECT_BASE_URL || window.location.origin; |
There was a problem hiding this comment.
No need for this fallback?
| // survives and the disabled-state check in AiChatTemplate can detect a | ||
| // missing client id. The dev fallbacks only apply when the vars are truly | ||
| // undefined, which never happens in a coded-app build. | ||
| export const AICHAT_CLIENT_ID = |
There was a problem hiding this comment.
Why do we have all of these fallbacks here?
| if (AICHAT_IS_CODED_APP && (!AICHAT_DIRECT_BASE_URL || !AICHAT_CLIENT_ID)) { | ||
| return ( | ||
| <div className="flex h-full min-h-[500px] flex-col items-center justify-center rounded-lg border bg-card px-6 text-center"> | ||
| <p className="text-base font-medium text-foreground"> | ||
| AI Chat is not configured for this deployment | ||
| </p> | ||
| <p className="mt-2 max-w-xl text-sm text-muted-foreground"> | ||
| The demo needs an AI Chat External App client id and platform context | ||
| at build time to call UiPath services directly. This deployment was | ||
| built without them, so the demo is disabled. The rest of Apollo Vertex | ||
| is fully available. | ||
| </p> | ||
| </div> | ||
| ); | ||
| } |
There was a problem hiding this comment.
We can't just disable this when deploying
There was a problem hiding this comment.
logging in to the ai chat doesn't work on previews https://engdogfood.staging.uipath.host/apollo-vertex-pr-896/patterns/ai-chat/ but if I remember correctly they didn't for Vercel previews either due to us not being able to whitelist preview urls in first party service metadata. perhaps that is doable now, but until then, maybe we should disable it / give a proper message?
It currently works for me. Do you have access to engdogfood org in staging? |

Summary
Deploys apollo-docs, apollo-landing, apollo-design, and apollo-vertex as UiPath Coded Apps via
@uipath/uip-go, replacing the Vercel deployments — both per-PR previews and the stable production sites for merged pages.All deployment knowledge is owned by this repo, so deploy changes never require a uip-go release:
.uip-go.jsondefines the four deployment recipes (build commands, staged Next.js static exports, pagefind indexing, post-processing, AI Chat platform context).APOLLO_CODED_APP=1switches the docs/vertex next configs tooutput: "export"with a basePath fromAPOLLO_CODED_APP_PATH, and the root/components index pages render the overview inline (static exports cannot redirect).NEXT_PUBLIC_APOLLO_VERTEX_AICHAT_*(mapped innext.config.tsfrom theUIP_GO_AICHAT_*values uip-go resolves at deploy time) to call the platform directly — direct AgentHub/Data Fabric URLs, pinned org/tenant, identity logout origin, and the canonical OAuth redirect path. Dev keeps the same-origin proxy behavior via the existing fallbacks. Without a client id the chat renders a clear disabled state.preview-deploy.yml): builds and deploys each app per PR, posts a status comment with preview links, auto-registers the AI Chat redirect URI, and cleans up apps + redirect URIs on PR close (checks out the PR head so the recipes are present; app deletion is best-effort due to a platform auth limitation).production-deploy.yml): on every push tomain, updates the stable Coded Apps of the merged pages (apollo-docs,apollo-landing,apollo-design,apollo-vertex) — same recipes and deploy pattern, stable names/paths. The README demo links point at these.APOLLO_CODED_APP,APOLLO_CODED_APP_PATH, andUIP_GO_AICHAT_*so coded-app and regular builds never share cache entries;pagefindis a proper devDependency of each app that needs it.Verification
main.