@@ -318,7 +318,9 @@ export const make = Effect.gen(function* () {
318318 } ,
319319 OriginCheckRunListSchema ,
320320 ( page ) => page . checkRuns ,
321- ) . pipe ( Effect . map ( ( page ) => page . items . map ( originCheck ) ) ) ;
321+ ) . pipe (
322+ Effect . map ( ( page ) => ( { checks : page . items . map ( originCheck ) , truncated : page . truncated } ) ) ,
323+ ) ;
322324 } ,
323325 { capacity : 256 , timeToLive : ( exit ) => ( Exit . isSuccess ( exit ) ? "1 second" : 0 ) } ,
324326 ) ;
@@ -327,7 +329,7 @@ export const make = Effect.gen(function* () {
327329 ) =>
328330 input . sha
329331 ? Cache . get ( checkRuns , `${ input . cwd } \n${ input . repository } \n${ input . sha } ` )
330- : Effect . succeed ( [ ] ) ;
332+ : Effect . succeed ( { checks : [ ] , truncated : false } ) ;
331333
332334 const readPatch = ( cwd : string , path : string ) =>
333335 readPages ( { cwd, operation : "getDiff" , path } , OriginFileListSchema , ( page ) => page . files ) . pipe (
@@ -702,18 +704,21 @@ export const make = Effect.gen(function* () {
702704
703705 getChangeRequestChecks : ( input ) =>
704706 withPull ( input , ( pullRequest ) => listChecks ( { ...input , sha : pullRequest . head . sha } ) ) . pipe (
705- Effect . map ( ( [ pullRequest , checks ] ) => ( { state : originState ( pullRequest ) , checks } ) ) ,
707+ Effect . map ( ( [ pullRequest , { checks } ] ) => ( { state : originState ( pullRequest ) , checks } ) ) ,
706708 Effect . mapError ( fail ( "getChangeRequestChecks" ) ) ,
707709 ) ,
708710
709711 getChangeRequest : Effect . fn ( "OriginPullRequestProvider.getChangeRequest" ) (
710712 function * ( input ) {
711- const [ [ pullRequest , [ checks , avatars , mergeability ] ] , repository ] = yield * Effect . all (
713+ const [ [ pullRequest , [ checkRead , avatars , mergeability ] ] , repository ] = yield * Effect . all (
712714 [
713715 withPull ( input , ( pullRequest ) =>
714716 Effect . all (
715717 [
716- recover ( listChecks ( { ...input , sha : pullRequest . head . sha } ) , [ ] ) ,
718+ recover ( listChecks ( { ...input , sha : pullRequest . head . sha } ) , {
719+ checks : [ ] ,
720+ truncated : false ,
721+ } ) ,
717722 avatarsFor ( input . cwd , [ pullRequest . author ] , viewArgs ( input , "author" ) ) ,
718723 mergeabilityOf ( input , pullRequest ) ,
719724 ] ,
@@ -724,10 +729,13 @@ export const make = Effect.gen(function* () {
724729 ] ,
725730 { concurrency : "unbounded" } ,
726731 ) ;
732+ const { checks, truncated } = checkRead ;
733+ const rollup = checksState ( checks ) ;
727734 const detail : ProviderChangeRequestDetail = {
728735 ...toProviderChangeRequest ( pullRequest , avatars ) ,
729736 mergeability,
730- checksState : checksState ( checks ) ,
737+ // Checks past the last page read are unknown, so all-green ones read are not a pass.
738+ checksState : truncated && rollup === "passing" ? "pending" : rollup ,
731739 headSha : pullRequest . head . sha ?? null ,
732740 body : pullRequest . body ?? "" ,
733741 changedFiles : pullRequest . changedFiles ?? 0 ,
0 commit comments