-
Notifications
You must be signed in to change notification settings - Fork 2
feat(mobile): harden bootstrap, routing, and release gates (w6b) #5421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
iscekic
wants to merge
12
commits into
main
Choose a base branch
from
audit-w6b-bootstrap-release-ff5f
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c5dc3f6
feat(mobile): add Home product choices section
iscekic ac9f474
test(mobile): guard root layout startup order
iscekic bf6f7bd
feat(mobile): defer profile queries until interactions settle
iscekic 94d8507
refactor(mobile): extract pure bootstrap decision
iscekic 958babb
feat(mobile): bound invalid route params with fallback state
iscekic 8216b78
feat(mobile): validate URL scheme and production host
iscekic 5c609b7
build(mobile): pin EAS CLI and assert expo config
iscekic 8b371cc
ci(mobile): preflight and inspect signed release artifacts
iscekic 04cadd4
fix(mobile): derive expo config env keys from live map
iscekic 4276142
refactor(mobile): drop dead bootstrap decision fields
iscekic d7e4503
fix(mobile): gate runtime host check on build intent
iscekic 13f4d4b
fix(mobile): allowlist committed production hosts
iscekic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "cli": { | ||
| "version": ">= 21.1.0", | ||
| "version": "21.8.0", | ||
| "appVersionSource": "remote" | ||
| }, | ||
| "build": { | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| import { execFileSync } from 'node:child_process'; | ||
| import { dirname, join } from 'node:path'; | ||
| import { fileURLToPath } from 'node:url'; | ||
|
|
||
| import { ENV_KEYS } from '../src/lib/env-keys.js'; | ||
|
|
||
| // Contract values mirrored from app.config.ts (bundle id, package, scheme, | ||
| // associated domain, blocked permissions, and Sentry plugin). ENV_KEYS is | ||
| // imported live from src/lib/env-keys.js. The script runs the full evaluated | ||
| // config, so these must match the resolved build-time output, not the raw | ||
| // app.config.ts source. | ||
| const BUNDLE_IDENTIFIER = 'com.kilocode.kiloapp'; | ||
| const ANDROID_PACKAGE = 'com.kilocode.kiloapp'; | ||
| const SCHEME = 'kiloapp'; | ||
| const ASSOCIATED_DOMAIN = 'applinks:app.kilo.ai'; | ||
| const BLOCKED_PERMISSIONS = [ | ||
| 'android.permission.READ_MEDIA_IMAGES', | ||
| 'android.permission.READ_MEDIA_VIDEO', | ||
| 'android.permission.READ_MEDIA_AUDIO', | ||
| ]; | ||
| const SENTRY_PLUGIN = '@sentry/react-native/expo'; | ||
|
|
||
| const mobileDir = join(dirname(fileURLToPath(import.meta.url)), '..'); | ||
|
|
||
| let raw; | ||
| try { | ||
| raw = execFileSync('npx', ['expo', 'config', '--json'], { | ||
| cwd: mobileDir, | ||
| encoding: 'utf8', | ||
| stdio: ['ignore', 'pipe', 'inherit'], | ||
| }); | ||
| } catch (error) { | ||
| console.error(`Failed to run "npx expo config --json" from ${mobileDir}: ${error.message}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| let config; | ||
| try { | ||
| config = JSON.parse(raw); | ||
| } catch (error) { | ||
| console.error(`"npx expo config --json" returned invalid JSON: ${error.message}`); | ||
| process.exit(1); | ||
| } | ||
|
|
||
| const failures = []; | ||
|
|
||
| function check(condition, message) { | ||
| if (!condition) { | ||
| failures.push(message); | ||
| } | ||
| } | ||
|
|
||
| check( | ||
| config.ios?.bundleIdentifier === BUNDLE_IDENTIFIER, | ||
| `ios.bundleIdentifier must be "${BUNDLE_IDENTIFIER}"` | ||
| ); | ||
| check(config.android?.package === ANDROID_PACKAGE, `android.package must be "${ANDROID_PACKAGE}"`); | ||
| check(config.scheme === SCHEME, `scheme must be "${SCHEME}"`); | ||
|
|
||
| const associatedDomains = config.ios?.associatedDomains ?? []; | ||
| check( | ||
| associatedDomains.includes(ASSOCIATED_DOMAIN), | ||
| `ios.associatedDomains must contain "${ASSOCIATED_DOMAIN}"` | ||
| ); | ||
|
|
||
| const blockedPermissions = config.android?.blockedPermissions ?? []; | ||
| const blockedPermissionsMatch = | ||
| blockedPermissions.length === BLOCKED_PERMISSIONS.length && | ||
| BLOCKED_PERMISSIONS.every(permission => blockedPermissions.includes(permission)); | ||
| check( | ||
| blockedPermissionsMatch, | ||
| `android.blockedPermissions must equal exactly [${BLOCKED_PERMISSIONS.join(', ')}]` | ||
| ); | ||
|
|
||
| const pluginNames = (config.plugins ?? []).map(plugin => | ||
| Array.isArray(plugin) ? plugin[0] : plugin | ||
| ); | ||
| check(pluginNames.includes(SENTRY_PLUGIN), `plugins must include "${SENTRY_PLUGIN}"`); | ||
|
|
||
| const extra = config.extra ?? {}; | ||
| for (const key of Object.keys(ENV_KEYS)) { | ||
| const value = extra[key]; | ||
| if (value === undefined || value === null || value === '') { | ||
| failures.push(`extra.${key} must be present and non-empty`); | ||
| } | ||
| } | ||
|
|
||
| if (failures.length > 0) { | ||
| console.error('Expo config contract violations:'); | ||
| for (const failure of failures) { | ||
| console.error(` - ${failure}`); | ||
| } | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log('Expo config contract OK'); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.