Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Stamp a correlation id on Ahoy events so one save reads as one action

未关闭
#2,356 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
ruby
领域
backend, database

调研方向

先阅读 ApplicationController、Analytics::EventBuilder.lifecycle 以及 config/initializers/ahoy.rb 中现有的 promotion hook,以追踪事件的写入和 promote 过程。开始前检查相关的 #2351 issue。完成的标准是:同一请求中的事件共享一个可查询的 id,而不同请求中的事件不共享,并且 jobs 和 rake tasks 各自获得独立的 id。

由索引模型根据 Issue 内容生成。

描述

enhancement

🤖 From Claude:

One admin save that touches several records produces several unrelated events. ahoy_events has visit_id, but that's a session, not an action — there is no way to say "these five changes were one save."

A timeline that wants to render "Mae updated this registration" instead of five separate rows needs that grouping, and so does any "undo this action" or "what did that save actually do" view.

Why now rather than later

The column is cheap. The data is not backfillable — every event written before the id exists is permanently ungroupable. This is the same argument that made the capture fixes in #2245 urgent: nothing is lost by shipping the reader later, everything is lost by shipping the writer later.

Sketch

  • A per-request uuid (ApplicationController sets it alongside Current.user), stamped into properties by Analytics::EventBuilder.lifecycle and promoted to a column by the same before_validation hook in config/initializers/ahoy.rb that already promotes resource_type / resource_id.
  • Index it, so grouping is a lookup rather than a scan.
  • Jobs and rake tasks get their own id per run, which also gives "what did that job change" for free.

Acceptance

  • Two records changed in one request share an id; the same records changed in two requests don't.
  • The id is queryable as a column, not only inside the JSON payload.

Related: #2351 (many writes produce no event at all — worth fixing first, since an id on nothing is still nothing).

主要语言
Ruby
星标
15
派生
28
平均合并
1 天 12 分钟
30 天内合并 PR
262

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

rubyforgood/awbw 的其他 Issue

查看 rubyforgood/awbw 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。