@@ -3276,6 +3276,19 @@ export function isStatusRollupGraphQlEnabled(env: { GITHUB_STATUS_ROLLUP_GRAPHQL
32763276 return / ^ ( 1 | t r u e | y e s | o n ) $ / i. test ( env . GITHUB_STATUS_ROLLUP_GRAPHQL ?? "" ) ;
32773277}
32783278
3279+ // Mirrors parseRepoFullName in labels.ts / assignees.ts (#8311): backfill keeps its own local copy rather than
3280+ // importing a shared one. Returns null for malformed input so each GraphQL read helper preserves its existing
3281+ // fail-soft return contract (null / undefined / []).
3282+ function parseBackfillRepoFullName ( repoFullName : string ) : { owner : string ; name : string } | null {
3283+ const parts = repoFullName . split ( "/" ) ;
3284+ const owner = parts [ 0 ] ;
3285+ const name = parts [ 1 ] ;
3286+ if ( parts . length !== 2 || ! owner || ! name || / \s / . test ( repoFullName ) ) {
3287+ return null ;
3288+ }
3289+ return { owner, name } ;
3290+ }
3291+
32793292/**
32803293 * GraphQL equivalent of {@link fetchLiveCiAggregate}: ONE bounded query returns the head commit's statusCheckRollup
32813294 * (check-runs AND classic statuses, unified) plus its check-suites — replacing the paginated /check-runs + /status
@@ -3295,8 +3308,9 @@ export async function fetchLiveCiAggregateViaGraphQl(
32953308 advisoryCheckRuns ?: ReadonlyArray < { name : string ; appSlug : string } > | null ,
32963309) : Promise < LiveCiAggregate | null > {
32973310 if ( ! headSha || ! token ) return null ;
3298- const [ owner , name ] = repoFullName . split ( "/" ) ;
3299- if ( ! owner || ! name ) return null ;
3311+ const parsed = parseBackfillRepoFullName ( repoFullName ) ;
3312+ if ( ! parsed ) return null ;
3313+ const { owner, name } = parsed ;
33003314 const query = `query LoopOverLiveCiRollup { repository(owner: ${ JSON . stringify ( owner ) } , name: ${ JSON . stringify ( name ) } ) { object(oid: ${ JSON . stringify ( headSha ) } ) { ... on Commit { statusCheckRollup { contexts(first: 100) { nodes { __typename ... on CheckRun { name conclusion status startedAt detailsUrl title summary checkSuite { databaseId app { slug } } } ... on StatusContext { context state description targetUrl } } pageInfo { hasNextPage } } } checkSuites(first: 100) { nodes { status app { slug } } pageInfo { hasNextPage } } } } } }` ;
33013315 const result = await githubGraphQl < {
33023316 data ?: {
@@ -4058,8 +4072,9 @@ export async function fetchLivePullRequestReviewDecision(
40584072 admissionKey ?: GitHubRateLimitAdmissionKey ,
40594073) : Promise < string | undefined > {
40604074 if ( ! token ) return undefined ;
4061- const [ owner , name ] = repoFullName . split ( "/" ) ;
4062- if ( ! owner || ! name ) return undefined ;
4075+ const parsed = parseBackfillRepoFullName ( repoFullName ) ;
4076+ if ( ! parsed ) return undefined ;
4077+ const { owner, name } = parsed ;
40634078 const query = `query { repository(owner: ${ JSON . stringify ( owner ) } , name: ${ JSON . stringify ( name ) } ) { pullRequest(number: ${ prNumber } ) { reviewDecision } } }` ;
40644079 const result = await githubGraphQl < { data ?: { repository ?: { pullRequest ?: { reviewDecision ?: string | null } | null } | null } ; errors ?: unknown [ ] } > (
40654080 env ,
@@ -4130,8 +4145,9 @@ export async function fetchLiveReviewThreadBlockers(
41304145 admissionKey ?: GitHubRateLimitAdmissionKey ,
41314146) : Promise < ReviewThreadBlocker [ ] > {
41324147 if ( ! token ) return [ ] ;
4133- const [ owner , name ] = repoFullName . split ( "/" ) ;
4134- if ( ! owner || ! name ) return [ ] ;
4148+ const parsed = parseBackfillRepoFullName ( repoFullName ) ;
4149+ if ( ! parsed ) return [ ] ;
4150+ const { owner, name } = parsed ;
41354151 const threads : Array < GitHubReviewThreadNode | null > = [ ] ;
41364152 let cursor : string | null = null ;
41374153 const seenCursors = new Set < string > ( ) ;
0 commit comments