feat(activity-feed): add pr_url field for GitHub PR clickthrough
Some checks failed
CI / lint-and-test (push) Has been cancelled
Some checks failed
CI / lint-and-test (push) Has been cancelled
This commit is contained in:
parent
c3f2010a42
commit
6c66da33e4
1 changed files with 10 additions and 1 deletions
|
|
@ -123,6 +123,12 @@ def _claim_target_url(claim_slug):
|
|||
return f"/claims/{claim_slug}"
|
||||
|
||||
|
||||
def _github_pr_url(github_pr):
|
||||
if not github_pr:
|
||||
return None
|
||||
return f"https://github.com/living-ip/teleo-codex/pull/{github_pr}"
|
||||
|
||||
|
||||
def _normalize_contributor(submitted_by, agent):
|
||||
if submitted_by and submitted_by.strip():
|
||||
name = submitted_by.strip().lstrip("@")
|
||||
|
|
@ -175,7 +181,7 @@ def _build_events():
|
|||
rows = conn.execute(f"""
|
||||
SELECT p.number, p.branch, p.domain, p.agent, p.submitted_by,
|
||||
p.merged_at, p.description, p.commit_type, p.cost_usd,
|
||||
p.source_channel, p.source_path
|
||||
p.source_channel, p.source_path, p.github_pr
|
||||
FROM prs p
|
||||
WHERE p.status = 'merged'
|
||||
AND p.commit_type IN ({placeholders})
|
||||
|
|
@ -228,6 +234,7 @@ def _build_events():
|
|||
"ci_earned": round(ci_earned, 2),
|
||||
"summary": summary_text,
|
||||
"pr_number": row["number"],
|
||||
"pr_url": _github_pr_url(row["github_pr"]),
|
||||
"source_channel": row["source_channel"] or "unknown",
|
||||
})
|
||||
continue
|
||||
|
|
@ -248,6 +255,7 @@ def _build_events():
|
|||
"ci_earned": round(ci_earned, 2),
|
||||
"summary": summary_text,
|
||||
"pr_number": row["number"],
|
||||
"pr_url": _github_pr_url(row["github_pr"]),
|
||||
"source_channel": row["source_channel"] or "unknown",
|
||||
})
|
||||
continue
|
||||
|
|
@ -286,6 +294,7 @@ def _build_events():
|
|||
"ci_earned": round(ci_earned, 2),
|
||||
"summary": summary_text,
|
||||
"pr_number": row["number"],
|
||||
"pr_url": _github_pr_url(row["github_pr"]),
|
||||
"source_channel": row["source_channel"] or "unknown",
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue