@@ -15,6 +15,7 @@ import {
1515} from "./unit-test-gaps-core.mts" ;
1616
1717const execFileAsync = promisify ( execFile ) ;
18+ const NEMOCLAW_REPOSITORY = "NVIDIA/NemoClaw" ;
1819const DEFAULT_WORKFLOWS = [ "e2e.yaml" , "portable-profile-e2e.yaml" ] ;
1920const MAX_GH_BUFFER_BYTES = 128 * 1024 * 1024 ;
2021const MAX_RUNS_PER_WORKFLOW = 1000 ;
@@ -140,28 +141,38 @@ export function requireCompleteRunSelection(workflow: string, runCount: number):
140141 ) ;
141142}
142143
144+ export function listRunsArgs ( workflow : string , range : { from : string ; to : string } ) : string [ ] {
145+ return [
146+ "run" ,
147+ "list" ,
148+ "--repo" ,
149+ NEMOCLAW_REPOSITORY ,
150+ "--workflow" ,
151+ workflow ,
152+ "--branch" ,
153+ "main" ,
154+ "--event" ,
155+ "push" ,
156+ "--created" ,
157+ `${ range . from } ..${ range . to } ` ,
158+ "--limit" ,
159+ String ( MAX_RUNS_PER_WORKFLOW ) ,
160+ "--json" ,
161+ "attempt,conclusion,createdAt,databaseId,event,headBranch,headSha,name,status,url" ,
162+ ] ;
163+ }
164+
165+ export function failedRunLogArgs ( databaseId : number ) : string [ ] {
166+ return [ "run" , "view" , String ( databaseId ) , "--repo" , NEMOCLAW_REPOSITORY , "--log-failed" ] ;
167+ }
168+
143169async function collectRuns (
144170 workflows : readonly string [ ] ,
145171 range : { from : string ; to : string } ,
146172) : Promise < E2ERunRecord [ ] > {
147173 const records = await Promise . all (
148174 workflows . map ( async ( workflow ) => {
149- const output = await gh ( [
150- "run" ,
151- "list" ,
152- "--workflow" ,
153- workflow ,
154- "--branch" ,
155- "main" ,
156- "--event" ,
157- "push" ,
158- "--created" ,
159- `${ range . from } ..${ range . to } ` ,
160- "--limit" ,
161- String ( MAX_RUNS_PER_WORKFLOW ) ,
162- "--json" ,
163- "attempt,conclusion,createdAt,databaseId,event,headBranch,headSha,name,status,url" ,
164- ] ) ;
175+ const output = await gh ( listRunsArgs ( workflow , range ) ) ;
165176 const parsed = JSON . parse ( output ) as unknown ;
166177 if ( ! Array . isArray ( parsed ) ) throw new Error ( `GitHub returned malformed runs for ${ workflow } ` ) ;
167178 requireCompleteRunSelection ( workflow , parsed . length ) ;
@@ -197,7 +208,7 @@ async function collectEvidence(runs: readonly E2ERunRecord[]): Promise<RunLogEvi
197208 const logs = new Map < number , RunLogEvidence > ( ) ;
198209 await parallelMap ( failures , DEFAULT_CONCURRENCY , async ( run ) => {
199210 try {
200- const log = await gh ( [ "run" , "view" , String ( run . databaseId ) , "--log-failed" ] ) ;
211+ const log = await gh ( failedRunLogArgs ( run . databaseId ) ) ;
201212 logs . set ( run . databaseId , { log, run } ) ;
202213 } catch ( error ) {
203214 logs . set ( run . databaseId , {
0 commit comments