Skip to content

Add subscribable iCal feeds for on-call rosters#4

Merged
ewels merged 1 commit intomainfrom
feat/oncall-calendar-feeds
Mar 24, 2026
Merged

Add subscribable iCal feeds for on-call rosters#4
ewels merged 1 commit intomainfrom
feat/oncall-calendar-feeds

Conversation

@ewels
Copy link
Copy Markdown
Member

@ewels ewels commented Mar 24, 2026

Summary

  • Adds /nf-core on-call calendar all and /nf-core on-call calendar me commands that return subscribable iCal URLs for the on-call schedule
  • Pre-generates .ics files to S3, served via CloudFront with unguessable token URLs (no auth needed)
  • Calendars auto-regenerate on every roster mutation (switch, skip, reboot, unavailable) and the Monday scheduler tick

Infrastructure

  • S3 bucket (nf-core-bot-calendars) with BLOCK_ALL public access
  • CloudFront distribution with OAI for HTTPS serving, 5-min default cache TTL
  • ECS task role gets s3:PutObject permission
  • Two new env vars: CALENDAR_S3_BUCKET, CALENDAR_CLOUDFRONT_DOMAIN

New files

File Purpose
src/nf_core_bot/calendar/__init__.py Module marker
src/nf_core_bot/calendar/generator.py iCal generation, S3 upload, regenerate_calendars()
src/nf_core_bot/commands/oncall/calendar_cmd.py Slash command handler
tests/test_oncall_calendar.py 24 tests

Design decisions

  • safe_regenerate_calendars() wraps all calendar work in try/except so it never breaks existing functionality if S3 isn't configured
  • Calendar command uses asyncio.create_task for fire-and-forget regeneration (user gets URL immediately)
  • get_or_create_calendar_token() uses DynamoDB ConditionExpression to prevent race conditions
  • Roster is fetched once and passed through all generators (1 DynamoDB scan instead of N+2)
  • Display name cache avoids repeated users.info API calls

Expose .ics calendar feeds via S3 + CloudFront so core-team members
can subscribe to the on-call schedule in Google Calendar or any
calendar app that supports URL subscriptions.

New commands:
- /nf-core on-call calendar all — global feed with all assignments
- /nf-core on-call calendar me  — personal feed for the caller

Calendars are regenerated automatically whenever the roster changes
(switch, skip, reboot, unavailable) and on the Monday scheduler tick.
URLs use an unguessable token for basic obfuscation.

Infrastructure: S3 bucket + CloudFront distribution added to CDK stack.
@ewels ewels merged commit 420063d into main Mar 24, 2026
3 checks passed
@ewels ewels deleted the feat/oncall-calendar-feeds branch March 24, 2026 12:33
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.

1 participant