@@ -8,7 +8,7 @@ import { getAssigneesActivityForIssue } from "./get-assignee-activity";
8
8
import { parseIssueUrl } from "./github-url" ;
9
9
import { remindAssigneesForIssue , unassignUserFromIssue } from "./remind-and-remove" ;
10
10
import { getCommentsFromMetadata } from "./structured-metadata" ;
11
- import { getTaskAssignmentDetails } from "./task-metadata" ;
11
+ import { getTaskAssignmentDetails , parsePriorityLabel } from "./task-metadata" ;
12
12
13
13
const getMostRecentActivityDate = ( assignedEventDate : DateTime , activityEventDate ?: DateTime ) : DateTime => {
14
14
return activityEventDate && activityEventDate > assignedEventDate ? activityEventDate : assignedEventDate ;
@@ -18,7 +18,7 @@ export async function updateTaskReminder(context: ContextPlugin, repo: ListForOr
18
18
const {
19
19
octokit,
20
20
logger,
21
- config : { eventWhitelist, warning, disqualification } ,
21
+ config : { eventWhitelist, warning, disqualification, prioritySpeed } ,
22
22
} = context ;
23
23
const handledMetadata = await getTaskAssignmentDetails ( context , repo , issue ) ;
24
24
const now = DateTime . local ( ) ;
@@ -46,6 +46,7 @@ export async function updateTaskReminder(context: ContextPlugin, repo: ListForOr
46
46
. shift ( ) ;
47
47
48
48
const assignedDate = DateTime . fromISO ( assignedEvent . created_at ) ;
49
+ const priorityLevel = parsePriorityLabel ( issue . labels ) ;
49
50
const activityDate = activityEvent ?. created_at ? DateTime . fromISO ( activityEvent . created_at ) : undefined ;
50
51
let mostRecentActivityDate = getMostRecentActivityDate ( assignedDate , activityDate ) ;
51
52
@@ -75,13 +76,13 @@ export async function updateTaskReminder(context: ContextPlugin, repo: ListForOr
75
76
if ( lastReminderComment ) {
76
77
const lastReminderTime = DateTime . fromISO ( lastReminderComment . created_at ) ;
77
78
mostRecentActivityDate = lastReminderTime > mostRecentActivityDate ? lastReminderTime : mostRecentActivityDate ;
78
- if ( mostRecentActivityDate . plus ( { milliseconds : disqualificationTimeDifference } ) <= now ) {
79
+ if ( mostRecentActivityDate . plus ( { milliseconds : prioritySpeed ? disqualificationTimeDifference / priorityLevel : disqualificationTimeDifference } ) <= now ) {
79
80
await unassignUserFromIssue ( context , issue ) ;
80
81
} else {
81
82
logger . info ( `Reminder was sent for ${ issue . html_url } already, not beyond disqualification deadline yet.` ) ;
82
83
}
83
84
} else {
84
- if ( mostRecentActivityDate . plus ( { milliseconds : warning } ) <= now ) {
85
+ if ( mostRecentActivityDate . plus ( { milliseconds : prioritySpeed ? warning / priorityLevel : warning } ) <= now ) {
85
86
await remindAssigneesForIssue ( context , issue ) ;
86
87
} else {
87
88
logger . info ( `Nothing to do for ${ issue . html_url } , still within due-time.` ) ;
0 commit comments