Backfill contact_us_fyi communications as incoming, then drop the dual-condition checks
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 72/100
調査の方向性
app/models/notification.rb、contact-form/NotificationServices の作成パス、および spec/models/notification_spec.rb 内の .responded_status と #requires_response? の spec から始めます。contact_us_fyi の行は incoming であるべきだと確認した後、可逆的な backfill migration を追加し、作成処理と条件を更新してから、Notification の spec を実行し、migration の down path がガードされていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Context
In #2239 we extended the "needs response" concept from contact_us_fyi notifications to all incoming communications. Because existing contact_us_fyi rows are stored as direction: "outgoing", the code currently has to check both conditions:
Notification#requires_response?—kind == "contact_us_fyi" || incoming?Notification.responded_statusscope —where(kind: "contact_us_fyi").or(where(direction: "incoming")), and the"na"branch has to exclude both.
A contact_us_fyi is conceptually an incoming contact (the person reached out to us), so it should simply carry direction: "incoming". Once it does, the kind == "contact_us_fyi" half of every check is redundant and can go.
Work
- Create new
contact_us_fyinotifications as incoming. Update wherever they're generated (contact-form flow /NotificationServices) sodirection: "incoming"is set on creation. Do this first — otherwise removing the OR breaks newly-created rows. - Backfill existing rows — a reversible data migration:
Notification.where(kind: "contact_us_fyi", direction: "outgoing").update_all(direction: "incoming")(guard thedown). - Simplify the code once every
contact_us_fyiis incoming:requires_response?→incoming?responded_status→ key offdirection: "incoming"only:"yes"→where(direction: "incoming", responded: true)"no"→where(direction: "incoming", responded: false)"na"→where.not(direction: "incoming")
- Update specs in
spec/models/notification_spec.rb(the.responded_statusand#requires_response?groups) to reflect the single-condition logic.
Notes
- Sanity-check that no
contact_us_fyishould legitimately be outgoing before backfilling. - Files:
app/models/notification.rb, plus the contact-form/notification-creation path.
- 主要言語
- Ruby
- スター
- 15
- フォーク
- 28
- 平均マージ
- 1日 12分
- マージ済み PR(30日)
- 262
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rubyforgood/awbw のほかの issue
-
blocked
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rubyforgood/awbw#2824 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
rubyforgood/awbw#2822 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rubyforgood/awbw#2160 ·
メンテナーはふだん 1 日以内に返信
-
Update callout faq defualt text when the new person subscription launches対応中かも @maebeale が 78 日前に担当しました。 オープンblocked
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rubyforgood/awbw#2095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
rubyforgood/awbw#2088 ·
メンテナーはふだん 1 日以内に返信
rubyforgood/awbw の issue をすべて見る
似ている issue
-
triage
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
rubyaustralia/ruby_au#497 ·
-
ConcurrencyClaim sends NOTIFY even when enable_listen_notify is false対応中かも @eidam が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
bensheldon/good_job#1891 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
TheOdinProject/curriculum#31493 ·
メンテナーはふだん 1 日以内に返信