Skip to content

feat: draft PR reminders with per-timezone Slack @mentions#24

Open
Ilia wants to merge 3 commits into
mainfrom
feat/draft-pr-reminders
Open

feat: draft PR reminders with per-timezone Slack @mentions#24
Ilia wants to merge 3 commits into
mainfrom
feat/draft-pr-reminders

Conversation

@Ilia
Copy link
Copy Markdown
Contributor

@Ilia Ilia commented Jun 1, 2026

Summary

  • Adds a scheduled GitHub Actions workflow (draft-pr-reminders.yml) that notifies authors of open draft PRs in the pactflow org via Slack @mention every Monday
  • Each timezone group is notified at their local 9am and 3pm — AEST, IST, and GMT supported
  • Adds draft-pr-slack-mapping.json mapping 11 team members (GitHub login → Slack member ID + timezone)

How it works

  1. A GitHub App token is used to query all draft:true open PRs across the org via GraphQL
  2. Results are filtered to only authors in the current timezone group (based on which cron fired)
  3. A Block Kit Slack message is posted to the configured webhook channel, @mentioning each author with their draft PR(s) and age

Cron schedule

Timezone 9am trigger 3pm trigger
AEST (UTC+10) Sun 23:00 UTC Mon 05:00 UTC
IST (UTC+5:30) Mon 03:30 UTC Mon 09:30 UTC
GMT (UTC+0) Mon 09:00 UTC Mon 15:00 UTC

Adding users / timezones

  • New user: add an entry to .github/draft-pr-slack-mapping.json
  • New timezone: add two cron lines (9am + 3pm in UTC) and a matching case branch in the workflow

Test plan

  • Trigger manually via workflow_dispatch with timezone_group=AEST — verify Slack message appears with correct @mentions
  • Trigger with a group that has no draft PRs — confirm silent exit (no Slack post)
  • Verify mefellows maps correctly if Matt has a draft PR open

🤖 Generated with Claude Code

Ilia and others added 2 commits June 2, 2026 09:12
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>
Copy link
Copy Markdown
Member

@JP-Ellis JP-Ellis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +9 to +11
# 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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I understand correctly, each user gets two notifications on Mondays?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should only be 1, since its suppose to be timezone aware of where the user is

Comment on lines +22 to +27
- 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would have expect one entry per timezone 🤔

Comment on lines +28 to +32
workflow_dispatch:
inputs:
timezone_group:
description: 'Timezone group to notify (e.g. AEST, IST)'
required: true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timezone_group value should be an enum as opposed to a free input.

Comment on lines +22 to +27
- 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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @@
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants