Skip to content

Product系3クラス分newspaperをActiveSupport::Notificationsに移行#8965

Merged
komagata merged 6 commits intomainfrom
chore/replace-newspaper-with-notifications-in-product-notifier
Jul 24, 2025
Merged

Product系3クラス分newspaperをActiveSupport::Notificationsに移行#8965
komagata merged 6 commits intomainfrom
chore/replace-newspaper-with-notifications-in-product-notifier

Conversation

@hirokiej
Copy link
Copy Markdown
Contributor

@hirokiej hirokiej commented Jul 19, 2025

Issue

概要

下記の3クラスの実装をnewspaperからActiveSupport::Notificationsに置き換えました。

  • ProductAuthorWatcher
  • ProductNotifierForColleague
  • ProductNotifierForPracticeWatcher

変更確認方法

  1. chore/replace-newspaper-with-notifications-in-product-notifierをローカルに取り込む
git fetch origin chore/replace-newspaper-with-notifications-in-product-notifier
git checkout chore/replace-newspaper-with-notifications-in-product-notifier
  1. foreman start -f Procfile.devでサーバーを立ち上げます。

以下の3つのクラスは全て「提出物」に関するものです。
それぞれ、「提出物を作るユーザー」、「研修生の同僚(アドバイザーなど)」、「提出物をウォッチするユーザー(担当しているメンターなど)」が対象です。
そのため、「研修生」、「その研修生のアドバイザー」、「提出物の担当者(メンター)」でログインすることで動作確認をします。
3-1、3-2、3-3と順に動作確認をお願いします。


3-1. ProductNotifierForPracticeWatcherの動作確認

提出された提出物の担当者になった際に、その提出物の「ウォッチャー」(更新通知を受け取る人)として、自動的に登録する機能です。

以下の手順で、このウォッチャーの機能が正しく機能されているか確認します。

  1. komagataでログイン。
  • ID: komagata
  • PASS:testtest
  1. kensyu-end-within-1-weekの提出物にアクセスする。

  2. 任意のコメントを残し担当者になります。

  3. 以下の3-3まで進み、komagataでログインした際に右上の通知欄にその提出物に関するコメントがあることを確認。


3-2. ProductNotifierForColleagueの動作確認

研修生が提出物を提出した際の、研修生の同僚(アドバイザー)に付与される「ウォッチャー」機能です。

  1. senpaiでログイン
  • ID: senpai
  • PASS:testtest
  1. 右上の通知欄に「komagata」のコメント通知があることを確認し、クリック。
  2. 任意のコメントを残す。

3-3. ProductAuthorWatcherの動作確認

提出物を作成した際に、その提出物の作成者自身を、その提出物の「ウォッチャー」(更新通知を受け取る人)として、自動的に登録する機能です。

  1. komagataでログイン。
  • ID: komagata
  • PASS:testtest
    ( 3-1の4を確認。)
  1. kensyu-end-within-1-weekの提出物を合格にする。
  2. kensyu-end-within-1-weekでログイン。
  • ID: kensyu-end-within-1-week
  • PASS:testtest
  1. 右上の通知欄で提出物が確認されたことを確認。

※変更前(mainブランチなど)の挙動と、変更後の挙動が同じであることをご確認ください。

Screenshot

※内部的なリファクタリングであり、見た目の変更はないためスクリーンショットはありません。

Summary by CodeRabbit

Summary by CodeRabbit

  • 新機能

    • 製品作成イベントの通知方式が改善され、より堅牢なイベント通知システムに対応しました。
    • 新たに複数のウォッチャー・通知者が製品作成イベントに連動して動作するようになりました。
  • バグ修正

    • 重複したウォッチレコードが作成されないように修正されました。
  • テスト

    • 通知機能のテストが新しいイベント通知方式に対応しました。

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 19, 2025

"""

Walkthrough

プロダクト作成時のイベント通知方法を、独自のNewspaperシステムからRails標準のActiveSupport::Notificationsへ移行しました。関連するウォッチャー・ノティファイアークラスのメソッドシグネチャを更新し、初期化処理での購読設定もActiveSupport::Notifications用に変更しています。

Changes

ファイル群 変更概要
app/controllers/products_controller.rb Newspaper.publish(:product_create, ...)ActiveSupport::Notifications.instrument('product.create', ...) に置換。
app/models/product_author_watcher.rb
app/models/product_notifier_for_colleague.rb
app/models/product_notifier_for_practice_watcher.rb
call(payload)call(_name, _started, _finished, _unique_id, payload) へシグネチャ変更。内部処理は主にそのまま。ProductAuthorWatcherはWatch作成処理をfind_or_create_by!に変更。
config/initializers/active_support_notifications.rb product.create イベントに対し、3つのウォッチャー/ノティファイアークラスを購読登録。
config/initializers/newspaper.rb Newspaper経由の3つのイベント購読を削除。
test/models/product_notifier_for_practice_watcher_test.rb テストでの call 呼び出しを新しいシグネチャに合わせて修正。

Sequence Diagram(s)

sequenceDiagram
  participant Controller as ProductsController
  participant ASNotifications as ActiveSupport::Notifications
  participant Watcher as ProductAuthorWatcher
  participant NotifierColleague as ProductNotifierForColleague
  participant NotifierPractice as ProductNotifierForPracticeWatcher

  Controller->>ASNotifications: instrument('product.create', product)
  ASNotifications->>Watcher: call(_name, _started, _finished, _unique_id, payload)
  ASNotifications->>NotifierColleague: call(_name, _started, _finished, _unique_id, payload)
  ASNotifications->>NotifierPractice: call(_name, _started, _finished, _unique_id, payload)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • komagata

Poem

うさぎの耳でピョンと聞く、
新聞やめて通知の旅、
Railsの鐘がリンリン鳴り、
ウォッチャーたちも踊り出す。
コードの森に春が来て、
みんなで祝う新しい流れ!
🐰✨
"""

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/products_controller.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader.rb:66:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:160:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:81:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'

app/models/product_author_watcher.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader.rb:66:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:160:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:81:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'

config/initializers/active_support_notifications.rb

rubocop-minitest extension supports plugin, specify plugins: rubocop-minitest instead of require: rubocop-minitest in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
rubocop-capybara extension supports plugin, specify plugins: rubocop-capybara instead of require: rubocop-capybara in /.rubocop.yml.
For more information, see https://docs.rubocop.org/rubocop/plugin_migration_guide.html.
Unable to find gem rubocop-fjord; is the gem installed? Gem::MissingSpecError
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:309:in rescue in gem_config_path' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:293:in gem_config_path'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:84:in block (2 levels) in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in reverse_each'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:82:in block in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in each_pair'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader_resolver.rb:76:in resolve_inheritance_from_gems' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_loader.rb:66:in load_file'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/config_store.rb:29:in options_config=' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:160:in act_on_options'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:47:in block in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:81:in profile_if_needed'
/var/lib/gems/3.1.0/gems/rubocop-1.77.0/lib/rubocop/cli.rb:43:in run' /var/lib/gems/3.1.0/gems/rubocop-1.77.0/exe/rubocop:19:in <top (required)>'
/usr/local/bin/rubocop:25:in load' /usr/local/bin/rubocop:25:in

'

  • 3 others

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8fec381 and 5037d78.

📒 Files selected for processing (7)
  • app/controllers/products_controller.rb (1 hunks)
  • app/models/product_author_watcher.rb (1 hunks)
  • app/models/product_notifier_for_colleague.rb (1 hunks)
  • app/models/product_notifier_for_practice_watcher.rb (1 hunks)
  • config/initializers/active_support_notifications.rb (1 hunks)
  • config/initializers/newspaper.rb (0 hunks)
  • test/models/product_notifier_for_practice_watcher_test.rb (1 hunks)
💤 Files with no reviewable changes (1)
  • config/initializers/newspaper.rb
🚧 Files skipped from review as they are similar to previous changes (5)
  • config/initializers/active_support_notifications.rb
  • app/models/product_author_watcher.rb
  • app/controllers/products_controller.rb
  • app/models/product_notifier_for_colleague.rb
  • app/models/product_notifier_for_practice_watcher.rb
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rb

⚙️ CodeRabbit Configuration File

**/*.rb: # refactoring

  • まずFat Controllerを避け、次にFat Modelを避ける。
  • Serviceクラスの乱用を避ける。
  • controller concernを作ろうとしたらPORO(Plain Old Ruby Object)やActiveRecordモデルでの実装で代替できないか検討する。

Rails Patterns

  • ViewHelperにメソッドを実装する時にはまずDecoratorパターンを使うことを検討する。(active_decorator gemを導入しているのでそれを使う)
  • 複雑なActiveRecordクエリがあり、再利用できそうな場合はQueryObjectパターンを検討する。(rails-patterns gemを導入しているのでそれのQuery機能を使う)
  • Viewにpartialを作る場合はViewComponentを使うことを検討する。
  • 複数のActiveRecordモデルを操作する1つの責務がある時や外部APIとやりとりする処理がある場合にはInteractorオブジェクトパターンを検討する。(interactor gemを導入しているのでそれを使う)
  • 複数のInteractorを実行するような処理がある場合Organizerオブジェクトパターンを検討する。(interactor gemを導入しており、その中にOrganizerの機能があるので使う)

Files:

  • test/models/product_notifier_for_practice_watcher_test.rb
test/**/*

⚙️ CodeRabbit Configuration File

test/**/*: # Test

  • TestCase名は英語で書く。
  • どうしても避けられない時以外にsystem testでsleepは使わない。

Unit Test

model, helper, decorator, view_componentについてはメソッドを追加した場合は必ず対応したUnit TestのTestCaseを1つは書く。

Files:

  • test/models/product_notifier_for_practice_watcher_test.rb
🧠 Learnings (2)
📓 Common learnings
Learnt from: jun-kondo
PR: fjordllc/bootcamp#0
File: :0-0
Timestamp: 2025-07-23T21:11:21.775Z
Learning: fjordllc/bootcampプロジェクトの`app/models/inquiry_notifier.rb`において、`NOTIFICATION_SENDER_NAME`で指定される管理者ユーザーは必ず存在することがシステムの前提条件として保証されているため、senderがnilになることは想定されておらず、エラーハンドリングは不要である。
Learnt from: reckyy
PR: fjordllc/bootcamp#8356
File: app/models/notification.rb:45-47
Timestamp: 2025-07-15T12:58:02.735Z
Learning: fjordllc/bootcampプロジェクトの`app/models/notification.rb`において、`training_completed`通知種別は`TARGETS_TO_KINDS`ハッシュに含めない設計になっている。これは`training_completed`が通知一覧のフィルタ対象ではないためで、意図的な設計判断である。
Learnt from: jun-kondo
PR: fjordllc/bootcamp#0
File: :0-0
Timestamp: 2025-07-23T21:11:21.775Z
Learning: fjordllc/bootcampプロジェクトの`app/models/work_notification_destroyer.rb`において、このクラスは`app/controllers/works_controller.rb`の`destroy`アクションから呼び出され、`before_action :set_my_work`でIDの妥当性チェックが事前に行われるため、payloadのworkオブジェクトは常に有効であることが保証されている。そのためエラーハンドリングは不要。
Learnt from: jun-kondo
PR: fjordllc/bootcamp#8977
File: app/controllers/reports_controller.rb:63-63
Timestamp: 2025-07-23T20:31:13.816Z
Learning: fjordllc/bootcampプロジェクトの`app/controllers/reports_controller.rb`において、`create`と`update`アクションは両方とも`@report.save_uniquely`を使用し、同じ`:report_save`イベントと`'report.save'`イベントを発行する。これは両方とも本質的に「レポートの保存」操作であり、作成と更新を区別する必要がないためである。
test/models/product_notifier_for_practice_watcher_test.rb (7)

Learnt from: masyuko0222
PR: #8934
File: app/controllers/test_feature_toggle_controller.rb:4-6
Timestamp: 2025-07-15T04:26:24.899Z
Learning: テスト用の一時的なコードで、すぐにリバートされる予定の場合、nil安全性などの防御的プログラミングの実装は不要とされることがある。

Learnt from: e-yanagita-gs
PR: #8771
File: app/controllers/welcome_controller.rb:57-57
Timestamp: 2025-06-30T01:07:46.192Z
Learning: プロジェクトでは、仕様上データの存在が保証されている場合、nil処理を省略することがある。特にFAQ表示のような特定機能に特化したPRでは、データの存在を前提とした実装が採用される。

Learnt from: thmz337
PR: #8590
File: app/models/movie.rb:22-24
Timestamp: 2025-07-12T09:56:13.360Z
Learning: Rails scopeでnilやfalseを返すと、NoMethodErrorは発生せず、代わりにModel.allが返される。これによりメソッドチェインは継続するが、全レコードが読み込まれるため意図しない動作となる可能性がある。

Learnt from: e-yanagita-gs
PR: #8881
File: app/javascript/transform-head-sharp.js:1-8
Timestamp: 2025-07-04T01:28:44.174Z
Learning: Tagifyライブラリは空文字列のタグを自動的に追加しないという仕様があるため、変換処理で空文字列を生成することで不要なタグの追加を防ぐことができる。

Learnt from: jun-kondo
PR: fjordllc/bootcamp#0
File: :0-0
Timestamp: 2025-07-23T21:11:21.775Z
Learning: fjordllc/bootcampプロジェクトのapp/models/work_notification_destroyer.rbにおいて、このクラスはapp/controllers/works_controller.rbdestroyアクションから呼び出され、before_action :set_my_workでIDの妥当性チェックが事前に行われるため、payloadのworkオブジェクトは常に有効であることが保証されている。そのためエラーハンドリングは不要。

Learnt from: reckyy
PR: #8356
File: app/models/notification.rb:45-47
Timestamp: 2025-07-15T12:58:02.735Z
Learning: fjordllc/bootcampプロジェクトのapp/models/notification.rbにおいて、training_completed通知種別はTARGETS_TO_KINDSハッシュに含めない設計になっている。これはtraining_completedが通知一覧のフィルタ対象ではないためで、意図的な設計判断である。

Learnt from: jun-kondo
PR: fjordllc/bootcamp#0
File: :0-0
Timestamp: 2025-07-23T21:11:21.775Z
Learning: fjordllc/bootcampプロジェクトのapp/models/inquiry_notifier.rbにおいて、NOTIFICATION_SENDER_NAMEで指定される管理者ユーザーは必ず存在することがシステムの前提条件として保証されているため、senderがnilになることは想定されておらず、エラーハンドリングは不要である。

🪛 ast-grep (0.38.6)
test/models/product_notifier_for_practice_watcher_test.rb

[warning] 27-33: Found the use of an hardcoded passphrase for RSA. The passphrase can be easily discovered, and therefore should not be stored in source-code. It is recommended to remove the passphrase from source-code, and use system environment variables or a restricted configuration file.
Context: ProductNotifierForPracticeWatcher.new.call(
'product_create',
Time.current,
Time.current,
'unique_id',
payload
)
Note: [CWE-798]: Use of Hard-coded Credentials [OWASP A07:2021]: Identification and Authentication Failures [REFERENCES]
https://cwe.mitre.org/data/definitions/522.html

(hardcoded-secret-rsa-passphrase-ruby)

⏰ 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)
  • GitHub Check: build_and_test
🔇 Additional comments (2)
test/models/product_notifier_for_practice_watcher_test.rb (2)

26-26: ペイロードの明示的な代入が可読性を向上させています。

新しいメソッドシグネチャに合わせてペイロードを事前に準備することで、メソッド呼び出し部分がより読みやすくなっています。


28-34: ActiveSupport::Notificationsインターフェースへの移行が適切に実装されています。

メソッドシグネチャの変更に合わせて、5つのパラメータ(イベント名、開始時刻、終了時刻、ユニークID、ペイロード)を正しく渡しています。パラメータの配置も分かりやすく整理されており、過去のレビューコメントで言及されていた可読性の高い実装になっています。

なお、静的解析ツールがRSAパスフレーズのハードコードについて警告していますが、これは'unique_id'という単純なテスト用の識別子であり、誤検知です。

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/replace-newspaper-with-notifications-in-product-notifier

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hirokiej hirokiej force-pushed the chore/replace-newspaper-with-notifications-in-product-notifier branch 2 times, most recently from 736b9d8 to 34492ae Compare July 20, 2025 13:10
@hirokiej hirokiej requested a review from Miya096jp July 20, 2025 15:04
@hirokiej hirokiej marked this pull request as ready for review July 20, 2025 15:04
@hirokiej hirokiej removed the request for review from Miya096jp July 20, 2025 15:04
@hirokiej hirokiej self-assigned this Jul 20, 2025
@hirokiej hirokiej requested a review from Miya096jp July 20, 2025 15:37
@hirokiej
Copy link
Copy Markdown
Contributor Author

@Miya096jp さん
お疲れ様です!
レビュー依頼です!
こちらお願いしても良いでしょうか🙇?

@Miya096jp
Copy link
Copy Markdown
Contributor

@hirokiej

お疲れ様です!
了解です!🙆🏻‍♂️

Copy link
Copy Markdown
Contributor

@Miya096jp Miya096jp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hirokiej

コードの方は問題ないと思います!
Discriptionに誤記がありましたので、そこだけ修正お願いします!

内容:
提出物の作成者がkensyuと書いてありますが、実際はkensyu-end-within-1-weekでした。

def call(_name, _started, _finished, _unique_id, payload)
product = payload[:product]
Watch.create!(user: product.user, watchable: product)
Watch.find_or_create_by!(user: product.user, watchable: product)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カスタムクエリで安全性が高まっていいなと思いました👍

Time.current,
'unique_id',
payload
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使わない引数でも、nilを使わずにラベリングすると可読性が高くなりますね!💡

@hirokiej hirokiej force-pushed the chore/replace-newspaper-with-notifications-in-product-notifier branch from 34492ae to 8fec381 Compare July 24, 2025 04:41
@hirokiej
Copy link
Copy Markdown
Contributor Author

@Miya096jp さん
ご確認ありがとうございます!
そして、コメントもありがとうございます。
修正がなくても、良い部分についてコメントする、というのが素敵だなと思い、自分も真似していきたいなと思いました。

ディスクリプションの「提出物」をkensyuにしたつもりでしたが、そうじゃなかったみたいでしたすみません💦
kensyuからkensyu-end-within-1-weekに全て書き換えましたので、再度ご確認よろしくお願いします🙇

Copy link
Copy Markdown
Contributor

@Miya096jp Miya096jp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hirokiej

変更ありがとうございます!
OKです!🙆🏻‍♂️

@hirokiej hirokiej force-pushed the chore/replace-newspaper-with-notifications-in-product-notifier branch from 8fec381 to 5037d78 Compare July 24, 2025 06:27
@hirokiej
Copy link
Copy Markdown
Contributor Author

@Miya096jp さん
ご確認ありがとうございます🙇

@komagata さん
メンバーのレビューが終了しましたので、レビューをよろしくお願いいたします🙇

Copy link
Copy Markdown
Member

@komagata komagata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

確認させて頂きました。OKです〜🙆‍♂️

@komagata komagata merged commit 6dcda95 into main Jul 24, 2025
5 checks passed
@komagata komagata deleted the chore/replace-newspaper-with-notifications-in-product-notifier branch July 24, 2025 07:16
@github-actions github-actions bot mentioned this pull request Jul 24, 2025
87 tasks
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.

3 participants