Replace the Auditor write path with MemberActivityRecorder — one funnel for activity rows
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 72/100
調査の方向性
Start by reading MemberActivityRecorder and app/services/auditor.rb, then trace the two Auditor::Audit call sites in ContactPreferencesController and Admin::SponsorsController. Check Sponsor's activities helper and the listed direct activity reads before changing the write path. Done means one PublicActivity::Activity creation location, preserved sponsor-consent activity keys, reported recorder failures, and removal of app/services/auditor.rb.
索引モデルが issue の本文から書いたものです。
説明
Problem
MemberActivityRecorder describes itself as the "single funnel for member-activity rows" and is used by ~18 controllers and services. But writes to PublicActivity::Activity still happen through two different wrappers:
MemberActivityRecorder.record(actor:, key:, trackable:, recipient:)— validates keys against aKEYSvocabulary, never raises (logs failures viaRails.logger.warn).Auditor::Audit(app/services/auditor.rb) — ad-hoc wrapper, passesparameters:(a changes hash or{note: ...}), used only by:ContactPreferencesController#audit_contact_subscriptionAdmin::SponsorsController#audit_contact_subscriptionSponsorincludesAuditor::Modelfor a read-only#activitieshelper
Both write the same table with the same columns. Two funnels means inconsistent key vocabularies, no key validation on the Auditor path, and duplicate machinery.
(Direct reads of PublicActivity::Activity — Admin::MembersController, Admin::Members::ActivityStrip, SubscriptionTombstoneBackfill — are fine as-is; only writes need one funnel.)
Proposed change
- Extend
MemberActivityRecorderto accept the one thingAuditorhas that it lacks:parameters(the note/changes payload). - Re-point the two
Auditor::Audit.new(...)call sites atMemberActivityRecorder.record, registering theirsponsor.contact_subscribe/sponsor.contact_unsubscribekeys inKEYS. - Failure policy: keep the recorder's swallow-and-continue behaviour, but report failures with
Rails.error.reportinstead ofRails.logger.warnso they reach Rollbar (same pattern asApplicationJob). Raising by default was considered and rejected: recording is a side effect and must not turn a completed user action into a 500. - Move
Sponsor#activities(the only useful part ofAuditor::Model) to where it's used, and deleteapp/services/auditor.rb.
Acceptance
PublicActivity::Activity.createis called in exactly one place:MemberActivityRecorder.- Sponsor contact-consent changes still appear in the sponsor's activity trail with the same keys.
- Recorder failures surface in Rollbar.
app/services/auditor.rbdeleted.
- 主要言語
- Ruby
- スター
- 104
- フォーク
- 205
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 77
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codebar/planner のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
-
InvitationManager silently no-ops on non-invitable events/workshops while controllers flash successオープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
refactoring tech debt
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
codebar/planner の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
TheOdinProject/curriculum#31433 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
stablyai/orca#24145 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
endoflife-date/endoflife.date#11194 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100