`/api/tree` API applies unneeded time filter by default
- Dominant language
- Python
- Stars
- 9
- Forks
- 31
- Avg merge
- 3d 19h
- Merged PRs (30d)
- 16
Description
## Description
[`/api/tree`](https://staging.dashboard.kernelci.org/api/schema/swagger-ui/#/tree/tree_retrieve) queries for the latest checkout for each tree. By default, it filters by checkouts in the last 7 days. However, this operation is really fast now (queries a pre-computed table), and there should be no reason to have this limit by default.
Related to this, there is a misagreement between the API and the dashboard here:
- API default is `interval_in_days=7` (as mentioned above)
- The dashboard root `/` redirects to `/tree?i=7` and queries with `interval_in_days=7` (not present in production)
- Dashboard `/tree` queries with `interval_in_days=30`
## Proposed solution
Therefore, I suggest:
- Keep `interval_in_days` as optional, but do not filter if unset
- Make `/` redirect to `/tree` without hardcoded parameters
- Make `/tree` query with `interval_in_days` unset by default
- Alternatively, grab the default directly from the backend
Contributor guide
Research direction
Start by tracing the /api/tree endpoint and the dashboard / and /tree routes, focusing on where interval_in_days receives its defaults. Confirm the current behavior and make the defaults unset across these entry points, then verify that requests without the parameter return all available latest checkouts and that the redirect has no hardcoded interval.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100