@@ -128,7 +128,7 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
128
128
const needsAuthorAction = failedCI || info . hasMergeConflict || hasChangereqs ;
129
129
// => could be dropped from the extended info and replaced with: info.staleness?.kind === "Abandoned"
130
130
const staleness = getStaleness ( ) ;
131
- const reviewColumn = getReviewColumn ( ) ;
131
+ const reviewColumn = getReviewColumn ( approverKind ) ;
132
132
return {
133
133
...info , orig : info ,
134
134
authorIsOwner, editsInfra, possiblyEditsInfra, checkConfig,
@@ -142,15 +142,15 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
142
142
143
143
// Staleness timeline configurations (except for texts that are all in `comments.ts`)
144
144
function getStaleness ( ) {
145
- const ownersToPing = otherOwners . length === 0 ? [ "«anyone?»" ]
146
- : otherOwners . filter ( o => ! approvedReviews . some ( r => o === r . reviewer ) ) ;
145
+ const ownersToPing = otherOwners . map ( o => "@" + o ) . join ( ", " ) || "«anyone?»" ;
147
146
const mkStaleness = makeStaleness ( info . now , info . author , ownersToPing ) ;
148
147
if ( canBeSelfMerged ) return info . mergeOfferDate && mkStaleness ( // no merge offer yet: avoid the unreviewed timeline
149
148
"Unmerged" , info . mergeOfferDate , 4 , 9 , 30 , "*REMOVE*" ) ;
150
149
if ( needsAuthorAction ) return mkStaleness (
151
150
"Abandoned" , info . lastActivityDate , 6 , 22 , 30 , "*REMOVE*" ) ;
152
- if ( ! approved ) return mkStaleness (
153
- "Unreviewed" , info . lastPushDate , 6 , 10 , 17 , "Needs Maintainer Action" ) ;
151
+ // Don't ping about PRs that have reviews and are already in the maintainer queue.
152
+ if ( approvedBy . length === 0 || approverKind !== "maintainer" ) return mkStaleness (
153
+ "Unreviewed" , info . lastPushDate , 6 , 10 , 17 , getReviewColumn ( "maintainer" ) ) ;
154
154
return undefined ;
155
155
}
156
156
@@ -192,7 +192,7 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
192
192
&& ( approverKind === "other" || approvedBy . includes ( "maintainer" ) || approvedBy . includes ( approverKind ) ) ;
193
193
}
194
194
195
- function getReviewColumn ( ) : ColumnName {
195
+ function getReviewColumn ( approverKind : ApproverKind ) : ColumnName {
196
196
// Get the project column for review with least access
197
197
// E.g. let people review, but fall back to the DT maintainers based on the access rights above
198
198
return approverKind !== "maintainer" ? "Waiting for Code Reviews"
@@ -339,7 +339,7 @@ export function process(prInfo: BotResult,
339
339
// Has it: got no DT tests but is approved by DT modules and basically blocked by the DT maintainers - and it has been over 3 days?
340
340
// Send a message reminding them that they can un-block themselves by adding tests.
341
341
if ( ! info . hasTests && ! info . hasMultiplePackages && info . approvedBy . includes ( "owner" ) && ! info . editsInfra
342
- && info . approverKind === "maintainer" && ( info . staleness ?. days ?? 0 ) > 3 ) {
342
+ && info . approverKind === "maintainer" && dayjs ( info . now ) . diff ( info . lastPushDate , "days" ) > 3 ) {
343
343
post ( Comments . RemindPeopleTheyCanUnblockPR ( info . author , info . approvedReviews . map ( r => r . reviewer ) ,
344
344
info . ciResult === "pass" , headCommitAbbrOid ) ) ;
345
345
}
@@ -350,7 +350,7 @@ export function process(prInfo: BotResult,
350
350
return actions ;
351
351
}
352
352
353
- function makeStaleness ( now : Date , author : string , ownersToPing : string [ ] ) { // curried for convenience
353
+ function makeStaleness ( now : Date , author : string , ownersToPing : string ) { // curried for convenience
354
354
return ( kind : StalenessKind , since : Date ,
355
355
freshDays : number , attnDays : number , nearDays : number ,
356
356
doneColumn : ColumnName ) => {
0 commit comments