Skip to content

Add SlackPlugin for Slack Web API notifications (issue #89, Phase 5)#99

Open
stalep wants to merge 1 commit into
Hyperfoil:mainfrom
stalep:issue_89_p5
Open

Add SlackPlugin for Slack Web API notifications (issue #89, Phase 5)#99
stalep wants to merge 1 commit into
Hyperfoil:mainfrom
stalep:issue_89_p5

Conversation

@stalep
Copy link
Copy Markdown
Member

@stalep stalep commented May 21, 2026

Posts change notifications to Slack channels using the Slack Web API (chat.postMessage) with Block Kit formatting, following the same patterns as Horreum's SlackChannelMessageAction.

Features:

  • Posts via Slack Web API (chat.postMessage) with Bearer token auth
  • Block Kit message with header, mrkdwn section, per-change details, divider, and context block with metadata
  • Fallback plain text for notification previews
  • Config: {"channel": "#perf-alerts"}
  • Secrets: {"token": "xoxb-..."}
  • Custom message template with {folderName}, {nodeName}, {nodeType}, {changeCount} placeholders — replaces the mrkdwn section body
  • Format-aware change details: ft shows value/bound/direction, rd shows ratio/value/previous
  • Checks Slack API "ok" response field (Slack returns 200 even on errors)
  • Configurable API URL via h5m.slack.api.url for testing

Tests (10):

  • Validation: valid config, null, empty, missing channel
  • Token: missing secrets, empty secrets
  • Send: Block Kit structure verification, auth header, custom template, Slack API error handling (channel_not_found)
  • Method identity check

…Phase 5)

Posts change notifications to Slack channels using the Slack Web API
(chat.postMessage) with Block Kit formatting, following the same
patterns as Horreum's SlackChannelMessageAction.

Features:
- Posts via Slack Web API (chat.postMessage) with Bearer token auth
- Block Kit message with header, mrkdwn section, per-change details,
  divider, and context block with metadata
- Fallback plain text for notification previews
- Config: {"channel": "#perf-alerts"}
- Secrets: {"token": "xoxb-..."}
- Custom message template with {folderName}, {nodeName}, {nodeType},
  {changeCount} placeholders — replaces the mrkdwn section body
- Format-aware change details: ft shows value/bound/direction,
  rd shows ratio/value/previous
- Checks Slack API "ok" response field (Slack returns 200 even on errors)
- Configurable API URL via h5m.slack.api.url for testing

Tests (10):
- Validation: valid config, null, empty, missing channel
- Token: missing secrets, empty secrets
- Send: Block Kit structure verification, auth header, custom template,
  Slack API error handling (channel_not_found)
- Method identity check
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