Conversation
0a00c87 to
371e8be
Compare
371e8be to
faf3486
Compare
14d25f7 to
38050d4
Compare
e590f37 to
5a3425b
Compare
e5252a7 to
eea4e27
Compare
|
|
||
| Raises ValueError if the timestamp strings are not valid numbers. | ||
| """ | ||
| if start_timestamp is not None and end_timestamp is not None: |
There was a problem hiding this comment.
what if only one of the parameters is not None? Ex.: in case start_timestamp is 10 days ago and end_timestamp is None. From what I can see the start_timestamp would be overwritten to 7 days ago
There was a problem hiding this comment.
I have improved that by setting default values, and no overriding now. Thanks
| "start_timestamp, end_timestamp, status_code, has_error_body", | ||
| [ | ||
| (_TS_START, _TS_END, HTTPStatus.OK, False), | ||
| ("not_a_number", _TS_END, HTTPStatus.BAD_REQUEST, True), |
There was a problem hiding this comment.
should we include invalid end_timestamp on test?
dashboard/src/api/issue.ts
Outdated
| const fetchIssueListing = async ({ | ||
| intervalInDays, | ||
| const getDefaultEndTimestamp = (): number => | ||
| dateObjectToTimestampInSeconds( |
There was a problem hiding this comment.
Do we need time? cant we round to start/end of day?
There was a problem hiding this comment.
I'll take a few minutes to try it. It seems very legitm
There was a problem hiding this comment.
This function does the job https://date-fns.org/v4.1.0/docs/startOfTomorrow
| type: object | ||
| description: Optional filter dictionary for additional query parameters | ||
| - in: query | ||
| name: interval_in_days |
There was a problem hiding this comment.
Should we remove this parameter?
There was a problem hiding this comment.
@dede999 run the generate-schema.sh to update the schema automatically
There was a problem hiding this comment.
Just added the change to the PR. You can check it again
| -5, | ||
| None, | ||
| None, | ||
| HTTPStatus.BAD_REQUEST, | ||
| True, |
There was a problem hiding this comment.
why remove this test case?
There was a problem hiding this comment.
It was removed, because the behavior was modified. Now there are default values for start and end values
There was a problem hiding this comment.
even if there are defaults, a user could make a manual request with the wrong values
There was a problem hiding this comment.
Which is checked on the test below
a6bde1e to
cc4ec2e
Compare
MarceloRobert
left a comment
There was a problem hiding this comment.
Looks good, there's just a problem in the frontend in case the user tries to type in a small year such as "25" instead of "2025"
Add support for explicit start/end Unix timestamp parameters to the api/issue listing endpoints, mirroring the existing behaviour of the api/hardware view. Unit and integration tests updated and extended with timestamp-based test cases and an invalid-timestamp error case.
Replace interval_in_days + starting_date with start/end timestamp parameters throughout test fixtures and client helpers. Use dynamic timestamps computed at runtime so tests don't go stale.
Replace the single `intervalInDays` URL param with optional `startTimestampInSeconds` and `endTimestampInSeconds` params in the issues route. Restrict InputTime to routes that still use intervalInDays and swap the time input for the new DateRangeInput component.
Add a date range picker with two native date inputs for the issues listing page. Invalid selections (end before start) show an inline error with a red border and a message below the inputs, clearing after 3s.
Replace interval_in_days + starting_date_iso_format params with direct startTimestampInSeconds and endTimestampInSeconds, matching the new backend contract. Defaults to last 5 days when params are absent from URL.
Test that the fetch function sends startTimestampInSeconds and endTimestampInSeconds to /api/issue/, includes backend-compatible filter params, returns the API response, and propagates errors.
Cover page load, date range input defaults, start/end date URL updates, validation preventing end-before-start navigation, table size change, pagination, and row visibility. � The commit message kernelci#2 will be skipped: � fixup! test(issues): add E2E tests for issue listing page
This is made by stabilizing queryKey with `roundToNearestMinutes`, and it was a crucial change as iyt might have overloaded the backend with unnecessary queries
- Rename TEN_DAYS to ISO_DATE_LENGTH (10) for clarity - Add ONE_DAY constant for yesterday date calculation - Fix end date test to use yesterday instead of a future date - Fix table size option from '25' (non-existent) to '20' - Remove unused startValue variable in end-date test Closes kernelci#1784
10 tests covering: defaults, explicit timestamps, partial args, start > end validation, float timestamps, invalid inputs, equal timestamps, and UTC timezone enforcement. Moreover, some changes were brought to the date range. to simplify it and treat some cases that one or another timestamp might not be provided.
start_date now defaults to end_date - 7d instead of now() - 7d, so an API call with only a past end_timestamp no longer raises ValueError. A future-only start still correctly raises since end defaults to now(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… error map - Export MILLISECONDS_IN_ONE_SECOND from utils/date and reuse it - Replace template literal classNames with cn() utility - Type errorMessageIds with MessageDescriptor['id'] - Bump error message text size from xs to sm Closes kernelci#1784
cc4ec2e to
249edbe
Compare

Description
This PR adds the feature of querying issues by start and end dates
How to Test
You have some ways to test it:
http://localhost:5173/issuesand checking these behaviorshttp://localhost:5173/issues?et=1774915200&st=1772323200and checking if the dates are March 1st and 31st 2026Related issue
Closes #1784