@@ -8,7 +8,6 @@ import { PR_repository_pullRequest as GraphqlPullRequest,
8
8
PR_repository_pullRequest_timelineItems_nodes_MovedColumnsInProjectEvent ,
9
9
PR_repository_pullRequest_comments_nodes
10
10
} from "./queries/schema/PR" ;
11
- import { PullRequestReviewState , PullRequestState , CommentAuthorAssociation , CheckConclusionState } from "./queries/schema/graphql-global-types" ;
12
11
import { getMonthlyDownloadCount } from "./util/npm" ;
13
12
import { client } from "./graphql-client" ;
14
13
import { fetchFile as defaultFetchFile } from "./util/fetchFile" ;
@@ -186,13 +185,13 @@ export async function deriveStateForPR(
186
185
if ( prInfo . author == null ) return botError ( "PR author does not exist" ) ;
187
186
188
187
if ( prInfo . isDraft ) return botEnsureRemovedFromProject ( "PR is a draft" ) ;
189
- if ( prInfo . state !== PullRequestState . OPEN ) return botEnsureRemovedFromProject ( "PR is not active" ) ;
188
+ if ( prInfo . state !== " OPEN" ) return botEnsureRemovedFromProject ( "PR is not active" ) ;
190
189
191
190
const headCommit = getHeadCommit ( prInfo ) ;
192
191
if ( headCommit == null ) return botError ( "No head commit found" ) ;
193
192
194
193
const author = prInfo . author . login ;
195
- const isFirstContribution = prInfo . authorAssociation === CommentAuthorAssociation . FIRST_TIME_CONTRIBUTOR ;
194
+ const isFirstContribution = prInfo . authorAssociation === " FIRST_TIME_CONTRIBUTOR" ;
196
195
197
196
const createdDate = new Date ( prInfo . createdAt ) ;
198
197
// apparently `headCommit.pushedDate` can be null in some cases (see #48708), use the PR creation time for that
@@ -460,14 +459,14 @@ function getReviews(prInfo: PR_repository_pullRequest) {
460
459
reviews . push ( { type : "stale" , reviewer, date, abbrOid : abbrOid ( r . commit . oid ) } ) ;
461
460
continue ;
462
461
}
463
- if ( r . state === PullRequestReviewState . CHANGES_REQUESTED ) {
462
+ if ( r . state === " CHANGES_REQUESTED" ) {
464
463
reviews . push ( { type : "changereq" , reviewer, date } ) ;
465
464
continue ;
466
465
}
467
- if ( r . state !== PullRequestReviewState . APPROVED ) continue ;
466
+ if ( r . state !== " APPROVED" ) continue ;
468
467
const isMaintainer =
469
- ( r . authorAssociation === CommentAuthorAssociation . MEMBER )
470
- || ( r . authorAssociation === CommentAuthorAssociation . OWNER ) ;
468
+ ( r . authorAssociation === " MEMBER" )
469
+ || ( r . authorAssociation === " OWNER" ) ;
471
470
reviews . push ( { type : "approved" , reviewer, date, isMaintainer } ) ;
472
471
}
473
472
return reviews ;
@@ -480,11 +479,11 @@ function getCIResult(checkSuites: PR_repository_pullRequest_commits_nodes_commit
480
479
const totalStatusChecks = ghActionsChecks ?. find ( check => check ?. checkRuns ?. nodes ?. [ 0 ] ?. title === "test" ) || ghActionsChecks ?. [ 0 ] ;
481
480
if ( ! totalStatusChecks ) return { ciResult : "missing" , ciUrl : undefined } ;
482
481
switch ( totalStatusChecks . conclusion ) {
483
- case CheckConclusionState . SUCCESS :
482
+ case " SUCCESS" :
484
483
return { ciResult : "pass" } ;
485
- case CheckConclusionState . FAILURE :
486
- case CheckConclusionState . SKIPPED :
487
- case CheckConclusionState . TIMED_OUT :
484
+ case " FAILURE" :
485
+ case " SKIPPED" :
486
+ case " TIMED_OUT" :
488
487
return { ciResult : "fail" , ciUrl : totalStatusChecks . url } ;
489
488
default :
490
489
return { ciResult : "unknown" } ;
0 commit comments