Repository navigation
fix(api): prevent Slack notification failures when alert message exceeds 3000 chars - #3473
Conversation
🦋 Changeset detectedLatest commit: ea3846b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Someone is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
PR Review
1 finding(s): 🔴 1 P0/P1 · 🟡 0 P2 · 🔵 0 P3 Already reported on an earlier push — no new comments. 1 unchanged from an earlier push (already inline above). Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
[Medium impact] The change reaches Slack alert notifications sent through webhook channels. The typed test fixtures and required changeset must be added before merging.
|
Deep ReviewScope: Intent (advisory): Stop Slack 🔴 P0/P1 — must fix
🟡 P2 — recommended
🔵 P3 nitpicks (3)
Reviewers (11): correctness, adversarial, reliability, testing, maintainability, kieran-typescript, api-contract, project-standards, previous-comments, agent-native, learnings-researcher. Resolved from prior review rounds: changeset Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
c18a0e9 to
edd160a
Compare
|
@Tyagiquamar ping me if the PR is ready for another look |
|
Updated:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 146d114. Configure here.
146d114 to
fe04689
Compare
…eds 3000 chars Fixes ClickHouse#3452 Slack section blocks enforce a strict 3000-character limit on the text field. Inline alert links encode large chartConfig objects in query params, causing the message block text to exceed 3000 chars and fail delivery with WEBHOOK_ERROR. Format Slack section text using formatSlackSectionText, which falls back to the shorter /alerts link if the link causes an overflow, and truncates the body safely if necessary. Signed-off-by: Mohd Quamar Tyagi <347892697+Tyagiquamar@users.noreply.github.com>
Signed-off-by: Mohd Quamar Tyagi <104281681+Tyagiquamar@users.noreply.github.com>
48681ae to
ea3846b
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|

Fixes #3452
Summary of changes
text.textfield.buildAlertMessageTemplateHdxLinkgenerates a chart explorer link containing the entire serializedchartConfigin query parameters. On alerts with multiple series or complex queries, this URL exceeds 2500+ characters, causing*<${message.hdxLink} | ${message.title}>*\n${message.body}to surpass Slack's 3000-character limit and fail delivery withWEBHOOK_ERROR.formatSlackSectionTextandgetFallbackHdxLinkinpackages/api/src/tasks/checkAlerts/transports/slack.ts:${origin}/alertslink....) so total block text never exceeds 3000 characters.packages/api/src/tasks/checkAlerts/transports/__tests__/slack.test.ts.Signed-off-by: Mohd Quamar Tyagi 347892697+Tyagiquamar@users.noreply.github.com
Note
Low Risk
Scoped to Slack transport formatting and inline alert deep links; no auth or data-path changes.
Overview
Slack alert webhooks now cap section block text at 3000 characters via
formatSlackSectionText, which truncates the message body with...while avoiding split emoji pairs and re-closing Markdown code fences when the cut lands inside a block.Inline alert notification links no longer use the chart explorer URL with a full serialized
chartConfigquery param. They usebuildAlertDetailsLink(/alerts/{alertId}with paddedfrom/to), shortening the link in the Slack header and aligning tests with that URL shape. New unit tests cover truncation and webhook formatting.Reviewed by Cursor Bugbot for commit ea3846b. Bugbot is set up for automated code reviews on this repo. Configure here.