Skip to content
Draft
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
20 changes: 16 additions & 4 deletions src/services/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}...`);

Expand Down Expand Up @@ -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';

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -550,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}`);
Expand Down