File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -537,7 +537,10 @@ export default class PRChecker {
537
537
const requestCiLabels = data . labeledEvents . findLast (
538
538
( { createdAt, label : { name } } ) => name === 'request-ci' && createdAt > updatedAt
539
539
) ;
540
- if ( requestCiLabels == null ) return false ;
540
+ if ( requestCiLabels == null ) {
541
+ cli . warn ( 'Something was pushed to the Pull Request branch since the last request-ci label.' ) ;
542
+ return false ;
543
+ }
541
544
542
545
const { actor : { login } } = requestCiLabels ;
543
546
const collaborators = Array . from ( data . collaborators . values ( ) ,
Original file line number Diff line number Diff line change @@ -2120,6 +2120,15 @@ describe('PRChecker', () => {
2120
2120
} ) ;
2121
2121
2122
2122
it ( 'should return false if PR has outdated request-ci from a collaborator' , async ( ) => {
2123
+ const expectedLogs = {
2124
+ warn : [
2125
+ [ 'No approving reviews found' ] ,
2126
+ [ 'Something was pushed to the Pull Request branch since the last request-ci label.' ]
2127
+ ] ,
2128
+ info : [ ] ,
2129
+ error : [ ]
2130
+ } ;
2131
+
2123
2132
const cli = new TestCLI ( ) ;
2124
2133
data . getLabeledEvents = async ( ) => {
2125
2134
data . labeledEvents = labeledEvents [ 'old-request-ci-collaborator' ] ;
@@ -2128,6 +2137,7 @@ describe('PRChecker', () => {
2128
2137
2129
2138
const status = await checker . checkCommitsAfterReviewOrLabel ( ) ;
2130
2139
assert . strictEqual ( status , false ) ;
2140
+ cli . assertCalledWith ( expectedLogs ) ;
2131
2141
} ) ;
2132
2142
2133
2143
it ( 'should return true if PR has recent request-ci from a collaborator' , async ( ) => {
@@ -2247,7 +2257,7 @@ describe('PRChecker', () => {
2247
2257
cli . assertCalledWith ( expectedLogs ) ;
2248
2258
} ) ;
2249
2259
2250
- it ( 'should return true if PR can be landed ' , ( ) => {
2260
+ it ( 'should return false if PR was updated after approvals ' , ( ) => {
2251
2261
const expectedLogs = {
2252
2262
warn : [
2253
2263
[ 'Something was pushed to the Pull Request branch since the last approving review.' ]
You can’t perform that action at this time.
0 commit comments