Skip to content

fix(slack): truncate slack body message if limit is reached#171

Merged
pfongkye merged 3 commits into
ManoManoTech:mainfrom
pfongkye:fix-webhook-failures
May 13, 2026
Merged

fix(slack): truncate slack body message if limit is reached#171
pfongkye merged 3 commits into
ManoManoTech:mainfrom
pfongkye:fix-webhook-failures

Conversation

@pfongkye
Copy link
Copy Markdown
Contributor

@pfongkye pfongkye commented May 12, 2026

In an attempt to fix this issue:

  • Truncate text that exceeds 3000 characters as Slack rejects those blocks with invalid_blocks errors. There was a bug in the truncation which did not take into account the appended message length properly. The latter resulted in exceeding the Slack limit in some cases.
  • Adjust body-parser limit to default 5mb which can be configured using CONFIG.requestBodySizeLimit. This is due to the fact that Gitlab webhook payloads routinely exceed the previous 500kb when MRs carry long descriptions.

@pfongkye pfongkye requested review from cicoub13 and greg0ire May 12, 2026 16:42
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.13%. Comparing base (f4e10c4) to head (37daf65).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   89.10%   89.13%   +0.02%     
==========================================
  Files         103      103              
  Lines        2248     2254       +6     
  Branches      429      431       +2     
==========================================
+ Hits         2003     2009       +6     
  Misses        232      232              
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pfongkye pfongkye force-pushed the fix-webhook-failures branch from aa9a985 to a5f8459 Compare May 12, 2026 16:56
Comment thread __tests__/core/utils/slackifyText.test.ts Outdated
@pfongkye pfongkye force-pushed the fix-webhook-failures branch from 97810fb to fd17171 Compare May 13, 2026 08:59
@pfongkye pfongkye requested a review from greg0ire May 13, 2026 09:43
@pfongkye pfongkye force-pushed the fix-webhook-failures branch from 08b9087 to 37daf65 Compare May 13, 2026 09:46
@pfongkye pfongkye merged commit 9314be3 into ManoManoTech:main May 13, 2026
3 checks passed
@pfongkye pfongkye deleted the fix-webhook-failures branch May 13, 2026 16:05
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