feat(model): add alert Block Kit block#1610
Draft
zimeg wants to merge 1 commit into
Draft
Conversation
Add the `alert` layout block to slack-api-model, mirroring the existing HeaderBlock/MarkdownBlock conventions. - AlertBlock with text (plain_text|mrkdwn TextObject), level, blockId - Register type in GsonLayoutBlockFactory - Add alert(...) DSL helper to Blocks - Add parse + builder round-trip tests in BlockKitTest Ref: https://docs.slack.dev/reference/block-kit/blocks/alert-block Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1610 +/- ##
=========================================
Coverage 73.32% 73.33%
- Complexity 4520 4522 +2
=========================================
Files 478 478
Lines 14300 14302 +2
Branches 1490 1490
=========================================
+ Hits 10486 10488 +2
Misses 2923 2923
Partials 891 891
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
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
Adds the
alertBlock Kit layout block toslack-api-model, following the existingHeaderBlock/MarkdownBlockconventions (Lombok@Data @Builder @NoArgsConstructor @AllArgsConstructor,TYPEconstant, javadoc docs link).The
alertblock displays an inline alert message and is currently only supported in modals.Fields
text—plain_textormrkdwntext object (modeled asTextObject), max 200 characters. Required.level— severity:default|info|warning|error|success. Defaults todefaultwhen omitted.block_id— optional unique identifier.Changes
AlertBlockmodel class.alerttype inGsonLayoutBlockFactory.alert(...)DSL helper toBlocks.parseAlertBlocks(deserialization) andbuildAlertBlock(builder + serialize round-trip) tests inBlockKitTest.Docs reference
https://docs.slack.dev/reference/block-kit/blocks/alert-block
Validation
Ran the touched module's tests:
Result: PASS —
Tests run: 45, Failures: 0, Errors: 0, Skipped: 0(includes the two new alert tests).Note: JaCoCo coverage instrumentation had to be skipped because the repo's pinned JaCoCo version cannot instrument Java 25 (
Unsupported class file major version 69) class files in this environment; this is a local toolchain limitation unrelated to this change. The unit tests themselves pass.Co-Authored-By: Claude svc-devxp-claude@slack-corp.com