@@ -206,7 +206,7 @@ describe("resetPollState", () => {
206206 it ( "clears hot sets and resets generation" , async ( ) => {
207207 rebuildHotSets ( {
208208 ...emptyData ,
209- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_x" } ) ] ,
209+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_x" } ) ] ,
210210 workflowRuns : [ makeWorkflowRun ( { id : 10 , status : "in_progress" , conclusion : null , repoFullName : "o/r" } ) ] ,
211211 } ) ;
212212 expect ( getHotPollGeneration ( ) ) . toBe ( 1 ) ;
@@ -235,7 +235,7 @@ describe("rebuildHotSets", () => {
235235 expect ( getHotPollGeneration ( ) ) . toBe ( 2 ) ;
236236 } ) ;
237237
238- it ( "populates hot PRs for pending/null checkStatus with nodeId" , async ( ) => {
238+ it ( "populates hot PRs for enriched pending checkStatus with nodeId" , async ( ) => {
239239 const octokit = makeOctokit ( undefined , ( ) => Promise . resolve ( {
240240 nodes : [ ] ,
241241 rateLimit : { limit : 5000 , remaining : 4999 , resetAt : "2026-01-01T00:00:00Z" } ,
@@ -245,20 +245,20 @@ describe("rebuildHotSets", () => {
245245 rebuildHotSets ( {
246246 ...emptyData ,
247247 pullRequests : [
248- makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ,
249- makePullRequest ( { id : 2 , checkStatus : null , nodeId : "PR_b" } ) ,
250- makePullRequest ( { id : 3 , checkStatus : "success" , nodeId : "PR_c" } ) , // should be skipped
251- makePullRequest ( { id : 4 , checkStatus : "pending" } ) , // no nodeId, should be skipped
248+ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_a" } ) ,
249+ makePullRequest ( { id : 2 , checkStatus : null , enriched : true , nodeId : "PR_b" } ) , // null checkStatus — skipped (not pending)
250+ makePullRequest ( { id : 3 , checkStatus : "success" , enriched : true , nodeId : "PR_c" } ) , // resolved — skipped
251+ makePullRequest ( { id : 4 , checkStatus : "pending" , enriched : true } ) , // no nodeId — skipped
252+ makePullRequest ( { id : 5 , checkStatus : "pending" , enriched : false , nodeId : "PR_e" } ) , // not enriched — skipped
252253 ] ,
253254 } ) ;
254255
255256 await fetchHotData ( ) ;
256- // Verify graphql was called with only the 2 eligible node IDs
257+ // Verify graphql was called with only the 1 eligible node ID
257258 expect ( octokit . graphql ) . toHaveBeenCalledTimes ( 1 ) ;
258259 const calledIds = ( octokit . graphql . mock . calls [ 0 ] [ 1 ] as { ids : string [ ] } ) . ids ;
259- expect ( calledIds ) . toHaveLength ( 2 ) ;
260+ expect ( calledIds ) . toHaveLength ( 1 ) ;
260261 expect ( calledIds ) . toContain ( "PR_a" ) ;
261- expect ( calledIds ) . toContain ( "PR_b" ) ;
262262 } ) ;
263263
264264 it ( "populates hot runs for queued/in_progress, skips completed" , async ( ) => {
@@ -377,7 +377,7 @@ describe("fetchHotData", () => {
377377
378378 rebuildHotSets ( {
379379 ...emptyData ,
380- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_x" } ) ] ,
380+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_x" } ) ] ,
381381 } ) ;
382382
383383 // First fetch — PR is hot, returns success -> evicts
@@ -603,7 +603,7 @@ describe("createHotPollCoordinator", () => {
603603
604604 rebuildHotSets ( {
605605 ...emptyData ,
606- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ] ,
606+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_a" } ) ] ,
607607 } ) ;
608608
609609 const { pushError } = await import ( "../../src/app/lib/errors" ) ;
@@ -661,7 +661,7 @@ describe("createHotPollCoordinator", () => {
661661
662662 rebuildHotSets ( {
663663 ...emptyData ,
664- pullRequests : [ makePullRequest ( { id : 42 , nodeId : "PR_node42" , repoFullName : "o/r" } ) ] ,
664+ pullRequests : [ makePullRequest ( { id : 42 , checkStatus : "pending" , enriched : true , nodeId : "PR_node42" , repoFullName : "o/r" } ) ] ,
665665 workflowRuns : [ makeWorkflowRun ( { id : 7 , status : "in_progress" , conclusion : null , repoFullName : "o/r" } ) ] ,
666666 } ) ;
667667
@@ -746,7 +746,7 @@ describe("createHotPollCoordinator", () => {
746746
747747 rebuildHotSets ( {
748748 ...emptyData ,
749- pullRequests : [ makePullRequest ( { id : 42 , nodeId : "PR_node42" , repoFullName : "o/r" } ) ] ,
749+ pullRequests : [ makePullRequest ( { id : 42 , checkStatus : "pending" , enriched : true , nodeId : "PR_node42" , repoFullName : "o/r" } ) ] ,
750750 } ) ;
751751
752752 const { pushError } = await import ( "../../src/app/lib/errors" ) ;
@@ -868,7 +868,7 @@ describe("rebuildHotSets caps", () => {
868868
869869 it ( "caps hot PRs at MAX_HOT_PRS (200)" , async ( ) => {
870870 const prs = Array . from ( { length : 250 } , ( _ , i ) =>
871- makePullRequest ( { id : i + 1 , checkStatus : "pending" , nodeId : `PR_${ i } ` } )
871+ makePullRequest ( { id : i + 1 , checkStatus : "pending" , enriched : true , nodeId : `PR_${ i } ` } )
872872 ) ;
873873
874874 const warnSpy = vi . spyOn ( console , "warn" ) . mockImplementation ( ( ) => { } ) ;
@@ -945,8 +945,8 @@ describe("fetchHotData eviction edge cases", () => {
945945 rebuildHotSets ( {
946946 ...emptyData ,
947947 pullRequests : [
948- makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_one" } ) ,
949- makePullRequest ( { id : 2 , checkStatus : "pending" , nodeId : "PR_two" } ) ,
948+ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_one" } ) ,
949+ makePullRequest ( { id : 2 , checkStatus : "pending" , enriched : true , nodeId : "PR_two" } ) ,
950950 ] ,
951951 } ) ;
952952
@@ -979,7 +979,7 @@ describe("fetchHotData eviction edge cases", () => {
979979
980980 rebuildHotSets ( {
981981 ...emptyData ,
982- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_merged" } ) ] ,
982+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_merged" } ) ] ,
983983 } ) ;
984984
985985 const first = await fetchHotData ( ) ;
@@ -1008,7 +1008,7 @@ describe("fetchHotData eviction edge cases", () => {
10081008
10091009 rebuildHotSets ( {
10101010 ...emptyData ,
1011- pullRequests : [ makePullRequest ( { id : 2 , checkStatus : null , nodeId : "PR_closed" } ) ] ,
1011+ pullRequests : [ makePullRequest ( { id : 2 , checkStatus : "pending" , enriched : true , nodeId : "PR_closed" } ) ] ,
10121012 } ) ;
10131013
10141014 await fetchHotData ( ) ;
@@ -1022,7 +1022,7 @@ describe("clearHotSets", () => {
10221022 it ( "empties both hot maps so next fetchHotData is a no-op" , async ( ) => {
10231023 rebuildHotSets ( {
10241024 ...emptyData ,
1025- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ] ,
1025+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_a" } ) ] ,
10261026 workflowRuns : [ makeWorkflowRun ( { id : 10 , status : "in_progress" , conclusion : null , repoFullName : "o/r" } ) ] ,
10271027 } ) ;
10281028
@@ -1060,7 +1060,7 @@ describe("fetchHotData hadErrors", () => {
10601060
10611061 rebuildHotSets ( {
10621062 ...emptyData ,
1063- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ] ,
1063+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_a" } ) ] ,
10641064 workflowRuns : [ makeWorkflowRun ( { id : 10 , status : "in_progress" , conclusion : null , repoFullName : "o/r" } ) ] ,
10651065 } ) ;
10661066
@@ -1074,7 +1074,7 @@ describe("fetchHotData hadErrors", () => {
10741074
10751075 rebuildHotSets ( {
10761076 ...emptyData ,
1077- pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , nodeId : "PR_a" } ) ] ,
1077+ pullRequests : [ makePullRequest ( { id : 1 , checkStatus : "pending" , enriched : true , nodeId : "PR_a" } ) ] ,
10781078 } ) ;
10791079
10801080 const { hadErrors, prUpdates } = await fetchHotData ( ) ;
0 commit comments