Skip to content

mobile: Dev Tool TestFlight build + in-app backend URL override#8755

Merged
aapeliv merged 16 commits into
mobile/v1.1.20from
mobile/feature/dev-tool-testflight
May 24, 2026
Merged

mobile: Dev Tool TestFlight build + in-app backend URL override#8755
aapeliv merged 16 commits into
mobile/v1.1.20from
mobile/feature/dev-tool-testflight

Conversation

@aapeliv

@aapeliv aapeliv commented May 22, 2026

Copy link
Copy Markdown
Member

Builds out the Dev Tool mobile variant, lets developers point it at any backend without rebuilding, and adds a per-branch OTA preview so any mobile branch can be opened on a phone straight from its PR.

Dev Tool TestFlight build (wip commit)

  • New devtool app variant (separate bundle ID / scheme / icon) and an EAS devtool build+submit profile (developmentClient, store distribution).
  • release:*:devtool scripts and README instructions for the install-once / load-JS-over-the-air workflow.

In-app backend URL override (this is the main new code)

  • A floating dev button (non-prod builds only) opens a Developer settings screen to override the API and web base URLs at runtime.
  • Overrides persist in AsyncStorage and are applied on a JS reload; the gRPC client and webviews now resolve their URLs through a single config/urls.ts module instead of reading process.env directly. Production builds ignore overrides entirely.
  • Quality-of-life so URLs don't have to be typed each time: presets (Staging / Production / build default), a recents list, and deep-link prefill — scanning a QR of couchers-devtool://dev-settings?api=…&web=… with the phone camera opens the app with the fields filled. A small dev-url-qr.html generator page is included.

Per-branch Dev Tool OTA preview

  • Lets anyone open a specific mobile branch on a phone by scanning a QR / tapping a link in the PR — no per-branch TestFlight build and no paid EAS Update. The installed Dev Tool dev client loads the branch's JS bundle over the air through the dev-launcher deep link; a fresh native build is only needed when native deps change.
  • Self-hosted on the existing S3 (couchers-dev-assets) + CloudFront + Lambda@Edge. expo export is staged into an Expo Updates v1 multipart/mixed manifest (app/mobile/scripts/ota-stage.mjs) and uploaded under an immutable ota/<sha>/<platform>/ prefix; the origin-response Lambda injects the required expo-protocol-version header (S3 can't).
  • Three GitLab CI jobs — build:mobile-otapreview:mobile-otapreview:pr-comment — build/stage, upload, and post a sticky PR comment with a scannable QR plus a clickable Open in Dev Tool link per platform (app/scripts/pr_preview_comment.py; the link targets a hosted open.html redirect because GitHub strips custom-scheme hrefs). iOS and Android.
  • .fingerprintignore excludes google-services.json (provided only as an EAS file secret, so absent locally and in CI) so the fingerprint runtime version is reproducible across the EAS build and CI.
  • Design and on-device findings: docs/mobile-dev-tool-ota.md.

Testing

  • npx tsc --noEmit, expo lint, and npm test pass; the GitLab CI OTA chain (build/preview:mobile-ota, preview:pr-comment) is green.
  • The OTA preview was validated end-to-end on a real iOS device (manifest → bundle → assets load; a JS edit re-exported and hot-reloaded). Android export/upload/comment run in CI; on-device Android validation is pending a Dev Tool client install.
  • In-app backend URL override not yet exercised on a device/simulator — it adds the @react-native-async-storage/async-storage native module, so a fresh dev-client build is required first. After rebuilding, worth a manual check of: the floating button on every screen, save → reload re-points the backend, presets/recents fill the fields, and the deep-link/QR round-trip.

Web frontend checklist

  • There are no console warnings when running the app
  • Added tests where relevant
  • Clicked around my changes running locally and it works
  • Checked Desktop, Mobile and Tablet screen sizes

For maintainers

  • Maintainers can push commits to my branch
  • Maintainers can merge this PR for me

This PR was created with the Couchers PR skill.

@vercel

vercel Bot commented May 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
couchers Ready Ready Preview May 24, 2026 7:39pm

Request Review

@CouchersBot

CouchersBot commented May 24, 2026

Copy link
Copy Markdown
Member

Preview builds

Mobile Dev Tool preview

Scan the QR with your phone camera, or tap Open in Dev Tool on the device, to open this branch in the installed Dev Tool dev client.

iosOpen in Dev Tool

QR to open the ios build

Deep link
couchers-devtool://expo-development-client/?url=https%3A%2F%2F21368027--ota.preview.couchershq.org%2Fios%2Fmanifest

androidOpen in Dev Tool

QR to open the android build

Deep link
couchers-devtool://expo-development-client/?url=https%3A%2F%2F21368027--ota.preview.couchershq.org%2Fandroid%2Fmanifest

commit 21368027 · pipeline

aapeliv and others added 14 commits May 24, 2026 15:33
Adds a developer settings screen (opened via a floating button in non-prod
builds) to point the app at a different API/web backend without rebuilding.
Overrides persist in AsyncStorage and apply on a JS reload; the gRPC client
and webviews now resolve their URLs through a single config module. Includes
preset/recents quick-fill and deep-link (QR) prefill, plus a small QR
generator page.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ipt, ASC app id

Replaces the dev-settings "Share via QR" block with a collapsible "Share via
link" row that copies the deep link to the clipboard (adds expo-clipboard).
Adds a start:devtool script that runs expo start with the couchers-devtool
scheme so the QR opens the Dev Tool app, and fills in the devtool iOS
ascAppId for auto-submit.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Records the decision to serve per-branch RN-shell OTA bundles for the Dev
Tool statically from the existing S3 + CloudFront dev-assets infra (no OTA
server, no code signing), and the dev-launcher source findings that justify
loading branches via the launcher deep link rather than the programmatic
Updates API (which dev clients hard-disable).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Bundle the devtool variant, stage an Expo Updates v1 multipart manifest, and
publish it to the dev-assets bucket under an immutable per-SHA prefix so the
installed Dev Tool dev client can load any branch via a deep link. Drops code
signing from the devtool updates config (unsigned manifests over HTTPS are
sufficient for the internal dev tool). See docs/mobile-dev-tool-ota.md.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Visible RN banner to confirm on-device that the CI-published OTA bundle is the
one running. JS-only, so the fingerprint is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add a preview:pr-comment job that runs after the OTA S3 upload (needs:
preview:mobile-ota) so every link it posts is already live, resolves the
GitHub PR from the commit SHA, generates a QR (Python) it hosts on our own
dev-assets/CloudFront, and upserts a sticky preview comment. Replaces the
GitHub Action approach, which couldn't order itself after the upload.
Structured so non-OTA preview sections can be added later. No-ops without
GITHUB_PREVIEW_TOKEN or an open PR so it never reds the pipeline.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Generate the dev-launcher QR PNG in build:mobile-ota (npx qrcode, so it stays
out of the fingerprint sources) and upload it with the existing aws s3 cp in
preview:mobile-ota, next to the bundle. The PR-comment job no longer touches
S3 (no boto3) - it only assembles markdown referencing the hosted qr.png and
upserts the GitHub comment.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ota-stage.mjs now emits an open.html per platform (https redirect to the
dev-launcher deep link) since GitHub strips custom-scheme links from comments;
the PR comment links to it. Enables android in the OTA jobs and removes the
temporary OTA test banner from the login screen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
It's provided only as an EAS file env secret, so it's present on EAS builds but
absent locally and in CI; hashing it by contents made the fingerprint runtime
version diverge between the EAS-built Dev Tool client and per-branch OTA bundles.
Excluding it keeps the fingerprint reproducible everywhere.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Development-client builds default to APK; the Dev Tool needs an AAB for Play
Store internal distribution.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
buildType only applies to release builds; a development client builds an APK
regardless, so the setting was dead config that only churned the fingerprint.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reflects the implemented GitLab CI jobs, the deployed origin-response header
injection, the QR + open.html PR comment, Android support, and the
google-services.json fingerprint exclusion.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
aapeliv and others added 2 commits May 24, 2026 15:33
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The project was missing it, so Metro fell back to its bare defaults instead of
extending expo/metro-config; this also resolves the failing expo-doctor check.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@aapeliv
aapeliv force-pushed the mobile/feature/dev-tool-testflight branch from 2136802 to d3ebef6 Compare May 24, 2026 19:34
@aapeliv
aapeliv merged commit b87979c into mobile/v1.1.20 May 24, 2026
3 of 4 checks passed
@aapeliv
aapeliv deleted the mobile/feature/dev-tool-testflight branch May 24, 2026 19:34
@github-actions

Copy link
Copy Markdown
Contributor

📝 Release Notes

This PR does not need to be included in release notes.

Reason: This PR is primarily developer tooling for the mobile app: a Dev Tool build, backend URL override for non-production builds, and per-branch OTA previews for testing PRs on phones. These changes are not intended for end users and do not noticeably change the production user experience.

🤖 Bot Debug Information

Model: couchers.openai.gpt-5.4
Decision: exclude
Reasoning: This PR is primarily developer tooling for the mobile app: a Dev Tool build, backend URL override for non-production builds, and per-branch OTA previews for testing PRs on phones. These changes are not intended for end users and do not noticeably change the production user experience.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants