feat: draft PR reminders with per-timezone Slack @mentions#24
Conversation
Notifies each author via Slack @mention about their open draft PRs, grouped by timezone so AEST and IST users each receive reminders at their local 9am and 3pm on Mondays. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Maps all 11 #pactflow-dev members (GitHub login → Slack ID + timezone). Adds GMT cron triggers for Yousaf (Mon 9am/3pm UTC). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
JP-Ellis
left a comment
There was a problem hiding this comment.
A few comments, but I think my main concern is that there are many timezone formats, and it is unclear to me whether they are all working the same. I.e.:
- You might have timezone as offset
+10:00/+11:00 - You might have the timezone as an abbreviation:
AEST/AEDST(though these can be ambiguous, both because one abbreviation can refer to multiple timezones, and multiple abbreviations can refer to the one timezone) - You might have the timezone from IANA:
Australia/Melbourne
I would use the IANA timezone in the cron and for the people association, as that shifts with daylight saving automatically.
| # Posts a Slack channel message @mentioning each author who has open draft PRs | ||
| # in the pactflow org. Users are grouped by timezone so each group is notified | ||
| # at their local 9am and 3pm on Mondays. |
There was a problem hiding this comment.
So if I understand correctly, each user gets two notifications on Mondays?
There was a problem hiding this comment.
it should only be 1, since its suppose to be timezone aware of where the user is
| - cron: '0 23 * * 0' # Mon 9am AEST (UTC+10) — Sun 23:00 UTC | ||
| - cron: '0 5 * * 1' # Mon 3pm AEST (UTC+10) — Mon 05:00 UTC | ||
| - cron: '30 3 * * 1' # Mon 9am IST (UTC+5:30) — Mon 03:30 UTC | ||
| - cron: '30 9 * * 1' # Mon 3pm IST (UTC+5:30) — Mon 09:30 UTC | ||
| - cron: '0 9 * * 1' # Mon 9am GMT (UTC+0) — Mon 09:00 UTC | ||
| - cron: '0 15 * * 1' # Mon 3pm GMT (UTC+0) — Mon 15:00 UTC |
There was a problem hiding this comment.
I would have expect one entry per timezone 🤔
| workflow_dispatch: | ||
| inputs: | ||
| timezone_group: | ||
| description: 'Timezone group to notify (e.g. AEST, IST)' | ||
| required: true |
There was a problem hiding this comment.
The timezone_group value should be an enum as opposed to a free input.
| - cron: '0 23 * * 0' # Mon 9am AEST (UTC+10) — Sun 23:00 UTC | ||
| - cron: '0 5 * * 1' # Mon 3pm AEST (UTC+10) — Mon 05:00 UTC | ||
| - cron: '30 3 * * 1' # Mon 9am IST (UTC+5:30) — Mon 03:30 UTC | ||
| - cron: '30 9 * * 1' # Mon 3pm IST (UTC+5:30) — Mon 09:30 UTC | ||
| - cron: '0 9 * * 1' # Mon 9am GMT (UTC+0) — Mon 09:00 UTC | ||
| - cron: '0 15 * * 1' # Mon 3pm GMT (UTC+0) — Mon 15:00 UTC |
There was a problem hiding this comment.
Also, it would make more sense to include the IANA timezone string for timezone-aware scheduling (this is a relatively new feature in GitHub Actions):
on:
schedule:
- cron: '30 5 * * 1-5'
timezone: "America/New_York"The benefit here too is that the IANA timezone is fixed based on the location, so Australia/Melbourne is always the same, year-round, unlike AEST vs AEDST
| if [ -n "${{ inputs.timezone_group }}" ]; then | ||
| echo "group=${{ inputs.timezone_group }}" >> "$GITHUB_OUTPUT" | ||
| else | ||
| case "${{ github.event.schedule }}" in |
There was a problem hiding this comment.
I don't know how the timezone impacts the github.event.schedule data though... I don't know whether that remains a string, or whether it has some deeper structure with the addition of a timezone.
If the latter, this would make the matching even simpler for you.
| @@ -0,0 +1,13 @@ | |||
| { | |||
There was a problem hiding this comment.
I would also consider using the IANA timezone here too. I'm only in AEST for half the year 😅
- Replace UTC-offset crons with IANA timezone: field (DST-aware) - One cron per timezone instead of two (9am only, no 3pm) - Detect active timezone at runtime via local hour check - workflow_dispatch input is now a type: choice enum - Mapping JSON uses IANA strings (Australia/Melbourne, Asia/Kolkata, Europe/London) instead of abbreviations Addresses review feedback from JP-Ellis. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Summary
draft-pr-reminders.yml) that notifies authors of open draft PRs in the pactflow org via Slack @mention every Mondaydraft-pr-slack-mapping.jsonmapping 11 team members (GitHub login → Slack member ID + timezone)How it works
draft:trueopen PRs across the org via GraphQLCron schedule
Adding users / timezones
.github/draft-pr-slack-mapping.jsoncasebranch in the workflowTest plan
workflow_dispatchwithtimezone_group=AEST— verify Slack message appears with correct @mentionsmefellowsmaps correctly if Matt has a draft PR open🤖 Generated with Claude Code