-
Notifications
You must be signed in to change notification settings - Fork 99
Fix issue labeling: solved opened and updated issues #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
08d1ff4
79930dd
604dd4e
1d9e4c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1507,25 +1507,51 @@ ${userReason}`; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nextWeekArray.push(li2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Determine if issue was created or updated in date range | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const issueCreatedDate = new Date(item.created_at); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Get the correct date range for filtering | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let startDateFilter, endDateFilter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (yesterdayContribution) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const today = new Date(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| startDateFilter = new Date(yesterday.toISOString().split('T')[0] + 'T00:00:00Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| endDateFilter = new Date(today.toISOString().split('T')[0] + 'T23:59:59Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else if (startingDate && endingDate) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| startDateFilter = new Date(startingDate + 'T00:00:00Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| endDateFilter = new Date(endingDate + 'T23:59:59Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Default to last 7 days if no date range is set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const today = new Date(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| startDateFilter = new Date(lastWeek.toISOString().split('T')[0] + 'T00:00:00Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| endDateFilter = new Date(today.toISOString().split('T')[0] + 'T23:59:59Z'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (yesterdayContribution) { | |
| const today = new Date(); | |
| const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000); | |
| startDateFilter = new Date(yesterday.toISOString().split('T')[0] + 'T00:00:00Z'); | |
| endDateFilter = new Date(today.toISOString().split('T')[0] + 'T23:59:59Z'); | |
| } else if (startingDate && endingDate) { | |
| startDateFilter = new Date(startingDate + 'T00:00:00Z'); | |
| endDateFilter = new Date(endingDate + 'T23:59:59Z'); | |
| } else { | |
| // Default to last 7 days if no date range is set | |
| const today = new Date(); | |
| const lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7); | |
| startDateFilter = new Date(lastWeek.toISOString().split('T')[0] + 'T00:00:00Z'); | |
| endDateFilter = new Date(today.toISOString().split('T')[0] + 'T23:59:59Z'); | |
| } | |
| if (yesterdayContribution) { | |
| const now = new Date(); | |
| // Get UTC date parts for today and yesterday | |
| const todayUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())); | |
| const yesterdayUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - 1)); | |
| startDateFilter = new Date(Date.UTC(yesterdayUTC.getUTCFullYear(), yesterdayUTC.getUTCMonth(), yesterdayUTC.getUTCDate(), 0, 0, 0)); | |
| endDateFilter = new Date(Date.UTC(todayUTC.getUTCFullYear(), todayUTC.getUTCMonth(), todayUTC.getUTCDate(), 23, 59, 59)); | |
| } else if (startingDate && endingDate) { | |
| // Parse startingDate and endingDate as UTC | |
| const [startYear, startMonth, startDay] = startingDate.split('-').map(Number); | |
| const [endYear, endMonth, endDay] = endingDate.split('-').map(Number); | |
| startDateFilter = new Date(Date.UTC(startYear, startMonth - 1, startDay, 0, 0, 0)); | |
| endDateFilter = new Date(Date.UTC(endYear, endMonth - 1, endDay, 23, 59, 59)); | |
| } else { | |
| // Default to last 7 days if no date range is set | |
| const now = new Date(); | |
| const todayUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate())); | |
| const lastWeekUTC = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() - 7)); | |
| startDateFilter = new Date(Date.UTC(lastWeekUTC.getUTCFullYear(), lastWeekUTC.getUTCMonth(), lastWeekUTC.getUTCDate(), 0, 0, 0)); | |
| endDateFilter = new Date(Date.UTC(todayUTC.getUTCFullYear(), todayUTC.getUTCMonth(), todayUTC.getUTCDate(), 23, 59, 59)); | |
| } |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider removing or gating debug logging for production environments.
Debug logs in production can expose sensitive data and create unnecessary noise. If these logs are only needed for development, use a conditional or appropriate logging level to prevent them from appearing in production.
| log(`[ISSUE DEBUG] Issue #${number} - isNewIssue: ${isNewIssue}, issueAction: ${issueAction}, state: ${item.state}, created: ${item.created_at}, updated: ${item.updated_at}`); | |
| if (process.env.NODE_ENV !== 'production') { | |
| log(`[ISSUE DEBUG] Issue #${number} - isNewIssue: ${isNewIssue}, issueAction: ${issueAction}, state: ${item.state}, created: ${item.created_at}, updated: ${item.updated_at}`); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (bug_risk): Subtracting days using Date constructor can yield unexpected results at month boundaries.
Date arithmetic using the Date constructor can fail at month boundaries. Use getTime() subtraction for consistent results.