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
提出物に関するSlack通知のテキストを修正する #421
Conversation
slack-notifierはdevelopmentでも環境変数必須… |
@ikaruga777 @komagata |
@sanfrecce-osaka productionに干渉する必要はないのですが、herokuの環境変数にいる想定であれば、development用の設定だけおいておけばよさそうですね。 |
@ikaruga777 |
This reverts commit f8fea35.
Production環境以外でSlackの通知をしっかりと確認したいということがなければ、無理にgemを入れなくてもslack-notifierを挟まずににログ出力すればよいのかなと思いました。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます!
@@ -38,6 +38,8 @@ def notify(text, options = {}) | |||
|
|||
notifier = Slack::Notifier.new ENV["SLACK_WEBHOOK_URL"], username: username | |||
notifier.ping text, icon_url: icon_url, attachments: attachments | |||
else | |||
Rails.logger.info "Notify\ntext:#{text}\nparams:#{options}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Rails.logger.info "Notify\ntext:#{text}\nparams:#{options}"
+logger.info "Notify\ntext:#{text}\nparams:#{options}"
で大丈夫そう
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
開発中、Rails
を付けないと、No method errorでテストが落ちることがあり、付けて対応したものです。
今確認したところ、Rails
外してもテストが通ったので、次回付近を修正する時に一緒に直します!
マージ後なのでおもに思考の共有のために書きます 📝
|
👍 いま Notifierみたいなクラスでslackをラップしたクラス作って、 class Notifier
def initialize(webhook_url: ENV['SLACK_WEBHOOK_URL'], channel:)
if webhook_url.present?
@notifier = Slack::Notifier.new(webhook_url, channel: channel)
end
end |
fixes #409
SlackのメッセージAPIでは独自記法をサポートしています。
Basic message formatting | Slack
提出物のコメント、確認時にこの記法が崩れるのでキャプチャのように修正します。