Skip to content

feat: slack default color from template#5014

Open
mkl262 wants to merge 5 commits intoprometheus:mainfrom
mkl262:main
Open

feat: slack default color from template#5014
mkl262 wants to merge 5 commits intoprometheus:mainfrom
mkl262:main

Conversation

@mkl262
Copy link

@mkl262 mkl262 commented Feb 16, 2026

Set slack default color as template, fix slack docs.

Summary by CodeRabbit

  • Improvements
    • Slack notification color assignment now uses template-based logic, providing "danger" for firing alerts and "good" for resolved alerts
    • Enhanced Slack configuration with additional fields for customizing notification appearance and content

Signed-off-by: Michael Kanchuker <michaelkanchuker@gmail.com>
@TheMeier
Copy link
Contributor

TheMeier commented Mar 1, 2026

can you please rebase that?

@mkl262
Copy link
Author

mkl262 commented Mar 10, 2026

@TheMeier Done.

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6bc4fd36-ddb2-49a5-a1d8-8e694447c7be

📥 Commits

Reviewing files that changed from the base of the PR and between 35cbf8d and de182d0.

📒 Files selected for processing (3)
  • config/notifiers.go
  • docs/configuration.md
  • template/default.tmpl

📝 Walkthrough

Walkthrough

The Slack notifier color template logic is refactored from an inline conditional in the configuration into a separate template definition, while documentation is updated to reflect the change and document related fields.

Changes

Cohort / File(s) Summary
Configuration Update
config/notifiers.go
Default Slack color template changed from inline conditional ({{ if eq .Status "firing" }}danger{{ else }}good{{ end }}) to template reference ({{ template "slack.default.color" . }})
Template Definition
template/default.tmpl
New slack.default.color template added, implementing the conditional logic to return "danger" for firing status, otherwise "good"
Documentation
docs/configuration.md
Updated Slack configuration defaults to reflect color field template change and documented icon_emoji, icon_url, message_text, and username fields with their default template values

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A template was born from a config so fine,
Where colors were sorted by status divine—
"Danger" when firing, "good" when it's calm,
Now reusable, clean, like a soothing balm! 🎨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is extremely brief and lacks required details such as linked issues, test information, documentation updates, and sign-offs as specified in the template. Add linked issue reference (Fixes #), clarify if tests were added, confirm documentation updates, and mention sign-off status following the PR checklist template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving Slack default color from a conditional expression to a template-based approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

You can customize the tone of the review comments and chat replies.

Configure the tone_instructions setting to customize the tone of the review comments and chat replies. For example, you can set the tone to Act like a strict teacher, Act like a pirate and more.

@mkl262
Copy link
Author

mkl262 commented Mar 18, 2026

@TheMeier Hi, Is there a reason why the checks are still pending?

@TheMeier
Copy link
Contributor

@mkl262 it says right there:

This workflow requires approval from a maintainer. Learn more about approving workflows.

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.

2 participants