Skip to content

fix(slack): remove dead call to __create_holmes_callback in SlackSinkPreview#2027

Merged
arikalon1 merged 1 commit intorobusta-dev:masterfrom
saintetix:fix/slack/holmes_callback
Mar 12, 2026
Merged

fix(slack): remove dead call to __create_holmes_callback in SlackSinkPreview#2027
arikalon1 merged 1 commit intorobusta-dev:masterfrom
saintetix:fix/slack/holmes_callback

Conversation

@saintetix
Copy link
Contributor

@saintetix saintetix commented Mar 11, 2026

Problem

When using the SlackSinkPreview sink, all alerts were falling back to the legacy Slack output format with the following error:

2026-03-11 10:01:38.616 ERROR    Failed to render slack preview template, defaulting to legacy slack output
Traceback (most recent call last):
  File "/app/src/robusta/integrations/slack/sender.py", line 669, in send_finding_to_slack
    return self.__send_finding_to_slack_preview(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/src/robusta/integrations/slack/sender.py", line 810, in __send_finding_to_slack_preview
    blocks.append(self.__create_holmes_callback(finding))
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SlackSender' object has no attribute '_SlackSender__create_holmes_callback'

Root Cause

The __create_holmes_callback method was removed in #1826 as part of the Holmes Slack format refactor, which replaced the callback button approach with the get_holmes_block text-based prompt. However, the call to __create_holmes_callback inside __send_finding_to_slack_preview was not removed, leaving a dangling reference that raised an AttributeError at runtime.

Fix

Remove the dead call to self.__create_holmes_callback(finding) and its surrounding condition in __send_finding_to_slack_preview.

Testing

  • Deploy with SlackSinkPreview configured and verify alerts render correctly without falling back to legacy output.

@CLAassistant
Copy link

CLAassistant commented Mar 11, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 131af460-03c5-4d1b-a827-71781cf0e9f2

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb5943 and 84cc3f7.

📒 Files selected for processing (1)
  • src/robusta/integrations/slack/sender.py
💤 Files with no reviewable changes (1)
  • src/robusta/integrations/slack/sender.py

Walkthrough

Removed the conditional that appended the Holmes "ask" callback/button block to Slack preview messages; all other preview construction (headers, links, source/description blocks) is unchanged.

Changes

Cohort / File(s) Summary
Holmes callback removal
src/robusta/integrations/slack/sender.py
Removed the conditional block (3 lines) that appended the Holmes "ask" callback/button to Slack preview blocks when HOLMES and HOLMES_ASK_SLACK_BUTTON are enabled; no signature or other behavior changes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • RoiGlinik
  • moshemorad
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing a dead call to __create_holmes_callback from SlackSinkPreview, which matches the actual code modification.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about the problem, root cause, fix, and testing approach for the removed Holmes callback code.
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
  • Post copyable unit tests in a comment

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.

…ender.py

Signed-off-by: Nicolas Clavier <nicolas.clavier@bedrockstreaming.com>
@saintetix saintetix force-pushed the fix/slack/holmes_callback branch from 6bb5943 to 84cc3f7 Compare March 12, 2026 08:05
@arikalon1 arikalon1 merged commit 1f0b67d into robusta-dev:master Mar 12, 2026
5 checks passed
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.

3 participants