From 2c6a7b35ed7522c67137e092eb77134ff9e0383d Mon Sep 17 00:00:00 2001 From: Chris Volzer Date: Wed, 4 Nov 2026 15:18:57 -0500 Subject: [PATCH] chore(ci): fix mobile checks on clean checkouts --- .github/workflows/mobile-ci.yml | 6 +++++- products/mobile/.npmrc | 1 + products/mobile/docs/CI.md | 3 ++- products/mobile/package.json | 1 + products/mobile/pnpm-lock.yaml | 21 +++++++++++++++++++ .../src/features/chat/ChatMarkdown.test.tsx | 4 +++- .../report/metrics/ObservationCard.test.tsx | 2 +- 7 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mobile-ci.yml b/.github/workflows/mobile-ci.yml index 9527161b4b83a..94ebbb36ae652 100644 --- a/.github/workflows/mobile-ci.yml +++ b/.github/workflows/mobile-ci.yml @@ -11,6 +11,7 @@ on: paths: - 'products/mobile/**' - '!products/mobile/**/*.md' + - 'products/signals/frontend/generated/**' - '.github/workflows/mobile-ci.yml' # Master pushes refresh the pnpm store cache that PR runs restore. push: @@ -18,6 +19,7 @@ on: paths: - 'products/mobile/**' - '!products/mobile/**/*.md' + - 'products/signals/frontend/generated/**' - '.github/workflows/mobile-ci.yml' concurrency: @@ -40,7 +42,9 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - sparse-checkout: products/mobile + sparse-checkout: | + products/mobile + products/signals/frontend/generated/api.schemas.ts sparse-checkout-cone-mode: false # Reads packageManager from the app's package.json, not the repo root's, diff --git a/products/mobile/.npmrc b/products/mobile/.npmrc index d67f3748837b6..c67455a2cc8bf 100644 --- a/products/mobile/.npmrc +++ b/products/mobile/.npmrc @@ -1 +1,2 @@ node-linker=hoisted +min-release-age=7 diff --git a/products/mobile/docs/CI.md b/products/mobile/docs/CI.md index b75ea2b9fcf7e..9ab4ddb1cfc9c 100644 --- a/products/mobile/docs/CI.md +++ b/products/mobile/docs/CI.md @@ -4,7 +4,7 @@ Two GitHub Actions workflows cover the app. Both work inside `products/mobile` a ## Mobile CI -`.github/workflows/mobile-ci.yml` runs on pull requests and on pushes to `master` that change `products/mobile/**` or the workflow file. +`.github/workflows/mobile-ci.yml` runs on pull requests and on pushes to `master` that change `products/mobile/**`, the generated Signals API types, or the workflow file. Markdown changes alone do not start it. One job runs these steps, the same commands you run locally: @@ -20,6 +20,7 @@ Write `pnpm test --ci`, not `pnpm test -- --ci`. pnpm forwards the `--`, and Jes Details: +- The sparse checkout includes the generated Signals API schema imported by the app. - pnpm comes from `packageManager` in `products/mobile/package.json`, not from the repo root. - Node comes from `products/mobile/.node-version`. Keep it equal to the repo's `.nvmrc` and to `node` in `eas.json`. - The pnpm store cache is keyed on `products/mobile/pnpm-lock.yaml`. Pull requests only restore it. Pushes to `master` save it. diff --git a/products/mobile/package.json b/products/mobile/package.json index f912307a012f5..0ffd49db3a853 100644 --- a/products/mobile/package.json +++ b/products/mobile/package.json @@ -91,6 +91,7 @@ "@react-native/metro-config": "0.86.3", "@testing-library/react-native": "^13.3.3", "@types/jest": "^29.5.14", + "@types/markdown-it": "14.2.0", "@types/react": "~19.2.4", "jest": "^29.7.0", "jest-expo": "~57.0.2", diff --git a/products/mobile/pnpm-lock.yaml b/products/mobile/pnpm-lock.yaml index 66321cdfd1e36..992663297474f 100644 --- a/products/mobile/pnpm-lock.yaml +++ b/products/mobile/pnpm-lock.yaml @@ -156,6 +156,9 @@ importers: '@types/jest': specifier: ^29.5.14 version: 29.5.14 + '@types/markdown-it': + specifier: 14.2.0 + version: 14.2.0 '@types/react': specifier: ~19.2.4 version: 19.2.18 @@ -1589,6 +1592,15 @@ packages: '@types/jsdom@20.0.1': resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} + '@types/linkify-it@5.0.0': + resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} + + '@types/markdown-it@14.2.0': + resolution: {integrity: sha512-NoQ2yGlLWj4wpxMs+TYmRKk3thDrQ97agr7sFqfLsAlvoS8SNQuTrlObhFqG9iugdTtgOE9jpJ6FNM4ZGsa5xQ==} + + '@types/mdurl@2.0.0': + resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==} + '@types/node@26.6.4': resolution: {integrity: sha512-ldVPDCzj7fsaGZrLB0NuHuTvJcsNasysBAqMolr/cgxrLd1xbqxIr3XJiPnHHJUCxj5sNF1vnRj9aWnrVh5Jcg==} @@ -6738,6 +6750,15 @@ snapshots: '@types/tough-cookie': 4.0.5 parse5: 7.3.0 + '@types/linkify-it@5.0.0': {} + + '@types/markdown-it@14.2.0': + dependencies: + '@types/linkify-it': 5.0.0 + '@types/mdurl': 2.0.0 + + '@types/mdurl@2.0.0': {} + '@types/node@26.6.4': dependencies: undici-types: 8.9.0 diff --git a/products/mobile/src/features/chat/ChatMarkdown.test.tsx b/products/mobile/src/features/chat/ChatMarkdown.test.tsx index d607d929d02cc..bf71d00a27a53 100644 --- a/products/mobile/src/features/chat/ChatMarkdown.test.tsx +++ b/products/mobile/src/features/chat/ChatMarkdown.test.tsx @@ -11,7 +11,9 @@ jest.mock('./MermaidDiagram', () => ({ MermaidDiagram: jest.fn(() => null) })) const summary = getInsightSummary as jest.MockedFunction function view(text: string): ReturnType { return render( - + ) diff --git a/products/mobile/src/features/report/metrics/ObservationCard.test.tsx b/products/mobile/src/features/report/metrics/ObservationCard.test.tsx index 52a28eaf8304b..0105f7e450be0 100644 --- a/products/mobile/src/features/report/metrics/ObservationCard.test.tsx +++ b/products/mobile/src/features/report/metrics/ObservationCard.test.tsx @@ -22,7 +22,7 @@ const BASE: MetricView = { } function renderCard(metric: MetricView): void { - const client = new QueryClient() + const client = new QueryClient({ defaultOptions: { queries: { gcTime: Infinity } } }) const tree: ReactElement = (