Skip to content

fix: actions in slack notification#4054

Merged
Siumauricio merged 3 commits intoDokploy:canaryfrom
vincent-tarrit:4053-fix-slack-notifications-content
Apr 5, 2026
Merged

fix: actions in slack notification#4054
Siumauricio merged 3 commits intoDokploy:canaryfrom
vincent-tarrit:4053-fix-slack-notifications-content

Conversation

@vincent-tarrit
Copy link
Copy Markdown
Contributor

@vincent-tarrit vincent-tarrit commented Mar 23, 2026

Greptile Summary

This PR fixes broken Slack notification actions in the build error and build success notification flows. The original code used a legacy attachment actions array with a url-based button (type: "button", url: buildLink), which doesn't function without Slack Interactive Components configured on the app. The fix removes the actions block and instead adds a "Details" field using Slack's mrkdwn hyperlink syntax (<url|text>).

  • The approach is sound, but the mrkdwn <url|text> syntax in an attachment fields.value requires mrkdwn_in: ["fields"] on the attachment object to be rendered as an actual hyperlink — without it, Slack renders the text literally (e.g. <https://…|View Build Details>), so the link will still not be clickable.
  • The bulk of the diff is a whitespace reformatting (tabs → 2-space indentation) across both files; no other logic was changed.

Confidence Score: 3/5

  • The fix addresses the right problem but introduces a new rendering issue — the mrkdwn link in field values will render as literal text without mrkdwn_in: ["fields"], so the build link will still not be clickable for Slack users.
  • The intent is correct (replacing non-functional interactive actions with a static link), but the replacement will silently produce unformatted literal text in Slack field values. Adding mrkdwn_in: ["fields"] to both attachments is a one-line fix needed before this works as intended.
  • Both packages/server/src/utils/notifications/build-error.ts and packages/server/src/utils/notifications/build-success.ts need mrkdwn_in: ["fields"] added to their Slack attachment objects.

Reviews (1): Last reviewed commit: "fix: actions in slack notification" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 23, 2026
Comment on lines +240 to +244
{
title: "Details",
value: `<${buildLink}|View Build Details>`,
short: false,
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 mrkdwn link won't render in field values without mrkdwn_in

Slack does not apply mrkdwn formatting to attachment fields.value by default. The <url|text> syntax in value will render as a literal string (e.g. <https://…|View Build Details>) rather than a clickable hyperlink, which is just as broken as the previous approach.

To enable mrkdwn rendering in field values, mrkdwn_in: ["fields"] must be added to the attachment object.

The same issue exists in packages/server/src/utils/notifications/build-success.ts at line 256–260.

Suggested change
{
title: "Details",
value: `<${buildLink}|View Build Details>`,
short: false,
},
{
title: "Details",
value: `<${buildLink}|View Build Details>`,
short: false,
},
],
mrkdwn_in: ["fields"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't look necessary.

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 24, 2026
@vincent-tarrit
Copy link
Copy Markdown
Contributor Author

vincent-tarrit commented Mar 31, 2026

Do you have some news ? I really need this merge 🙏🏼 Thank you @Siumauricio

@Siumauricio Siumauricio merged commit 9287721 into Dokploy:canary Apr 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants