-
Notifications
You must be signed in to change notification settings - Fork 1
Add date range filtering and fix test infrastructure #25
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: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -301,6 +301,36 @@ | |||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * Parse date filter string and return start/end dates | ||||||||||||||||||||||||||||||||||
| * Supports: "2026-01-27" (single day) or "2026-01-01..2026-01-31" (range) | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| private parseDateFilter(dateStr: string): { start: string; end: string } { | ||||||||||||||||||||||||||||||||||
| if (dateStr.includes('..')) { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| const [start, end] = dateStr.split('..'); | ||||||||||||||||||||||||||||||||||
| // End date: include full day by using next day midnight | ||||||||||||||||||||||||||||||||||
| const endDate = new Date(end + 'T00:00:00Z'); | ||||||||||||||||||||||||||||||||||
| endDate.setUTCDate(endDate.getUTCDate() + 1); | ||||||||||||||||||||||||||||||||||
| return { start: start + 'T00:00:00Z', end: endDate.toISOString() }; | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+312
to
+316
|
||||||||||||||||||||||||||||||||||
| const [start, end] = str.split('..'); | |
| // End date: include full day by using next day midnight | |
| const endDate = new Date(end + 'T00:00:00Z'); | |
| endDate.setUTCDate(endDate.getUTCDate() + 1); | |
| return { start: start + 'T00:00:00Z', end: endDate.toISOString() }; | |
| const [startRaw, endRaw] = str.split('..'); | |
| const startDate = new Date(startRaw + 'T00:00:00Z'); | |
| const endDate = new Date(endRaw + 'T00:00:00Z'); | |
| if (startDate > endDate) { | |
| throw new Error( | |
| `Invalid date range "${str}": start date must be less than or equal to end date.`, | |
| ); | |
| } | |
| // End date: include full day by using next day midnight (end is exclusive) | |
| endDate.setUTCDate(endDate.getUTCDate() + 1); | |
| return { start: startDate.toISOString(), end: endDate.toISOString() }; |
Copilot
AI
Feb 13, 2026
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.
The new parseDateFilter and filterByDateRange methods lack unit test coverage. While there are E2E tests that exercise these methods indirectly, there are no unit tests that validate edge cases such as invalid dates, reversed date ranges, malformed input, or boundary conditions.
Consider adding unit tests for the LocalRepositoryDataSource class to cover these critical date parsing scenarios, following the pattern established in test/unit/refresh-database.test.ts.
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.
The PR description lists incorrect dependency version updates. The description claims updates to @opentelemetry/api (1.9.0 → 2.0.0), @opentelemetry/sdk-node (0.57.2 → 0.200.0), @opentelemetry/auto-instrumentations-node (0.57.2 → 0.200.0), @ai-sdk/azure (1.3.22 → 2.0.6), and ai (4.3.15 → 4.3.16).
However, the actual changes are:
The PR description should be updated to reflect the actual dependency changes made.