Sync #core channel topic with on-call assignee#8
Merged
Conversation
Adds sync_oncall_topic() that sets the #core topic to "On call: <@user>" via conversations.setTopic. Hooked into the Monday announcement, switch, reboot, and scheduler startup so the topic tracks the roster without manual intervention. Diffs against the current topic before setting to avoid Slack's "X set the channel topic" system message spamming the channel on every restart. Requires the bot token to have the groups:write.topic scope.
Previously set the topic to "On call: (no one assigned)" on unassigned weeks; now clears it entirely so the channel topic is empty when there's nothing to announce.
- Replace inline monday_of_week(today).isoformat() with existing current_week_start() helper. - Replace list_roster + filter with direct get_roster_entry point lookup (one DynamoDB GetItem instead of querying all future weeks). - Drop the try/except around sync_oncall_topic() at scheduler startup since the helper already swallows and logs all exceptions.
ewels
added a commit
that referenced
this pull request
May 26, 2026
…topic sync The on-call Monday announcement (added March) and channel topic sync (added in #8) both depend on conversations.list / setTopic, which require channel scopes that were never documented. The bot has been silently failing both since the announcement feature shipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add automatic synchronization of the #core channel topic to reflect the current week's on-call assignee. The topic is updated whenever the on-call roster changes (via
/nf-core on-call switchor/nf-core on-call reboot) and on scheduler startup, with deduplication to avoid spamming the channel with system messages.Changes
New function
sync_oncall_topic()inscheduler/oncall_jobs.py:"On call: <@USER_ID>"or clears it if unassignedconversations_infoand only callsconversations_setTopicif the topic differsIntegration points:
run_oncall_scheduler()_send_channel_announcement()(weekly Monday job)handle_oncall_switch()handle_oncall_reboot()Comprehensive test coverage in
TestSyncOncallTopicandTestSyncOncallTopicNoChannel:conversations_infoandconversations_setTopicfailuresImplementation Details
current_week_start()helper to determine the active weekget_roster_entryfromdb/oncallto fetch the current assigneehttps://claude.ai/code/session_012pZCGBLwNVz4WHGWMaErHD