From e42862383ffcb3f6ec172f91ee48cae6269a316d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:57:10 +0000 Subject: [PATCH 1/3] Initial plan From 53a8ea7f70067b8db558535a8f427e8dd34c3a8c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:02:47 +0000 Subject: [PATCH 2/3] Fix end date inclusivity for issues and commits - Adjust getIssuesSince to add 1 day to end date for GraphQL search - Adjust fetchCommitsForDefaultBranch to add 1 day to until parameter - PRs already work correctly with timestamp comparison Co-authored-by: ChrisTimperley <523560+ChrisTimperley@users.noreply.github.com> --- src/services/github.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/services/github.ts b/src/services/github.ts index b5bddcd..59df3b8 100644 --- a/src/services/github.ts +++ b/src/services/github.ts @@ -272,7 +272,12 @@ export class GitHubService { const perPage = 50; let after: string | null = null; const sinceIso = since.toISOString().split('T')[0]; - const untilIso = until ? until.toISOString().split('T')[0] : null; + // For the end date, add 1 day to make it inclusive (GitHub search uses start of day) + const untilIso = until + ? new Date(until.getTime() + 24 * 60 * 60 * 1000) + .toISOString() + .split('T')[0] + : null; console.log(`🔍 Fetching issues (graphql) from ${owner}/${repo}...`); @@ -303,7 +308,8 @@ export class GitHubService { // Build search qualifier string. Use created range and is:issue to exclude PRs. let searchQual = `repo:${owner}/${repo} is:issue created:>=${sinceIso}`; - if (untilIso) searchQual += ` created:<=${untilIso}`; + // Use < instead of <= since we already added 1 day to make it inclusive + if (untilIso) searchQual += ` created:<${untilIso}`; // Sort by created desc to help early termination searchQual += ' sort:created-desc'; @@ -425,7 +431,10 @@ export class GitHubService { `; const sinceIso = since.toISOString(); - const untilIso = until ? until.toISOString() : undefined; + // For the end date, add 1 day to make it inclusive + const untilIso = until + ? new Date(until.getTime() + 24 * 60 * 60 * 1000).toISOString() + : undefined; let hasNext = true; do { From 2a3cf44af62d12bdfa6a697c2cd60374c77d462d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:05:47 +0000 Subject: [PATCH 3/3] Fix end date inclusivity for commit counts across branches Co-authored-by: ChrisTimperley <523560+ChrisTimperley@users.noreply.github.com> --- src/services/github.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/github.ts b/src/services/github.ts index 59df3b8..f7058db 100644 --- a/src/services/github.ts +++ b/src/services/github.ts @@ -559,7 +559,10 @@ export class GitHubService { // Step 2: For each ref, query commit history const sinceIso = since.toISOString(); - const untilIso = until?.toISOString(); + // For the end date, add 1 day to make it inclusive + const untilIso = until + ? new Date(until.getTime() + 24 * 60 * 60 * 1000).toISOString() + : undefined; for (const ref of refs) { console.log(` � Querying commits for ref: ${ref.name}`);