Conversation
Walkthrough
Changes
Sequence Diagram(s)sequenceDiagram
participant Controller as Controller
participant ASNotifications as ActiveSupport::Notifications
participant Notifier as Notifier/Destroyer
Controller->>ASNotifications: instrument('article.create', payload)
ASNotifications-->>Notifier: call(_name, _started, _finished, _unique_id, payload)
Notifier-->>ASNotifications: (通知処理・副作用実行)
Estimated code review effort3 (約45分) Possibly related PRs
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 RuboCop (1.76.1)app/controllers/articles_controller.rbrubocop-minitest extension supports plugin, specify app/controllers/works_controller.rbrubocop-minitest extension supports plugin, specify app/models/article_notification_destroyer.rbrubocop-minitest extension supports plugin, specify
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
@smallmonkeykey さん |
|
@hirokiej |
smallmonkeykey
left a comment
There was a problem hiding this comment.
@hirokiej
とても綺麗に移行できてると思います🙆
動作確認も丁寧に書かれていてわかりやすかったです!
Approveいたします👍
bdc60d2 to
112d0a9
Compare
|
@smallmonkeykey さん @komagata さん |
Issue
概要
以下の3クラスの実装を
newspaperからActiveSupport::Notificationsに置き換えました。変更確認方法
chore/replace-newspaper-with-notifications-in-article-and-work-notifierをローカルに取り込むforeman start -f Procfile.devでサーバーを立ち上げます。それぞれ投稿時に、メールが自動で開かない場合があるので、
letter_openerを使って確認をします。3-1.
ArticleNotifierの動作確認メンターや管理者が書くことができる「ブログ」の作成・更新に対してユーザーに通知を行う機能です。
komagataでログイン。komagatatesttesthajimeでログイン。hajimetesttest6.右上の通知に、4で公開した「すぐ公開したブログ」のみがあることを確認する。
7. http://localhost:3000/letter_opener を開き、
komagataが「すぐ公開したブログ」を投稿した旨のメールが届いているかを確認する。i)
command + fで、「WIPのブログ」が存在しないこと、「すぐ公開したブログ」のメールが存在することを確認。8.
komagataでログイン。komagatatesttest9.ブログからWIPにアクセスし、「WIPのブログ」を開き「公開する」をクリック。
10.
hajimeでログイン。hajimetesttest11.右上の通知に、9で公開した「WIPのブログ」があることを確認する。
12. http://localhost:3000/letter_opener を開き、
komagataが「WIPのブログ」が投稿した旨のメールが届いているかを確認する。i)
command + fで、「WIPのブログ」のメールが存在することを確認。3-2.
ArticleNotificationDestroyerの動作確認3-1で扱った「ブログ」の削除に対する通知を削除する機能です。
komagataでログイン。komagatatesttestotameshiでログイン。otameshitesttest3-3.
WorkNotifierの動作確認ポートフォリオを作成した際に、メンターと管理者に通知がいく機能です。
otameshiでログイン。otameshitesttest2.ポートフォリオの 作品を追加にアクセスする。
3. 任意のタイトル、URL(例:
https://google.com)、本文を入力し登録する。4.
komagataでログイン。komagatatesttest5.右上の通知に、3で登録したポートフォリオに関する通知があることを確認。
6. http://localhost:3000/letter_opener を開き、ポートフォリオ作成に関するメールが届いていることを確認。
※変更前(mainブランチなど)の挙動と、変更後の挙動が同じであることをご確認ください。
Screenshot
※内部的なリファクタリングであり、見た目の変更はないためスクリーンショットはありません。
Summary by CodeRabbit
リファクタリング
その他