feat: add Block Kit output mode#33
Draft
Koan-Bot wants to merge 3 commits into
Draft
Conversation
Adds opt-in Block Kit support for post_* convenience methods. When constructed with format => 'blocks', colored methods produce Slack Block Kit sections with emoji severity prefixes instead of legacy attachments with colored sidebars. Default behavior (attachments) is unchanged. post() always sends raw payloads regardless of format setting. Addresses #24. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cpm now requires Perl 5.24+, breaking CI for older Perl versions in the Docker-based matrix. cpanm supports Perl 5.8+ and handles cpanfile installation identically. The ubuntu job (system Perl 5.38) keeps cpm since it works fine there. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6 tasks
Add examples/blocks.pl showing both format=>'blocks' mode and manual Block Kit via post(). Expand post() POD to mention Block Kit as the recommended format for custom layouts. Subsumes PR #25 content — that PR can be closed after this merges. Co-Authored-By: Claude Opus 4.6 <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.
What
Add native Block Kit output mode via
format => 'blocks'constructor option.Why
Slack's legacy attachment format (colored sidebars) is no longer evolving. Block Kit is the recommended format for new development (#24). This gives users a simple migration path without changing their post_* call sites.
How
formataccessor:'attachment'(default, backwards compatible) or'blocks'notify_slack()emits a singlesectionblock with mrkdwn textpost()is unaffected — always sends raw payloadsexamples/blocks.plshowing both modes (native + manual via post())Testing
t/block-kit.t(all post_* methods, title rendering, post_end timing, raw post bypass)t/hooks.tunchanged — default attachment mode behavior preservedResolves #24. Supersedes #25 (Block Kit docs now included here).
🤖 Generated with Claude Code