Files
orca/config/scripts/mobile-test-change-scope.mjs
T
Jinwoo Hong 29dca8c031 ci: the layout oracle gates merges (#27600)
* ci: the layout oracle gates merges

An oracle-only job joins verify's needs. It runs only the two layout oracle
specs through the existing e2e workflow, routed by layout writer paths; a PR
outside the route skips it and verify treats the skip as a pass. The route is
widened to the terminal store, terminal pane, graph sync, frozen mirror and
compatibility folders while the layout-holder stack is open. The oracle specs
leave the advisory e2e job so a PR does not run them twice.

* ci: the layout oracle tests the merge commit and routes its harness and stack writers

Review fixes: run on the merge commit so a stale-base PR cannot pass on an old
main; route the oracle's own e2e harness and runtime client (a change there broke
main's oracle without running it), and the window-side layout writers the stack
edits; move the route into its own module.

* ci: route the remaining layout writers the stack edits to the layout oracle
2026-10-11 19:39:59 -04:00

36 lines
1.2 KiB
JavaScript

import { appendFileSync, readFileSync } from 'node:fs'
import { pathToFileURL } from 'node:url'
import { isDocsOnlyPath } from './pr-code-change-scope.mjs'
const NON_TEST_FILES = new Set([
'mobile/Gemfile',
'mobile/Gemfile.lock',
'mobile/README.md',
'.github/workflows/mobile-ios-release.yml',
'config/scripts/pr-code-change-scope.mjs',
'config/scripts/pr-code-change-scope.test.mjs',
'config/scripts/pr-layout-oracle-route.mjs',
'config/scripts/mobile-release-check-scope.mjs',
'config/scripts/mobile-release-check-scope.test.mjs'
])
export function shouldRunMobileTests(files) {
return (
files.length === 0 ||
files.some(
(file) =>
file.split('/').includes('..') ||
(!isDocsOnlyPath(file) &&
!NON_TEST_FILES.has(file) &&
!file.startsWith('mobile/docs/') &&
!file.startsWith('mobile/fastlane/'))
)
)
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const input = readFileSync(process.argv[2], 'utf8')
const files = input.endsWith('\0') ? input.slice(0, -1).split('\0') : []
appendFileSync(process.env.GITHUB_OUTPUT, `should_run=${shouldRunMobileTests(files)}\n`)
}