Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/das/src/api/miners/miners.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export class MinersService {
AND sp.pr_number = i.solved_by_pr
-- Skip null-author solving PRs (no one to credit)
AND sp.author_github_id IS NOT NULL
AND BTRIM(sp.author_github_id) <> ''
-- Skip corrupted MERGED-without-merged_at shape
AND NOT (sp.state = 'MERGED' AND sp.merged_at IS NULL)
) AS solving_pr
Expand Down
5 changes: 4 additions & 1 deletion packages/das/src/webhook/github-fetcher.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,10 @@ export class GitHubFetcherService implements OnModuleInit {
{
repoFullName,
prNumber: pr.number,
authorGithubId: String(pr.author?.databaseId ?? ""),
authorGithubId:
pr.author?.databaseId != null
? String(pr.author.databaseId)
: null,
authorLogin: pr.author?.login ?? null,
authorAssociation: pr.authorAssociation ?? null,
title: pr.title,
Expand Down
7 changes: 7 additions & 0 deletions packages/db/26_normalize_blank_pr_author_ids.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- Normalize legacy bad rows where unknown PR author IDs were stored as blanks.
-- Unknown author identity must be NULL so solver-credit filters can exclude it.

UPDATE pull_requests
SET author_github_id = NULL
WHERE author_github_id IS NOT NULL
AND BTRIM(author_github_id) = '';