Skip to content

fix: address CodeRabbit review issues on slack-full-width PR #2107#2132

Closed
devin-ai-integration[bot] wants to merge 8 commits intomasterfrom
devin/1772363480-fix-coderabbit-issues
Closed

fix: address CodeRabbit review issues on slack-full-width PR #2107#2132
devin-ai-integration[bot] wants to merge 8 commits intomasterfrom
devin/1772363480-fix-coderabbit-issues

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Mar 1, 2026

fix: address CodeRabbit review issues on slack-full-width PR #2107

Summary

Addresses the CodeRabbit review comments from PR #2107. Key changes:

  • Fix invalid Slack Block Kit payload (Critical): Replaced {"type": "rich_text", "elements": []} with a valid block containing a minimal rich_text_section. Empty elements arrays violate the Slack API and cause invalid_blocks errors.
  • Graceful table truncation: list_of_dicts_to_markdown_table now accepts a max_length param and removes rows from the end instead of letting get_limited_markdown_msg cut mid-row, which produced malformed markdown.
  • Preview validation in full-width mode: Full-width preview blocks now go through _validate_preview_blocks instead of bypassing it.
  • Consistent description rendering: Aligned _get_elementary_test_template description handling with _get_dbt_test_template (single block instead of separate header + context).
  • Docs: Capitalized "markdown" → "Markdown" as a proper noun.

Review & Testing Checklist for Human

  • Verify the rich_text space-character block renders acceptably in Slack. The {"type": "text", "text": " "} is valid per API but may render as a visible blank line. Test with --slack-full-width in a real Slack channel.
  • Check that preview padding blocks don't cause visual issues in full-width mode. Validation now pads preview to 5 blocks — these empty section blocks were designed for attachment fold control. In full-width (main body), they may appear as unnecessary whitespace. Consider whether full-width should skip padding.
  • Confirm the description rendering change in _get_elementary_test_template is acceptable. This changes the appearance of all elementary test alerts (not just full-width), switching from a two-block layout (header + context) to a single text_section_block.
  • Test table truncation with a large test_rows_sample to verify the (truncated) note appears and no markdown is cut mid-row.

Notes

  • Requested by: @haritamar
  • Devin Session
  • Unit tests pass locally (14/14). Full end-to-end Slack rendering was not tested — manual verification in a Slack workspace is recommended.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added --slack-full-width command-line flag to enable full-width Slack alert formatting, displaying test results as Markdown tables with improved visual presentation.
  • Documentation

    • Updated Slack integration documentation to describe the new full-width layout option and flag usage.

michrzan and others added 8 commits February 9, 2026 17:33
- Capitalize 'markdown' to 'Markdown' in docs
- Replace invalid empty rich_text block with valid Slack Block Kit structure
- Add preview validation for full-width mode
- Handle markdown table truncation gracefully (row-by-row instead of mid-row)
- Align description rendering between dbt and elementary test templates
- Update tests to reflect valid rich_text block and exact assertions

Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Mar 1, 2026

👋 @devin-ai-integration[bot]
Thank you for raising your pull request.
Please make sure to add tests and document all user-facing changes.
You can do this by editing the docs files in this pull request.

@coderabbitai
Copy link

coderabbitai bot commented Mar 1, 2026

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

📥 Commits

Reviewing files that changed from the base of the PR and between 746ce41 and 3718396.

📒 Files selected for processing (13)
  • docs/oss/deployment-and-configuration/slack.mdx
  • docs/oss/guides/alerts/send-slack-alerts.mdx
  • elementary/config/config.py
  • elementary/messages/formats/block_kit.py
  • elementary/messages/formats/markdown.py
  • elementary/messages/formats/text.py
  • elementary/monitor/cli.py
  • elementary/monitor/data_monitoring/alerts/integrations/integrations.py
  • elementary/monitor/data_monitoring/alerts/integrations/slack/message_builder.py
  • elementary/monitor/data_monitoring/alerts/integrations/slack/slack.py
  • elementary/utils/json_utils.py
  • tests/unit/monitor/data_monitoring/alerts/integrations/slack/test_slack_alert_message_builder.py
  • tests/unit/utils/test_json_utils.py
 __________________________________________________
< I want to be a VS Code extension when I grow up. >
 --------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

✏️ Tip: You can disable in-progress messages and the fortune message in your review settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1772363480-fix-coderabbit-issues

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

@devin-ai-integration devin-ai-integration bot deleted the devin/1772363480-fix-coderabbit-issues branch March 1, 2026 11:19
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