Skip to content

feat: add config types, validation, and docs for Slack message strategies#5226

Draft
santiagofn wants to merge 3 commits into
prometheus:mainfrom
santiagofn:feat/slack-thread-config-and-docs
Draft

feat: add config types, validation, and docs for Slack message strategies#5226
santiagofn wants to merge 3 commits into
prometheus:mainfrom
santiagofn:feat/slack-thread-config-and-docs

Conversation

@santiagofn
Copy link
Copy Markdown
Contributor

@santiagofn santiagofn commented May 6, 2026

Part 4 of a series implementing threaded message support for the Slack notifier. Full picture: #5150. Depends on #5239 and #5225.

Summary

Adds configuration types, validation logic, and documentation for two new Slack message strategies: update and thread. Includes 7 new test configuration fixtures covering valid configs and expected error cases.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 604aca0e-07b1-4b44-820a-780f57727146

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@santiagofn santiagofn force-pushed the feat/slack-thread-config-and-docs branch 6 times, most recently from 0501fae to c036fa0 Compare May 19, 2026 17:39
santiagofn and others added 3 commits May 19, 2026 14:44
Moves SlackConfig (and the related SlackAction, SlackConfirmationField,
SlackField types plus DefaultSlackConfig) from config/notifiers.go into
a new notify/slack/config.go, following the same pattern used recently
for the mattermost, jira, and incidentio notifiers.

While moving them, the Slack prefix is dropped per the package-naming
guidance in https://go.dev/blog/package-names ("Avoid repetition"):
SlackConfig -> Config, DefaultSlackConfig -> DefaultConfig, SlackAction
-> Action, SlackConfirmationField -> ConfirmationField, SlackField ->
Field. External callers now refer to slack.Config etc., reading better
than the previous slack.SlackConfig stutter.

The Slack-specific unmarshal tests are moved alongside them into
notify/slack/config_test.go. config.Receiver now refers to
*slack.Config, and notify/slack no longer needs to import the top-level
config package.

No behavioral changes.

Signed-off-by: Santiago Fernández Núñez <santiago.nunez@nubank.com.br>
Co-authored-by: Cursor <cursoragent@cursor.com>
Previously the Slack notifier hardcoded the chat.update endpoint to
"https://slack.com/api/chat.update" regardless of the configured
api_url. Deployments pointing api_url at a Slack-compatible proxy or
forwarder were therefore forced back onto slack.com for update calls,
which is the wrong host for proxy users.

Move the URL handling into a new internal/apiurl package, and route
chat.update (and any future Slack Web API method) through the same
api_url / api_url_file base as the initial chat.postMessage call.
Standard configurations are unaffected; the generated URL is byte
identical.

The Resolver also reads api_url_file on every call, matching previous
behaviour so that file rotations apply to the next notification without
restarting Alertmanager.

Signed-off-by: Santiago Fernández Núñez <santiago.nunez@nubank.com.br>
Co-authored-by: Cursor <cursoragent@cursor.com>
…gies

Signed-off-by: Santiago Fernández Núñez <santiago.nunez@nubank.com.br>
@santiagofn santiagofn force-pushed the feat/slack-thread-config-and-docs branch from c036fa0 to c443a87 Compare May 19, 2026 17:54
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