Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
4ab72c3
refactor(mobile): put iOS-only APIs behind platform seams for Android
Kitenite Oct 29, 2026
567c518
feat(mobile): React Native composer for Android
Kitenite Oct 29, 2026
33661e6
feat(mobile): Android App Links and EAS build/submit config
Kitenite Oct 29, 2026
019ecc1
feat(mobile): real Android fallbacks for small seams, glass and sheet…
Kitenite Oct 29, 2026
c3bfc1a
feat(mobile): Android agent card as an ongoing notification
Kitenite Oct 29, 2026
ad676cd
fix(mobile): boot on Android — Chinese Intl fallback, Apple error, An…
Kitenite Oct 29, 2026
8d102b6
feat(mobile): native Google sign-in on Android, no Apple button there
Kitenite Oct 29, 2026
5f41d55
feat(mobile): Android sheet header, content inset under headers, fall…
Kitenite Oct 29, 2026
4021cad
fix(mobile): keep focus and sit above the keyboard in the Android com…
Kitenite Oct 29, 2026
a1e7b3b
Merge android/01-boot-spike (8d102b642f) into Android integration
Kitenite Oct 29, 2026
6fee791
Merge android/02-composer (4021cad233) into Android integration
Kitenite Oct 29, 2026
c60e845
Merge android/03-sheets-design (5f41d550b5) into Android integration
Kitenite Oct 29, 2026
c9a35e0
Merge android/04-release-plumbing (33661e6104) into Android integration
Kitenite Oct 29, 2026
f5b497c
Merge android/05-live-activity-push (c3bfc1ac21) into Android integra…
Kitenite Oct 29, 2026
c7ca5b4
feat(mobile): Android dev setup, launch checklist and Play listing
Kitenite Oct 29, 2026
b220ddc
docs(mobile): Android checklist progress — Play account, keystore, OA…
Kitenite Oct 30, 2026
e8448d7
docs(mobile): Play phone screenshots (drafts) and review-account fix …
Kitenite Oct 30, 2026
d781db0
feat(mobile): android-dev.sh targets one emulator via ANDROID_SERIAL
Kitenite Oct 30, 2026
7fa752b
fix(mobile): keep the Android query cache in a file, not one AsyncSto…
Kitenite Oct 30, 2026
763f11a
fix(mobile): show the error when social sign-in fails
Kitenite Oct 30, 2026
2c569e7
feat(mobile): ask for notification permission when the first agent ca…
Kitenite Oct 30, 2026
ef0d0c3
feat(mobile): Android agent card says "Not updating" when stale and o…
Kitenite Oct 30, 2026
4e2b602
fix(mobile): android-dev.sh never reuses another worktree's Metro port
Kitenite Oct 30, 2026
17d0be8
fix(mobile): terminal composer draws on Android
Kitenite Oct 30, 2026
fd530b2
feat(mobile): Android composer session tabs, quick keys, slash sugges…
Kitenite Oct 30, 2026
00ce3bd
docs(mobile): Android versionCode strategy, release check and manual …
Kitenite Oct 30, 2026
5f19a04
docs(mobile): tick Android checklist items that landed on staging
Kitenite Oct 30, 2026
a69d714
fix(mobile): give host-service requests a 60 s deadline so Android ca…
Kitenite Oct 30, 2026
d5a2065
fix(mobile): show header actions on Android through a toolbarIcon seam
Kitenite Oct 30, 2026
871b18f
fix(mobile): a search field in the Android search sheet
Kitenite Oct 30, 2026
6a6d654
fix(mobile): Android sheet header never shows the route name
Kitenite Oct 30, 2026
c8fa51f
fix(mobile): page comment pins line up with the page on Android
Kitenite Oct 30, 2026
6d53625
fix(mobile): Send to chat on the Android diff screen; filled on-state…
Kitenite Oct 30, 2026
5f2c1ea
fix(mobile): start text at the top of the line comment and review fields
Kitenite Oct 30, 2026
40f01df
fix(mobile): type errors in the Android search field and icon script
Kitenite Oct 30, 2026
e2e1cde
fix(mobile): Android search field grows with the text size
Kitenite Oct 30, 2026
20e941c
chore(mobile): Material Symbols menu icons and a Compose host theme f…
Kitenite Oct 30, 2026
d527a58
fix(mobile): composer + opens a native attachments sheet on Android
Kitenite Oct 30, 2026
fa67fd4
feat(mobile): native Material menus on Android for ValueMenu, FileAct…
Kitenite Oct 30, 2026
a0ad3a4
feat(mobile): rename prompt is a Compose AlertDialog on Android
Kitenite Oct 30, 2026
d7cd2df
feat(mobile): SymbolButton menus are native on Android
Kitenite Oct 30, 2026
e2d8a34
docs(mobile): native on every platform, React Native as the fallback
Kitenite Oct 30, 2026
877a7aa
refactor(mobile): the React Native composer is the shared fallback
Kitenite Oct 30, 2026
457602a
fix(mobile): API calls on web use the browser's session cookie
Kitenite Oct 30, 2026
a2a4b2f
fix(mobile): workspace rows open on web, with a right-click menu
Kitenite Oct 30, 2026
9b6545f
feat(mobile): the terminal runs in an iframe on web
Kitenite Oct 30, 2026
df12206
feat(mobile): attach images and files on web with the browser's file …
Kitenite Oct 30, 2026
7228ad7
fix(mobile): Alert.alert reaches the user on web
Kitenite Oct 30, 2026
5efe8bc
fix(mobile): no browser focus ring around the composer field
Kitenite Oct 30, 2026
e468ae5
fix(mobile): type errors in the web alert and the session headers
Kitenite Oct 30, 2026
831ad0f
feat(mobile): GlassSurface is a backdrop-filter blur on web
Kitenite Oct 30, 2026
8f30d6f
feat(mobile): voice mode uses the browser's WebRTC on web
Kitenite Oct 30, 2026
c5ab847
fix(mobile): social sign-in on web returns to the app, not the API
Kitenite Oct 30, 2026
5a06b8f
fix(mobile): web attachments sheet keeps the root host's exports
Kitenite Oct 30, 2026
6bf0cba
fix(mobile): dev sign-in flow parses on Maestro 2
Kitenite Oct 30, 2026
1d06e41
feat(mobile): Android composer module for SpeechRecognizer, clipboard…
Kitenite Oct 30, 2026
c43f8df
feat(mobile): voice mode owns the Android audio route (focus, speaker…
Kitenite Oct 30, 2026
18dfc26
feat(mobile): dictation seam for the React Native composer (Android r…
Kitenite Oct 30, 2026
4ff8ca8
fix(mobile): Android attachments sheet hides before it settles, so Fi…
Kitenite Oct 30, 2026
d55bf51
fix(mobile): drop the silence-length extra Google's recogniser ignores
Kitenite Oct 30, 2026
c494c8d
feat(mobile): composer mic, attachment paste, document thumbnails and…
Kitenite Oct 30, 2026
771de09
chore(i18n): translate the composer dictation and paste strings
Kitenite Oct 30, 2026
2c3be6f
docs(mobile): Android verification skill covers Maestro 2 syntax, low…
Kitenite Oct 30, 2026
b25bfd1
docs(mobile): Android composer plan and launch checklist after dictat…
Kitenite Oct 30, 2026
33e4e52
feat(mobile): header buttons and menus on web through a HeaderToolbar…
Kitenite Oct 30, 2026
5edc009
fix(mobile): chat messages render on web
Kitenite Oct 30, 2026
705e878
fix(mobile): diffs and code blocks highlight on web
Kitenite Oct 30, 2026
4c40246
feat(mobile): voice orb animates on web
Kitenite Oct 30, 2026
c6f39ff
feat(mobile): pages open in an iframe on web
Kitenite Oct 30, 2026
fd6f36d
fix(mobile): sent attachments open on web
Kitenite Oct 30, 2026
cd35ad6
feat(mobile): Alert.alert on web shows all its buttons in one dialog
Kitenite Oct 30, 2026
267ce74
fix(mobile): no resize grip on text fields on web
Kitenite Oct 30, 2026
f92ab6c
fix(mobile): version gate on web reads the app config version
Kitenite Oct 30, 2026
a0156d1
feat(api): allow the mobile web origins set in MOBILE_WEB_ORIGINS
Kitenite Oct 30, 2026
1ada39b
fix(mobile): markdown lists keep their bullets and text fields lose t…
Kitenite Oct 30, 2026
2845fd1
feat(mobile): invite search field on web
Kitenite Oct 30, 2026
69175b9
fix(mobile): Android drawables whose path starts with a relative move…
Kitenite Oct 30, 2026
ed0632b
feat(mobile): Android header icons for PR overflow and link, check fi…
Kitenite Oct 30, 2026
41c24a3
fix(mobile): web chat follows the bottom only while the reader is the…
Kitenite Oct 30, 2026
0cf6eff
fix(mobile): text areas show a focus ring for keyboard focus on web
Kitenite Oct 30, 2026
1202515
fix(mobile): web alert takes focus on its first button, not the backdrop
Kitenite Oct 30, 2026
4004fe7
fix(mobile): the update gate names Google Play on Android and asks fo…
Kitenite Oct 30, 2026
a6dfdb5
feat(mobile): sent file attachments open in the platform viewer
Kitenite Oct 30, 2026
5545f01
fix(mobile): a sent attachment's local copy keeps its original name
Kitenite Oct 30, 2026
0f83625
Merge remote-tracking branch 'origin/main' into android/staging
Kitenite Oct 31, 2026
a058d6b
fix(mobile): Google Play link reads the package name at runtime
Kitenite Oct 31, 2026
2a885ae
fix(mobile): translate the scroll-to-bottom button label
Kitenite Oct 31, 2026
f0f62d2
fix(marketing): prose lint reads CTASection from its new Footer path
Kitenite Oct 31, 2026
5e4cd1e
feat(mobile): build the web target under /agents
Kitenite Oct 31, 2026
e65209d
feat(mobile): serve the /agents web build locally and send its analyt…
Kitenite Oct 31, 2026
8c6617e
feat(web): serve the agents web app at /agents
Kitenite Oct 31, 2026
6399c79
feat(web): link the dashboard to /agents and offer it when a workspac…
Kitenite Oct 31, 2026
a4dc002
ci: deploy the agents web export with the preview and production deploys
Kitenite Oct 31, 2026
3f42fe2
fix(web): rewrite /agents pages in the proxy so they get the /agents CSP
Kitenite Oct 31, 2026
89ebd07
fix(mobile): write the web build scripts on Node APIs so mobile tsc s…
Kitenite Oct 31, 2026
d954e1d
fix(web): /agents stays off until AGENTS_URL and its Vercel project e…
Kitenite Oct 31, 2026
0d4d40f
fix(mobile): empty Home does not scroll on Android and web
Kitenite Nov 1, 2026
5eb6d57
fix(mobile): upgrade and manage-plan buttons name the web host they open
Kitenite Nov 1, 2026
3c6b6d4
fix(mobile): web tabs are titled after the screen, and Escape closes …
Kitenite Nov 1, 2026
2d0fa67
fix(mobile): web composer sends on Enter, breaks the line on Shift+En…
Kitenite Nov 1, 2026
fbdb73f
fix(mobile): a click on the web terminal lets you type into it
Kitenite Nov 1, 2026
d0913ba
fix(mobile): search takes typing as it opens on web, and Return opens…
Kitenite Nov 1, 2026
fa916bd
fix(mobile): diff code scrolls sideways with a trackpad or Shift+whee…
Kitenite Nov 1, 2026
f24057b
fix(mobile): Branch and the review comment menu open a choice on Andr…
Kitenite Nov 1, 2026
1b499ac
fix(mobile): holding a mouse on a web chat reply selects text instead…
Kitenite Nov 1, 2026
30073b4
fix(mobile): rows, chips and keys show hover on web, and web sheets d…
Kitenite Nov 1, 2026
fc8128c
test(mobile): web composer keys send, keep newlines and close
Kitenite Nov 1, 2026
7b1b0b0
refactor(mobile): the web composer key handler is a plain factory, no…
Kitenite Nov 1, 2026
e3509aa
fix(mobile): web sheets open as a dialog over the screen they came from
Kitenite Nov 1, 2026
431ee55
fix(mobile): back after a deep link goes to the parent screen
Kitenite Nov 1, 2026
1449234
fix(mobile): choices on Android open in a bottom sheet
Kitenite Nov 1, 2026
81b68df
fix(mobile): the search sheet has a close button on Android and web
Kitenite Nov 1, 2026
1fdac68
fix(mobile): the web composer keeps to the readable column on wide sc…
Kitenite Nov 1, 2026
289295c
fix(mobile): Home's wide grid keeps its side inset on web
Kitenite Nov 1, 2026
67f5a8a
fix(mobile): web chat reads in a centred column on wide screens
Kitenite Nov 1, 2026
338fc66
fix(mobile): web terminal gets inner padding and hides the quick keys…
Kitenite Nov 1, 2026
e3678e7
feat(mobile): workspace, search and session rows are links on web
Kitenite Nov 1, 2026
da7686f
docs(mobile): plan a workspace list beside the open workspace on wide…
Kitenite Nov 1, 2026
a3e5873
fix(mobile): Android sheets show their close button
Kitenite Nov 1, 2026
a5c6da4
fix(mobile): a cold deep link to a sheet no longer crashes Android
Kitenite Nov 1, 2026
baeb3f0
fix(mobile): a cold load of a Home sheet opens over Home
Kitenite Nov 1, 2026
01a2879
fix(mobile): web sheets fade and scale in and out, or slide on a narr…
Kitenite Nov 1, 2026
5351fec
fix(mobile): the filter and new-session pickers' close button has a l…
Kitenite Nov 1, 2026
8960a6b
chore(mobile): Android release config (changes the iOS runtime finger…
Kitenite Oct 29, 2026
c304325
fingerprint: Android home-screen label is the brand name; keep WorkMa…
Kitenite Oct 30, 2026
2045c36
fingerprint: add the Expo web target dependencies to mobile
Kitenite Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
100 changes: 100 additions & 0 deletions .agents/skills/mobile-android-verification/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
name: mobile-android-verification
description: Run and verify apps/mobile on a local Android emulator against this worktree's API and relay, with adb and Maestro for input. Use when asked to run, screenshot, verify, or reproduce a mobile change on Android. For iOS use mobile-sim-verification; with no local toolchain (a cloud sandbox) use mobile-eas-dev, which is iOS only.
---

# Mobile Android Verification

The Android counterpart to `mobile-sim-verification`. Its Rules apply here unchanged: use the real
screen, drive state through real services, run the edge pass, never show "unknown" as a negative,
record flashes, attribute failures correctly. This file is the Android mechanics.

`apps/mobile/scripts/android-dev.sh` does the setup. Read its header for the flags.

## Setup

```bash
apps/mobile/scripts/android-dev.sh --doctor # what is missing on this machine
apps/mobile/scripts/android-dev.sh # boot, build if needed, Metro, open the app
apps/mobile/scripts/android-dev.sh --user maya@local.test # also sign in as a dev account
```

- **Toolchain.** Android Studio's SDK (`~/Library/Android/sdk`) with an AVD, and JDK 17. Gradle for
RN 0.88 fails on the Java 8 that macOS often has on `PATH`; `brew install openjdk@17`. The script
finds both without `ANDROID_HOME` or `JAVA_HOME` set. For Google sign-in, the AVD needs a Google
Play system image and a Google account added on the device.
- **Services.** Start the API, relay and realtime as in `mobile-sim-verification` (each in a
Paradev terminal). The script reverses Metro, `API_PORT`, `RELAY_PORT`, `REALTIME_PORT` and
`WEB_PORT` with `adb reverse`, so `localhost` in the app reaches this machine. A port it does not
reverse fails in the app as a network error.
- **Build.** `android/` is generated by `expo prebuild` and gitignored. The first Gradle build takes
about 10 minutes; later ones reuse the daemon. The script builds only for the emulator's ABI.
JS/TS changes need no rebuild: `android-dev.sh --reload`.

## One emulator, many worktrees

Every worktree installs the same package, `sh.superset.mobile`, so the last install wins.

- The script writes the worktree path and native fingerprint of the installed APK to
`/data/local/tmp/superset-mobile-owner` on the device. A mismatch rebuilds, so another worktree's
APK is never tested by mistake. Check it before you report: `adb shell cat
/data/local/tmp/superset-mobile-owner`.
- Agents in parallel workspaces take turns. Ask with `superset agents` before you install or
launch, and say when you hand it back. Do not boot a second emulator next to a Gradle build: the
machine runs out of memory.
- Each worktree's Metro gets its own port (saved in `.tmp/android-dev/metro.port`). Stop it with
`--stop` when you are done.

## Traps

- **Stale Metro cache.** The transform cache is shared across worktrees. A stale entry fails the
Android bundle with a 500: ENOENT on `react-native-worklets/.worklets/<hash>.js`. The script
starts Metro with `--clear`; if you start Metro yourself, do the same.
- **Dev auto sign-in.** `EXPO_PUBLIC_DEV_ONE_TIME_TOKEN` in `.env` signs the app in at launch even
after `pm clear`. Blank it and restart Metro to see the sign-in screen.
- **Notification permission.** Home asks for `POST_NOTIFICATIONS` once, when the first agent card
would show, and remembers the answer. The script grants it up front; to see the prompt, run
`adb shell pm revoke sh.superset.mobile android.permission.POST_NOTIFICATIONS` and `pm clear`.
- **iOS-only header items.** SF Symbol `Stack.Toolbar` buttons and `Stack.SearchBar` do not render
on Android, and a form sheet draws no native bar there (see the sheet convention in
`apps/mobile/AGENTS.md`). An empty header on Android is not always a regression.
- **The iOS fingerprint.** `app.config.ts`, `eas.json`, `apps/mobile/.gitignore` and
`packages/shared/src/app-identity.ts` feed the iOS runtime version even for Android-only edits.
Changing them rebuilds and resubmits iOS on merge. Check with
`MOBILE_EAS_BUILD=1 node_modules/.bin/fingerprint fingerprint:generate . --platform ios` in
`apps/mobile`, and keep such a change in its own commit.
- **The Mobile pane** in the desktop app shows the same emulator (local hub, scrcpy stream). It
releases an emulator it booted 60 s after its pane closes, which ends an `adb` session on it. If
you booted the emulator yourself, the pane only shows it.

- **Low memory kills the dev app.** The dev build holds about 800 MB (Hermes runs the full dev
bundle). An AVD that booted from a 2 GB snapshot loses the app to the low-memory killer as soon as
a picker or Chrome opens (`lowmemorykiller: Kill 'sh.superset.mobile'` in logcat). Check
`adb shell cat /proc/meminfo`; if `MemTotal` is near 2 GB, restart that AVD with
`emulator -avd <avd> -port <port> -memory 4096 -no-snapshot-load`.
- **The emulator mic.** `adb emu avd hostmicon` feeds the Mac microphone to the AVD, so the
speech recogniser hears the room. Speech played through the Mac speakers often reaches it as
`NO_SPEECH_DETECTED`, and Google's recogniser needs about 5 s after the mic tap before it listens.

## Input and evidence

```bash
adb exec-out screencap -p > shot.png # or: android-dev.sh --shot shot.png
adb shell screenrecord /sdcard/run.mp4 # stop with Ctrl-C, then adb pull
adb shell uiautomator dump /sdcard/ui.xml && adb pull /sdcard/ui.xml # element bounds for taps
adb shell input tap X Y; adb shell input text 'hello'; adb shell input keyevent 4 # 4 = back
adb shell am start -a android.intent.action.VIEW -d 'superset://settings' sh.superset.mobile
adb logcat -d -s ReactNativeJS:V # JS console
adb logcat -d -b crash # native crashes
adb shell cmd statusbar expand-notifications # the agent card lives here
adb shell cmd locale set-app-locales sh.superset.mobile --locales de-DE # per-app locale
adb shell settings put system font_scale 1.3 # large text; reset to 1.0
```

Maestro runs on Android too: `maestro --device emulator-5554 test <flow>`, with `JAVA_HOME` on JDK 17.
`apps/mobile/.maestro/flows/dev-sign-in.yml` is the sign-in flow `--user` uses. Maestro 2 rejects a
flow where `optional: true` sits beside a command (`Invalid Command Format`); put it inside the
command's map. Check a flow with `maestro check-syntax <flow>` before running it.

Reset the locale and font scale, stop Metro (`--stop`) and the services, and remove test data when
done. Leave the emulator running if another agent is waiting for it.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ NEXT_PUBLIC_DOCS_URL=
NEXT_PUBLIC_ROOT_DOMAIN=
# Desktop name in menus, the Dock and dialogs; productName stays "Superset".
DESKTOP_DISPLAY_NAME=
# Origins that serve the mobile app on the web, comma-separated, no wildcards.
# The API allows them for CORS and sign-in; unset = none.
MOBILE_WEB_ORIGINS=

# -----------------------------------------------------------------------------
# Mobile (Expo) — read at Metro bundle time; EAS builds get these from eas.json
# -----------------------------------------------------------------------------
EXPO_PUBLIC_API_URL=
EXPO_PUBLIC_ROOT_DOMAIN=
EXPO_PUBLIC_POSTHOG_KEY=
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=
EXPO_PUBLIC_SENTRY_DSN_MOBILE=
EXPO_PUBLIC_SENTRY_ENVIRONMENT=
# App Review demo account, read by apps/mobile/store.config.js for `eas metadata:push`
Expand Down Expand Up @@ -139,6 +143,9 @@ R2_ENDPOINT=
# Where pages are served from, one subdomain per page under it (apps/usercontent):
# https://frame.supersetusercontent.com
USERCONTENT_URL=
# The agents web app (apps/mobile web export), which apps/web serves at /agents:
# https://superset-agents.vercel.app
AGENTS_URL=
# App-referenced files with tickets (apps/usercontent, same Worker); must match
# the Worker's own MEDIA_URL: https://media.supersetusercontent.com
MEDIA_URL=
Expand Down
6 changes: 6 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ NEXT_PUBLIC_MARKETING_URL=http://localhost:3002
NEXT_PUBLIC_DOCS_URL=http://localhost:3004
NEXT_PUBLIC_ROOT_DOMAIN=
DESKTOP_DISPLAY_NAME=
# `expo start --web` in apps/mobile
MOBILE_WEB_ORIGINS=http://localhost:8081

# -----------------------------------------------------------------------------
# Mobile (Expo) — setup.local.sh overrides these with allocated ports.
# -----------------------------------------------------------------------------
EXPO_PUBLIC_API_URL=http://localhost:3001
EXPO_PUBLIC_ROOT_DOMAIN=
EXPO_PUBLIC_POSTHOG_KEY=phc_local_dev_disabled
EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID=
# A syntactically valid but inert DSN: @sentry/react-native's useNativeInit
# crashes the app on launch (SIGSEGV, before any JS runs) if this fails to
# parse as a URL, which an empty or missing value does. Needs a well-formed
Expand Down Expand Up @@ -129,6 +132,9 @@ R2_ENDPOINT=http://localhost:9000
USERCONTENT_URL=http://frame.usercontent.localhost:8787
MEDIA_URL=http://media.usercontent.localhost:8787
STATIC_URL=http://static.usercontent.localhost:8787
# Setup writes AGENTS_PORT (base+19) and this URL; serve the agents web export
# there with apps/mobile/scripts/serve-web.ts (docs/agents-web.md).
AGENTS_URL=http://localhost:3019
USERCONTENT_TOKEN_SECRET=local-dev-usercontent-secret-change-me-32
AGENT_WORKER_SECRET=local-dev-agent-worker-secret-change-me-32
AGENT_TURN_SIGNING_SECRET=local-dev-agent-turn-signing-secret-change-me-32
Expand Down
5 changes: 5 additions & 0 deletions .github/templates/preview-comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<td>$WEB_LINK</td>
</tr>
<tr>
<td><img src="https://vercel.com/favicon.ico" width="20" height="20" alt="Vercel"> <strong>Agents Web (Vercel)</strong></td>
<td align="center">$AGENTS_STATUS</td>
<td>$AGENTS_LINK</td>
</tr>
<tr>
<td><img src="https://vercel.com/favicon.ico" width="20" height="20" alt="Vercel"> <strong>Marketing (Vercel)</strong></td>
<td align="center">$MARKETING_STATUS</td>
<td>$MARKETING_LINK</td>
Expand Down
94 changes: 92 additions & 2 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
PR_NUMBER: ${{ github.event.pull_request.number }}
API_ALIAS: api-pr-${{ github.event.pull_request.number }}-superset.vercel.app
WEB_ALIAS: web-pr-${{ github.event.pull_request.number }}-superset.vercel.app
AGENTS_ALIAS: agents-pr-${{ github.event.pull_request.number }}-superset.vercel.app
MARKETING_ALIAS: marketing-pr-${{ github.event.pull_request.number }}-superset.vercel.app
ADMIN_ALIAS: admin-pr-${{ github.event.pull_request.number }}-superset.vercel.app
DOCS_ALIAS: docs-pr-${{ github.event.pull_request.number }}-superset.vercel.app
Expand Down Expand Up @@ -172,6 +173,7 @@ jobs:
GOOGLE_CONNECTIONS_CLIENT_SECRET: ${{ secrets.GOOGLE_CONNECTIONS_CLIENT_SECRET }}
GH_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }}
GH_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }}
MOBILE_WEB_ORIGINS: ${{ secrets.MOBILE_WEB_ORIGINS }}
NEXT_PUBLIC_SENTRY_DSN_API: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN_API }}
NEXT_PUBLIC_SENTRY_ENVIRONMENT: ${{ secrets.NEXT_PUBLIC_SENTRY_ENVIRONMENT }}
NEXT_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}
Expand Down Expand Up @@ -255,6 +257,7 @@ jobs:
--env GOOGLE_CONNECTIONS_CLIENT_SECRET=$GOOGLE_CONNECTIONS_CLIENT_SECRET \
--env GH_CLIENT_ID=$GH_CLIENT_ID \
--env GH_CLIENT_SECRET=$GH_CLIENT_SECRET \
--env MOBILE_WEB_ORIGINS=$MOBILE_WEB_ORIGINS \
--env NEXT_PUBLIC_SENTRY_DSN_API=$NEXT_PUBLIC_SENTRY_DSN_API \
--env NEXT_PUBLIC_SENTRY_ENVIRONMENT=$NEXT_PUBLIC_SENTRY_ENVIRONMENT \
--env NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY \
Expand Down Expand Up @@ -409,6 +412,7 @@ jobs:
SERVER_ANTHROPIC_API_KEY: ${{ secrets.SERVER_ANTHROPIC_API_KEY }}
RELAY_URL: ${{ secrets.RELAY_URL }}
RELAY_BACKUP_URL: ${{ secrets.RELAY_BACKUP_URL }}
AGENTS_URL: https://${{ env.AGENTS_ALIAS }}
run: |
vercel pull --yes --environment=preview --token=$VERCEL_TOKEN
vercel build --token=$VERCEL_TOKEN
Expand All @@ -418,6 +422,7 @@ jobs:
--env BETTER_AUTH_SECRET=$BETTER_AUTH_SECRET \
--env NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL \
--env NEXT_PUBLIC_WEB_URL=$NEXT_PUBLIC_WEB_URL \
--env AGENTS_URL=$AGENTS_URL \
--env NEXT_PUBLIC_MARKETING_URL=$NEXT_PUBLIC_MARKETING_URL \
--env NEXT_PUBLIC_ROOT_DOMAIN=$NEXT_PUBLIC_ROOT_DOMAIN \
--env NEXT_PUBLIC_ADMIN_URL=$NEXT_PUBLIC_ADMIN_URL \
Expand Down Expand Up @@ -465,6 +470,85 @@ jobs:
name: web-status
path: web-status.env

deploy-agents:
name: Deploy Agents Web
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
environment:
name: preview
url: https://${{ env.WEB_ALIAS }}/agents

steps:
- name: Check the agents project is configured
id: agents-config
env:
AGENTS_PROJECT_ID: ${{ secrets.VERCEL_AGENTS_PROJECT_ID }}
run: echo "configured=$([ -n "$AGENTS_PROJECT_ID" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"

- name: Checkout repository
if: steps.agents-config.outputs.configured == 'true'
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

- name: Setup Bun
if: steps.agents-config.outputs.configured == 'true'
id: setup-bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: .bun-version

- name: Cache dependencies
if: steps.agents-config.outputs.configured == 'true'
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ steps.setup-bun.outputs.bun-revision }}-${{ hashFiles('bun.lock') }}

- name: Install dependencies
if: steps.agents-config.outputs.configured == 'true'
run: bun install --frozen --ignore-scripts

- name: Compile translations
if: steps.agents-config.outputs.configured == 'true'
run: bun run --filter=@superset/i18n build

- name: Install Vercel CLI
if: steps.agents-config.outputs.configured == 'true'
run: bun add --global vercel@$VERCEL_CLI_VERSION

- name: Build and Deploy Agents Web
if: steps.agents-config.outputs.configured == 'true'
working-directory: apps/mobile
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_AGENTS_PROJECT_ID }}
EXPO_PUBLIC_API_URL: https://${{ env.API_ALIAS }}
EXPO_PUBLIC_WEB_URL: https://${{ env.WEB_ALIAS }}
EXPO_PUBLIC_RELAY_URL: ${{ secrets.RELAY_URL }}
EXPO_PUBLIC_REALTIME_URL: ${{ secrets.REALTIME_URL }}
EXPO_PUBLIC_POSTHOG_KEY: ${{ secrets.NEXT_PUBLIC_POSTHOG_KEY }}
EXPO_PUBLIC_SENTRY_DSN_MOBILE: ${{ secrets.EXPO_PUBLIC_SENTRY_DSN_MOBILE }}
EXPO_PUBLIC_SENTRY_ENVIRONMENT: ${{ secrets.NEXT_PUBLIC_SENTRY_ENVIRONMENT }}
run: |
bun scripts/build-web.ts
VERCEL_URL=$(vercel deploy --prebuilt --archive=tgz --token=$VERCEL_TOKEN)
vercel alias $VERCEL_URL ${{ env.AGENTS_ALIAS }} --scope=$VERCEL_ORG_ID --token=$VERCEL_TOKEN

- name: Save agents success status
if: steps.agents-config.outputs.configured == 'true'
run: |
cat > agents-status.env << EOF
AGENTS_STATUS="✅"
AGENTS_LINK="<a href=\"https://${{ env.WEB_ALIAS }}/agents\">Open Preview</a>"
EOF

- name: Upload agents status
if: steps.agents-config.outputs.configured == 'true'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: agents-status
path: agents-status.env

deploy-marketing:
name: Deploy Marketing
runs-on: blacksmith-4vcpu-ubuntu-2404
Expand Down Expand Up @@ -708,7 +792,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
if: always()
needs: [create-database, deploy-database, deploy-api, deploy-web, deploy-marketing, deploy-docs]
needs: [create-database, deploy-database, deploy-api, deploy-web, deploy-agents, deploy-marketing, deploy-docs]
permissions:
contents: read
pull-requests: write
Expand All @@ -731,6 +815,8 @@ jobs:
API_LINK="Failed to deploy"
WEB_STATUS="❌"
WEB_LINK="Failed to deploy"
AGENTS_STATUS="❌"
AGENTS_LINK="Failed to deploy"
MARKETING_STATUS="❌"
MARKETING_LINK="Failed to deploy"
DOCS_STATUS="❌"
Expand All @@ -751,6 +837,10 @@ jobs:
source web-status.env
fi

if [[ "${{ needs.deploy-agents.result }}" == "success" ]]; then
source agents-status.env
fi

if [[ "${{ needs.deploy-marketing.result }}" == "success" ]]; then
source marketing-status.env
fi
Expand All @@ -759,7 +849,7 @@ jobs:
source docs-status.env
fi

export DATABASE_STATUS DATABASE_LINK API_STATUS API_LINK WEB_STATUS WEB_LINK MARKETING_STATUS MARKETING_LINK DOCS_STATUS DOCS_LINK
export DATABASE_STATUS DATABASE_LINK API_STATUS API_LINK WEB_STATUS WEB_LINK AGENTS_STATUS AGENTS_LINK MARKETING_STATUS MARKETING_LINK DOCS_STATUS DOCS_LINK
envsubst < .github/templates/preview-comment.md > final-comment.md

- name: Post final deployment comment
Expand Down
Loading
Loading