Files
orca/config/scripts/ci-unit-matrix.mjs
T
NeilandCopilot ac91ff6b05 perf(ci): start full unit shards before advisory selection analysis (#37699)
Emit the full matrix without dependency installation or graph discovery; retain independent full test discovery and selected-draft provenance. Reuse existing draft plans, and disable unpublished transform writes on warm misses. Automatic cache production was removed after review because the near-quota cache store has no budgeted retention plan. Full required PR CI passed on 658ea5275c.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 23:32:32 -08:00

21 lines
829 B
JavaScript

import { appendFileSync } from 'node:fs'
import { pathToFileURL } from 'node:url'
export const FULL_SHARD_COUNT = 12
export function fullUnitMatrix(requestedCount = String(FULL_SHARD_COUNT)) {
if (!/^([2-9]|1[0-6])$/.test(requestedCount)) {
throw new Error('ORCA_UNIT_FULL_SHARD_COUNT must be an integer from 2 to 16')
}
const count = Number(requestedCount)
return Array.from({ length: count }, (_, index) => ({ index: index + 1, count }))
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
const shards = fullUnitMatrix(process.env.ORCA_UNIT_FULL_SHARD_COUNT)
if (process.env.GITHUB_OUTPUT) {
appendFileSync(process.env.GITHUB_OUTPUT, `shards=${JSON.stringify(shards)}\n`)
}
console.log(`Full unit inventory; ${shards.length} shards. Shadow selection is advisory.`)
}