Skip to content

Commit 1bae9fe

Browse files
CopilotLms24
andauthored
chore: add re-nagging every 2 business days to PR review reminder
Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/20ea6b6f-d865-4d7b-aff6-3a6f432844d2 Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>
1 parent 04055c1 commit 1bae9fe

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/pr-review-reminder.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,16 @@ jobs:
173173
}
174174
175175
// Returns true if a reminder is due for a reviewer/team:
176-
// - At least 2 business days have fully elapsed since the review was requested, AND
177-
// - No reminder has been posted since the most recent review_requested event
178-
// (this correctly resets the reminder when a new push re-requests the review)
176+
// - The "anchor" is the later of: the review-request date, or the last
177+
// reminder we already posted for this reviewer. This means the
178+
// 2-business-day clock restarts after every reminder (re-nagging), and
179+
// also resets when a new push re-requests the review.
180+
// - A reminder fires when ≥ 2 full business days have elapsed since the anchor.
179181
function needsReminder(requestedAt, key) {
180-
if (countElapsedBusinessDays(requestedAt) < 2) return false;
181182
const lastReminded = latestReminderDate(key);
182-
if (lastReminded && lastReminded >= requestedAt) return false;
183-
return true;
183+
const anchor =
184+
lastReminded && lastReminded > requestedAt ? lastReminded : requestedAt;
185+
return countElapsedBusinessDays(anchor) >= 2;
184186
}
185187
186188
// Collect overdue individual reviewers
@@ -227,7 +229,7 @@ jobs:
227229
// on subsequent runs) and @-mentions all overdue reviewers/teams.
228230
const markers = toRemind.map(({ key }) => reminderMarker(key)).join('\n');
229231
const mentions = toRemind.map(({ mention }) => mention).join(', ');
230-
const body = `${markers}\n👋 ${mentions} — you were requested to review this PR more than 2 business days ago. Could you please take a look when you get a chance? Thank you!`;
232+
const body = `${markers}\n👋 ${mentions} — a friendly reminder that your review on this PR is still pending. Could you please take a look when you get a chance? Thank you!`;
231233
232234
await github.rest.issues.createComment({
233235
owner,

0 commit comments

Comments
 (0)