Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/CI.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CI selection and acceptance ownership

Root `bun run type-check` and CI's lint job also check ESM maintenance scripts through `scripts/tsconfig.mts.json`, which inherits the shared scripts compiler options and selects every `.mts` file. The shared scripts project includes `.ts`, `.tsx`, and `.mts` for editor checking; CI's additional scripts gate is scoped to `.mts`.

The `changes` job runs Turborepo 2.11.10's `affectedTasks` query before installing application dependencies or provisioning services. `turbo.json` records package dependency propagation; `apps/sim/turbo.json` partitions the app into shared runtime, server, workspace UI, and acceptance tasks. `.github/ci-suites.json` turns those tasks into job matrices. The uploaded `ci-plan` artifact names changed files, selected tasks, attribution reasons, and any fallback.

A PR compares the checked-out GitHub merge commit with its first parent: the actual target revision tested by that merge. The PR event's base SHA can become stale when the target advances. Scoping requires a matching GitHub merge ref and SHA, exactly two merge parents, and a usable target parent; otherwise every check runs. This works with the existing depth-two checkout without fetching older ancestry. Main/staging pushes execute all checks; the parent `ci` workflow skips checks on `dev` pushes, while PRs targeting `dev` still run checks. A manual `checks` run executes all checks unless supplied a full base commit SHA to reproduce a scoped plan. Missing history, an empty diff, unknown files outside the workspace graph, root script/CI changes, or a planner error run every check. Missing selection outputs fail the aggregate gate. The gate also rejects an omitted dependency, any failed/cancelled job, and any skip that its explicit selection flag did not authorize.
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,9 @@ jobs:
- name: Migration safety (zero-downtime) audit
run: bun run check:migrations "${{ steps.audit_base.outputs.ref }}"

- name: Type-check ESM maintenance scripts
run: bun run type-check:scripts:esm

# Every affected workspace, following the same real task graph as tests. Root/unknown
# changes select all. packages/emcn, packages/utils,
# apps/desktop and apps/docs had no type check in CI at all; apps/sim's
Expand Down
98 changes: 60 additions & 38 deletions apps/docs/scripts/test-navigation-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ async function selectRequestLanguage(page: Page, name: string | RegExp): Promise
return tab
}

async function searchFor(page: Page, query: string) {
const [request] = await Promise.all([
page.waitForRequest(
(request) => {
const url = new URL(request.url())
return (
url.origin === target.origin &&
url.pathname === '/api/search' &&
url.searchParams.get('query') === query
)
},
{ timeout: 5000 }
),
page.getByRole('combobox', { name: 'Search documentation' }).fill(query),
])
expect((await request.response())?.ok()).toBe(true)
}

async function open(page: Page, path: string) {
const response = await page.goto(new URL(path, target).href, { waitUntil: 'domcontentloaded' })
expect(response?.ok() || response?.status() === 304).toBe(true)
Expand Down Expand Up @@ -1756,42 +1774,46 @@ try {
'Search keyboard navigation, empty/error states and focus restoration',
async () => {
const page = await interactive.newPage()
await open(page, '/introduction')
const trigger = page.getByRole('button', {
name: /^(Search documentation|Search docs)$/,
exact: true,
})
await trigger.focus()
await page.keyboard.press('Control+k')
const search = page.getByRole('combobox', { name: 'Search documentation' })
await expect(search).toBeFocused()
await search.fill('Slack')
await expect(page.getByRole('option').first()).toBeVisible()
await page.screenshot({ path: join(directory, 'search-results.png') })
const activeResult = await search.getAttribute('aria-activedescendant')
await search.dispatchEvent('keydown', { key: 'ArrowDown', isComposing: true })
await expect(search).toHaveAttribute('aria-activedescendant', activeResult ?? '')
await search.dispatchEvent('keydown', { key: 'Enter', isComposing: true })
await expect(page.getByRole('dialog')).toBeVisible()
await expect(page).toHaveURL(new URL('/introduction', target).href)
await search.press('ArrowDown')
await search.press('Enter')
await expect(page).not.toHaveURL(new URL('/introduction', target).href)
await page
.getByRole('button', { name: /^(Search documentation|Search docs)$/, exact: true })
.click()
await search.fill('zzzz-no-such-content-zzzz')
await expect(page.getByRole('status')).toContainText('No results')
await page.route('**/api/search?*', (route) => route.fulfill({ status: 503, body: '{}' }))
await search.fill('failure-case')
await expect(page.getByRole('status')).toContainText('Search is unavailable')
await page.unroute('**/api/search?*')
await page.getByRole('button', { name: 'Try again', exact: true }).click()
await expect(page.getByRole('status')).toContainText('No results')
await search.press('Escape')
await expect(
page.getByRole('button', { name: /^(Search documentation|Search docs)$/, exact: true })
).toBeFocused()
try {
await open(page, '/introduction')
const trigger = page.getByRole('button', {
name: /^(Search documentation|Search docs)$/,
exact: true,
})
await trigger.focus()
await page.keyboard.press('Control+k')
const search = page.getByRole('combobox', { name: 'Search documentation' })
await expect(search).toBeFocused()
await searchFor(page, 'Slack')
await expect(page.getByRole('option').first()).toBeVisible()
await page.screenshot({ path: join(directory, 'search-results.png') })
const activeResult = await search.getAttribute('aria-activedescendant')
await search.dispatchEvent('keydown', { key: 'ArrowDown', isComposing: true })
await expect(search).toHaveAttribute('aria-activedescendant', activeResult ?? '')
await search.dispatchEvent('keydown', { key: 'Enter', isComposing: true })
await expect(page.getByRole('dialog')).toBeVisible()
await expect(page).toHaveURL(new URL('/introduction', target).href)
await search.press('ArrowDown')
await search.press('Enter')
await expect(page).not.toHaveURL(new URL('/introduction', target).href)
await page
.getByRole('button', { name: /^(Search documentation|Search docs)$/, exact: true })
.click()
await search.fill('zzzz-no-such-content-zzzz')
await expect(page.getByRole('status')).toContainText('No results')
await page.route('**/api/search?*', (route) => route.fulfill({ status: 503, body: '{}' }))
await search.fill('failure-case')
await expect(page.getByRole('status')).toContainText('Search is unavailable')
await page.unroute('**/api/search?*')
await page.getByRole('button', { name: 'Try again', exact: true }).click()
await expect(page.getByRole('status')).toContainText('No results')
await search.press('Escape')
await expect(
page.getByRole('button', { name: /^(Search documentation|Search docs)$/, exact: true })
).toBeFocused()
} finally {
await page.close()
}
}
)
await check('A stalled search request stops searching and offers a retry', async () => {
Expand Down Expand Up @@ -1876,7 +1898,7 @@ try {
.getByRole('button', { name: /^(Search documentation|Search docs)$/, exact: true })
.click()
const search = page.getByRole('combobox', { name: 'Search documentation' })
await search.fill('Slack')
await searchFor(page, 'Slack')
await expect(page.getByRole('option').first()).toBeVisible()
await page.screenshot({ path: join(directory, 'mobile-search-results.png') })
if (interactionRecording.video) await sleep(600)
Expand Down Expand Up @@ -2005,7 +2027,7 @@ try {
await page.keyboard.press('Control+k')
const search = page.getByRole('combobox', { name: 'Search documentation' })
await expect(search).toBeFocused()
await search.fill('Slack')
await searchFor(page, 'Slack')
await expect(page.getByRole('option').first()).toBeVisible()
await page.screenshot({ path: join(directory, 'cloudflare-mobile-search.png') })
await search.press('Escape')
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"check:agent-stream-docs": "bun run scripts/sync-agent-stream-docs.ts --check",
"prepare": "bun husky",
"test:workflow-sync": "bun --no-env-file scripts/test-integration.ts lib/workspaces/__integration__",
"type-check": "turbo run type-check",
"type-check": "bun run type-check:scripts:esm && turbo run type-check",
"type-check:scripts:esm": "tsc --project scripts/tsconfig.mts.json",
"release": "bun run scripts/create-single-release.ts",
"test:scripts": "vitest run --config scripts/vitest.config.ts",
"check:agent-cli-boundary": "bun run scripts/check-agent-cli-boundary.ts"
Expand Down
2 changes: 1 addition & 1 deletion scripts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
"esm": true,
"experimentalSpecifierResolution": "node"
},
"include": ["./**/*.ts", "./**/*.tsx"]
"include": ["./**/*.ts", "./**/*.tsx", "./**/*.mts"]
}
7 changes: 7 additions & 0 deletions scripts/tsconfig.mts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"types": ["node"]
},
"include": ["./**/*.mts"]
}
Loading