feat: expose source_channel on activity feed
Adds p.source_channel to the SELECT and surfaces it on each event. Migration v22 populated the column with enum values: telegram, agent, maintenance, unknown, github. Timeline UI needs this to show per-event provenance (2340 telegram, 698 agent, 102 maintenance, 11 unknown, 1 github). Nulls fall back to "unknown" — only 0 rows currently null, but the fallback is defensive for future inserts before backfill runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
84f6d3682c
commit
9a943e8460
1 changed files with 3 additions and 1 deletions
|
|
@ -83,7 +83,8 @@ def _build_events():
|
||||||
try:
|
try:
|
||||||
rows = conn.execute("""
|
rows = conn.execute("""
|
||||||
SELECT p.number, p.branch, p.domain, p.agent, p.submitted_by,
|
SELECT p.number, p.branch, p.domain, p.agent, p.submitted_by,
|
||||||
p.merged_at, p.description, p.commit_type, p.cost_usd
|
p.merged_at, p.description, p.commit_type, p.cost_usd,
|
||||||
|
p.source_channel
|
||||||
FROM prs p
|
FROM prs p
|
||||||
WHERE p.status = 'merged'
|
WHERE p.status = 'merged'
|
||||||
AND p.commit_type = 'knowledge'
|
AND p.commit_type = 'knowledge'
|
||||||
|
|
@ -139,6 +140,7 @@ def _build_events():
|
||||||
"ci_earned": round(ci_earned, 2),
|
"ci_earned": round(ci_earned, 2),
|
||||||
"summary": summary_text,
|
"summary": summary_text,
|
||||||
"pr_number": row["number"],
|
"pr_number": row["number"],
|
||||||
|
"source_channel": row["source_channel"] or "unknown",
|
||||||
})
|
})
|
||||||
|
|
||||||
return events, claim_activity
|
return events, claim_activity
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue