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

fix(slack): use attachments and add title and color fields #119

Merged
merged 4 commits into from
Jan 31, 2021

Conversation

piksel
Copy link
Member

@piksel piksel commented Jan 13, 2021

  • Use legacy attachments due to the color support
  • Use the normal text field as title
  • Allow color and title to be set using query and params
  • Don't override Bot name by default

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #119 (f1b343b) into main (4034690) will increase coverage by 2.79%.
The diff coverage is 79.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
+ Coverage   56.50%   59.30%   +2.79%     
==========================================
  Files          55       55              
  Lines        1168     1177       +9     
==========================================
+ Hits          660      698      +38     
+ Misses        464      429      -35     
- Partials       44       50       +6     
Impacted Files Coverage Δ
pkg/services/slack/slack_token.go 88.46% <ø> (ø)
pkg/services/slack/slack.go 65.21% <66.66%> (+1.58%) ⬆️
pkg/services/slack/slack_config.go 92.59% <71.42%> (+19.86%) ⬆️
pkg/services/slack/slack_json.go 100.00% <100.00%> (ø)
pkg/services/smtp/smtp_authtype.go 0.00% <0.00%> (ø)
pkg/services/smtp/smtp.go 81.42% <0.00%> (+0.13%) ⬆️
pkg/services/smtp/smtp_encmethod.go 62.50% <0.00%> (+6.94%) ⬆️
pkg/services/pushover/pushover.go 67.74% <0.00%> (+67.74%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4034690...f1b343b. Read the comment docs.

@piksel
Copy link
Member Author

piksel commented Jan 20, 2021

Remove maxlength check

if len(message) > maxlength {
return errors.New("message exceeds max length")
}

since it's way lower than the actual slack limits, slack automatically truncates too long messages, and because it doesn't help the user in any way since this is post configuration/initialization.

@piksel piksel requested a review from simskij January 21, 2021 10:55
@piksel piksel added this to the v0.4.0 milestone Jan 23, 2021
@piksel piksel merged commit 7e4a3bf into main Jan 31, 2021
@piksel piksel deleted the fix/slack-format branch January 31, 2021 15:56
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.

None yet

1 participant