@@ -128,7 +128,7 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
128128 const needsAuthorAction = failedCI || info . hasMergeConflict || hasChangereqs ;
129129 // => could be dropped from the extended info and replaced with: info.staleness?.kind === "Abandoned"
130130 const staleness = getStaleness ( ) ;
131- const reviewColumn = getReviewColumn ( ) ;
131+ const reviewColumn = getReviewColumn ( approverKind ) ;
132132 return {
133133 ...info , orig : info ,
134134 authorIsOwner, editsInfra, possiblyEditsInfra, checkConfig,
@@ -142,15 +142,15 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
142142
143143 // Staleness timeline configurations (except for texts that are all in `comments.ts`)
144144 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?»" ;
147146 const mkStaleness = makeStaleness ( info . now , info . author , ownersToPing ) ;
148147 if ( canBeSelfMerged ) return info . mergeOfferDate && mkStaleness ( // no merge offer yet: avoid the unreviewed timeline
149148 "Unmerged" , info . mergeOfferDate , 4 , 9 , 30 , "*REMOVE*" ) ;
150149 if ( needsAuthorAction ) return mkStaleness (
151150 "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 re-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" ) ) ;
154154 return undefined ;
155155 }
156156
@@ -192,7 +192,7 @@ function extendPrInfo(info: PrInfo): ExtendedPrInfo {
192192 && ( approverKind === "other" || approvedBy . includes ( "maintainer" ) || approvedBy . includes ( approverKind ) ) ;
193193 }
194194
195- function getReviewColumn ( ) : ColumnName {
195+ function getReviewColumn ( approverKind : ApproverKind ) : ColumnName {
196196 // Get the project column for review with least access
197197 // E.g. let people review, but fall back to the DT maintainers based on the access rights above
198198 return approverKind !== "maintainer" ? "Waiting for Code Reviews"
@@ -339,7 +339,7 @@ export function process(prInfo: BotResult,
339339 // 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?
340340 // Send a message reminding them that they can un-block themselves by adding tests.
341341 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 ) {
343343 post ( Comments . RemindPeopleTheyCanUnblockPR ( info . author , info . approvedReviews . map ( r => r . reviewer ) ,
344344 info . ciResult === "pass" , headCommitAbbrOid ) ) ;
345345 }
@@ -350,7 +350,7 @@ export function process(prInfo: BotResult,
350350 return actions ;
351351}
352352
353- function makeStaleness ( now : Date , author : string , ownersToPing : string [ ] ) { // curried for convenience
353+ function makeStaleness ( now : Date , author : string , ownersToPing : string ) { // curried for convenience
354354 return ( kind : StalenessKind , since : Date ,
355355 freshDays : number , attnDays : number , nearDays : number ,
356356 doneColumn : ColumnName ) => {
0 commit comments