fix: stamp _repo into github-repo commit payloads for project attribution
The /repos/{owner}/{repo}/commits endpoint doesn't include repo info
in its response. Without _repo in the payload, these commits were
invisible to the projects query. Add _repo to parse_commit and include
it in the COALESCE chain for github source repo extraction.
After deploy, reset github-repo poller state to re-ingest with _repo:
DELETE FROM poller_state WHERE source LIKE 'github-repo%';
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -244,13 +244,18 @@ fn parse_commit(item: &Value, repo: &Repo) -> Option<Event> {
|
||||
.ok()?
|
||||
.with_timezone(&Utc);
|
||||
|
||||
let mut payload = item.clone();
|
||||
if let Some(obj) = payload.as_object_mut() {
|
||||
obj.insert("_repo".into(), Value::String(repo.full_name.clone()));
|
||||
}
|
||||
|
||||
Some(Event {
|
||||
id: format!("github-commit:{sha}"),
|
||||
source: Source::Github,
|
||||
action: "Commit".into(),
|
||||
occurred_at,
|
||||
public: !repo.private,
|
||||
payload: item.clone(),
|
||||
payload,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +145,8 @@ impl EventReader for PgStore {
|
||||
CASE source
|
||||
WHEN 'github' THEN COALESCE(
|
||||
payload->'repo'->>'name',
|
||||
payload->'repository'->>'full_name'
|
||||
payload->'repository'->>'full_name',
|
||||
payload->>'_repo'
|
||||
)
|
||||
WHEN 'gitea' THEN COALESCE(
|
||||
payload->'repo'->>'full_name',
|
||||
|
||||
Reference in New Issue
Block a user