Skip to content

ci: replace Vercel previews with UiPath Coded App previews#896

Open
fikewa-olatunji wants to merge 3 commits into
mainfrom
feat/coded-app-previews
Open

ci: replace Vercel previews with UiPath Coded App previews#896
fikewa-olatunji wants to merge 3 commits into
mainfrom
feat/coded-app-previews

Conversation

@fikewa-olatunji

@fikewa-olatunji fikewa-olatunji commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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.json defines the four deployment recipes (build commands, staged Next.js static exports, pagefind indexing, post-processing, AI Chat platform context).
  • Env-gated app sources: APOLLO_CODED_APP=1 switches the docs/vertex next configs to output: "export" with a basePath from APOLLO_CODED_APP_PATH, and the root/components index pages render the overview inline (static exports cannot redirect).
  • AI Chat runs live in previews and production: the demo reads NEXT_PUBLIC_APOLLO_VERTEX_AICHAT_* (mapped in next.config.ts from the UIP_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 workflow (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 workflow (production-deploy.yml): on every push to main, 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.
  • Turbo hashes APOLLO_CODED_APP, APOLLO_CODED_APP_PATH, and UIP_GO_AICHAT_* so coded-app and regular builds never share cache entries; pagefind is a proper devDependency of each app that needs it.

Verification

  • Deploy pipeline verified end-to-end: all four previews deploy Ready and return 200, including the vertex AI Chat page.
  • AI Chat verified on a deployed Coded App preview: sign-in with the canonical redirect URI, AgentHub and Conversational Agent modes, and Data Fabric chart tools all work against staging.
  • Regular (non-preview) builds are unaffected: coded-app behavior is gated behind env vars that are unset in dev/prod.
  • The production workflow reuses the exact deploy pattern of the preview workflow (same recipes, secrets, and uip-go invocation) with stable app names; it runs on merge to main.

Copilot AI review requested due to automatic review settings July 9, 2026 10:38
@fikewa-olatunji
fikewa-olatunji requested a review from a team as a code owner July 9, 2026 10:38
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Apollo Coded App preview deployments are ready.

Project Status Preview Updated (PT)
apollo-design Ready Preview · Logs Jul 13, 2026, 07:02:14 PM
apollo-docs Ready Preview · Logs Jul 13, 2026, 07:02:14 PM
apollo-landing Ready Preview · Logs Jul 13, 2026, 07:02:14 PM
apollo-vertex Ready Preview · Logs Jul 13, 2026, 07:02:14 PM

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • 1948 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1718
ISC 89
Apache-2.0 55
BSD-3-Clause 27
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
MIT-0 3
CC0-1.0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.2.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json deployment recipes (build/export/postprocess/pagefind/AI Chat redirect metadata) and ignores local packaging artifacts.
  • Updates apollo-docs and apollo-vertex to 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

Comment thread apps/apollo-vertex/templates/AiChatTemplate.tsx
Comment thread apps/apollo-vertex/templates/ai-chat/ai-chat-example-utils.ts Outdated
Comment thread .github/workflows/preview-deploy.yml
Comment thread .github/workflows/preview-deploy.yml
Comment thread apps/apollo-vertex/templates/ai-chat/ai-chat-example-utils.ts
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core 9.0% 43.82 MB 57.31 MB ±0
@uipath/apollo-react 34.5% — (26 untracked) 7.27 MB 27.62 MB ±0
@uipath/apollo-wind 40.3% 395.0 KB 2.57 MB −6 B
@uipath/ap-chat 85.8% 43.41 MB 55.85 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

Copilot AI review requested due to automatic review settings July 9, 2026 10:51
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from 02aba86 to 2cfffe1 Compare July 9, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 18 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread .github/workflows/preview-deploy.yml
Comment thread .github/workflows/preview-deploy.yml

@CalinaCristian CalinaCristian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR removes the functionality of having previews of merged to develop (production) pages.

We need to maintain this

Copilot AI review requested due to automatic review settings July 9, 2026 22:04
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from 2cfffe1 to ff62fd1 Compare July 9, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread turbo.json Outdated
Comment thread apps/apollo-vertex/templates/AiChatTemplate.tsx
Copilot AI review requested due to automatic review settings July 9, 2026 22:15
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from ff62fd1 to 81ca2bc Compare July 9, 2026 22:15
@fikewa-olatunji

fikewa-olatunji commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@CalinaCristian good catch, restored in the latest push. Merged pages now stay deployed too: a new production-deploy.yml runs on every push to main and updates stable Coded Apps of the same four sites (apollo-docs / apollo-landing / apollo-design / apollo-vertex, e.g. https://engdogfood.staging.uipath.host/apollo-vertex/), with AI Chat enabled on vertex. So production pages move from Vercel to Coded Apps along with the PR previews, and the README demo links now point at the stable apps.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread .uip-go.json
Copilot AI review requested due to automatic review settings July 9, 2026 22:26
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from 81ca2bc to a0f403b Compare July 9, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Copilot AI review requested due to automatic review settings July 10, 2026 22:43
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from a0f403b to f1798a8 Compare July 10, 2026 22:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread turbo.json
Comment thread README.md
Copilot AI review requested due to automatic review settings July 10, 2026 22:58
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from f1798a8 to 1f71289 Compare July 10, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread apps/apollo-vertex/templates/AiChatTemplate.tsx
Comment thread .uip-go.json Outdated
Comment thread .uip-go.json Outdated
Comment thread .uip-go.json Outdated
Comment thread .uip-go.json Outdated
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
Copilot AI review requested due to automatic review settings July 10, 2026 23:05
@fikewa-olatunji
fikewa-olatunji force-pushed the feat/coded-app-previews branch from 1f71289 to 77e491b Compare July 10, 2026 23:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

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.
Copilot AI review requested due to automatic review settings July 13, 2026 21:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment thread README.md Outdated
## 🎨 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):

@CalinaCristian CalinaCristian Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not internal access, they are public

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Coded App demo sites are publicly reachable, not internal-access.
Per review feedback on #896.
Copilot AI review requested due to automatic review settings July 14, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 20 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Comment on lines +11 to +15
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}`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems weird we have to change this? Why make this an env variable?

Comment on lines +195 to +197
// 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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have all of these fallbacks here?

Comment on lines +87 to +101
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>
);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't just disable this when deploying

@pieman1313 pieman1313 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@fikewa-olatunji

Copy link
Copy Markdown
Contributor Author

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?
Screenshot 2026-07-13 at 11 35 19 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants