diff --git a/src/github/backfill.ts b/src/github/backfill.ts index 582262cf50..f31f17bb31 100644 --- a/src/github/backfill.ts +++ b/src/github/backfill.ts @@ -1467,6 +1467,7 @@ async function backfillRepository(env: Env, repo: RepositoryRecord, limits: Back warnings.push(...labels.warnings, ...issuePage.warnings, ...pullRequestPage.warnings, ...recentMergedPage.warnings); const issues = issuePage.items.filter((issue) => !issue.pull_request); + const openIssueCount = issues.length; const pullRequests = pullRequestPage.items; const recentMerged = recentMergedPage.items.filter((pr) => Boolean(pr.merged_at)); @@ -1548,7 +1549,7 @@ async function backfillRepository(env: Env, repo: RepositoryRecord, limits: Back primaryLanguage: metadata.language, defaultBranch: metadata.default_branch, isPrivate: metadata.private, - openIssuesCount: issuePage.fetchedCount, + openIssuesCount: openIssueCount, openPullRequestsCount: pullRequestPage.fetchedCount, recentMergedPullRequestsCount: recentMergedPage.fetchedCount, labelsSyncedAt: completedAt, @@ -1567,7 +1568,7 @@ async function backfillRepository(env: Env, repo: RepositoryRecord, limits: Back fetchedAt: completedAt, primaryLanguage: metadata.language, defaultBranch: metadata.default_branch, - openIssuesCount: issuePage.fetchedCount, + openIssuesCount: openIssueCount, openPullRequestsCount: pullRequestPage.fetchedCount, recentMergedPullRequestsCount: recentMergedPage.fetchedCount, payload: { @@ -1581,7 +1582,7 @@ async function backfillRepository(env: Env, repo: RepositoryRecord, limits: Back return { repoFullName: repo.fullName, status, - openIssues: issuePage.fetchedCount, + openIssues: openIssueCount, openPullRequests: pullRequestPage.fetchedCount, recentMergedPullRequests: recentMergedPage.fetchedCount, warnings,