Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change alert parts calculations #1084

Merged
merged 31 commits into from
Oct 23, 2024

Conversation

AleksandrMatsko
Copy link
Member

Change the rule for calculating alert parts if they are too big

There is no limits on tag length and tags count, so users can use a lot of long tags. In such case the function that resizes alert parts got bad data, which results to wrong calculations and panic in notifier.

This PR offers new function for resizing alert parts. Now the space is distributed between tags, trigger description and events block. If possible, space is given to description and events.

This PR affects the following senders:

  • mattermost
  • slack
  • telegram

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 85.71429% with 11 lines in your changes missing coverage. Please review.

Project coverage is 52.64%. Comparing base (0197720) to head (3493326).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
senders/calc_message_parts.go 82.75% 4 Missing and 1 partial ⚠️
senders/msgformat/highlighter.go 70.00% 2 Missing and 1 partial ⚠️
senders/telegram/message_formatter.go 85.71% 2 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1084       +/-   ##
===========================================
- Coverage   66.85%   52.64%   -14.21%     
===========================================
  Files         219      287       +68     
  Lines       12778    16593     +3815     
===========================================
+ Hits         8543     8736      +193     
- Misses       3684     7303     +3619     
- Partials      551      554        +3     

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

@AleksandrMatsko AleksandrMatsko marked this pull request as ready for review September 17, 2024 06:27
@AleksandrMatsko AleksandrMatsko requested a review from a team as a code owner September 17, 2024 06:27
@AleksandrMatsko AleksandrMatsko merged commit ae27338 into master Oct 23, 2024
6 checks passed
@AleksandrMatsko AleksandrMatsko deleted the refactor/change-alert-parts-calculations branch October 23, 2024 12:45
Copy link

Build and push Docker images with tag: 2024-10-23.ae27338

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.

5 participants