Skip to content

Commit 3227822

Browse files
authored
improvement(ci): avoid unrelated asset checks and browser downloads (#9641)
* improvement(ci): fetch only the docs acceptance revision * improvement(ci): install only the Chromium runtime each suite uses * improvement(ci): keep library media on the landing acceptance path
1 parent 6c4c49c commit 3227822

4 files changed

Lines changed: 58 additions & 17 deletions

File tree

‎.github/scripts/http-e2e.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ case "$group" in
233233
export COPILOT_TOOL_PERMISSIONS_ENABLED=true
234234
export KNOWLEDGE_MEMBER_ACCESS=true CREDENTIAL_GROUPS=true ACCESS_CONTROL_ENABLED=true
235235
export NEXT_PUBLIC_ACCESS_CONTROL_ENABLED=true NEXT_PUBLIC_ORGANIZATIONS_ENABLED=true
236-
if [ "$group" != desktop-inbox ]; then start_browser_install "$group" chromium; fi
236+
if [ "$group" != desktop-inbox ]; then start_browser_install "$group" --only-shell chromium; fi
237237
export INTERNAL_API_SECRET=desktop-inbox-http-ci-local-secret-at-least-32-characters
238238
export DB_TX_TRIPWIRE=throw
239239
start_app "$group" 3019 "$group" record-http-status
@@ -275,7 +275,7 @@ case "$group" in
275275
export KNOWLEDGE_MEMBER_ACCESS=true CREDENTIAL_GROUPS=true ACCESS_CONTROL_ENABLED=true
276276
export NEXT_PUBLIC_ACCESS_CONTROL_ENABLED=true
277277
export API_ENCRYPTION_KEY="$ENCRYPTION_KEY"
278-
start_browser_install "$group" chromium
278+
start_browser_install "$group" --no-shell chromium
279279
extension_identity=$(bun - <<'JS'
280280
import { generateKeyPairSync, createHash } from 'node:crypto'
281281
const { publicKey } = generateKeyPairSync('rsa', { modulusLength: 2048 })
@@ -312,7 +312,7 @@ JS
312312
export INTERNAL_API_SECRET=mobile-http-ci-local-secret-at-least-32-characters
313313
export NEXT_PUBLIC_SOCKET_URL=http://127.0.0.1:3025 SOCKET_SERVER_URL=http://127.0.0.1:3025
314314
read -ra browsers <<< "${MOBILE_E2E_BROWSER:-chromium webkit}"
315-
start_browser_install mobile "${browsers[@]}"
315+
start_browser_install mobile --only-shell "${browsers[@]}"
316316
start_app mobile 3024 'mobile browser' record-http-status
317317
start_realtime mobile 3025
318318
wait_for_browsers

‎.github/workflows/docs-negotiation.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,6 @@ jobs:
342342
steps:
343343
- name: Checkout code
344344
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
345-
with:
346-
fetch-depth: 0
347-
filter: blob:none
348345
- name: Setup workspace
349346
uses: ./.github/actions/setup
350347
with:
@@ -376,7 +373,7 @@ jobs:
376373
if: matrix.group == 'chromium' || matrix.group == 'webkit'
377374
env:
378375
BROWSER: ${{ matrix.group }}
379-
run: bunx --no-install playwright install --with-deps "$BROWSER"
376+
run: bunx --no-install playwright install --with-deps --only-shell "$BROWSER"
380377
- name: Verify production documentation
381378
env:
382379
DOCS_ACCEPTANCE_GROUP: ${{ matrix.group }}

‎apps/sim/turbo.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"!app/(landing)/**",
1010
"!app/api/**",
1111
"!content/**",
12+
"!public/library/**",
1213
"!tools/**",
1314
"!providers/**",
1415
"!blocks/**",
@@ -151,7 +152,12 @@
151152
},
152153
"ci:e2e-seo": {
153154
"dependsOn": ["ci:server", "ci:ui"],
154-
"inputs": ["app/(landing)/**", "content/**", "scripts/test-landing-seo-e2e.ts"],
155+
"inputs": [
156+
"app/(landing)/**",
157+
"content/**",
158+
"public/library/**",
159+
"scripts/test-landing-seo-e2e.ts"
160+
],
155161
"cache": false
156162
},
157163
"ci:desktop-live": {

‎scripts/ci-changes.test.ts‎

Lines changed: 47 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,44 @@ describe('CI task attribution through real Turborepo', () => {
181181
build: true,
182182
})
183183
})
184+
it.each([
185+
['apps/sim/public/library/example/cover.jpg'],
186+
['apps/sim/content/library/example/index.mdx', 'apps/sim/public/library/example/cover.jpg'],
187+
])('keeps library media on the rendering and SEO path: %j', (...files) => {
188+
const plan = classifyFiles(files)
189+
expect(plan.fallback).toBeUndefined()
190+
expect(groups(plan)).toEqual(['seo'])
191+
expect(plan.docsGroups).toEqual([])
192+
expect(plan.flags).toMatchObject({
193+
integration: false,
194+
desktop_live: false,
195+
production: false,
196+
test_app: true,
197+
build: true,
198+
e2e_build: true,
199+
})
200+
})
201+
it.each(['delete', 'move'])('keeps SEO coverage when library media is removed: %s', (change) => {
202+
const { repo } = fixture()
203+
const media = 'apps/sim/public/library/example/cover.jpg'
204+
write(repo, media, 'fixture media')
205+
git(repo, 'add', '-A')
206+
git(repo, 'commit', '--quiet', '-m', 'media base')
207+
const base = git(repo, 'rev-parse', 'HEAD')
208+
if (change === 'delete') git(repo, 'rm', media)
209+
else git(repo, 'mv', media, 'apps/sim/public/library/example/renamed.jpg')
210+
git(repo, 'commit', '--quiet', '-m', change)
211+
const plan = classify(repo, base)
212+
expect(plan.fallback).toBeUndefined()
213+
expect(groups(plan)).toEqual(['seo'])
214+
expect(plan.flags).toMatchObject({
215+
build: true,
216+
e2e_build: true,
217+
integration: false,
218+
desktop_live: false,
219+
docs: false,
220+
})
221+
})
184222
it.each([
185223
'apps/sim/app/workspace/[workspaceId]/upgrade/components/comparison-table/comparison-data.ts',
186224
'apps/sim/providers/models.ts',
@@ -344,15 +382,15 @@ describe('CI task attribution through real Turborepo', () => {
344382
build: true,
345383
})
346384
})
347-
it('keeps unknown app modules and non-code fixtures in the shared runtime boundary', () => {
348-
for (const path of [
349-
'apps/sim/new-domain/feature.ts',
350-
'apps/sim/tools/service/__fixtures__/README.md',
351-
]) {
352-
const plan = classifyFiles([path])
353-
expect(plan.fallback).toBeUndefined()
354-
expect(plan.flags).toMatchObject({ integration: true, desktop_live: true, e2e_build: true })
355-
}
385+
it.each([
386+
'apps/sim/new-domain/feature.ts',
387+
'apps/sim/public/new-domain/config.json',
388+
'apps/sim/public/favicon/favicon.ico',
389+
'apps/sim/tools/service/__fixtures__/README.md',
390+
])('keeps unclassified runtime files in the shared boundary: %s', (path) => {
391+
const plan = classifyFiles([path])
392+
expect(plan.fallback).toBeUndefined()
393+
expect(plan.flags).toMatchObject({ integration: true, desktop_live: true, e2e_build: true })
356394
})
357395
it.each([
358396
'.github/workflows/checks.yml',

0 commit comments

Comments
 (0)