API endpoint for code coverage graph
Problem to solve
Getting data for code coverage over time is a manual slow process today. This is described in full in the issue to display the graph.
It is too slow to get the data every time the graph is drawn from the
ci builds table.
N/A - This is a backstage feature, won't be accessible.
This focuses on figuring out how to retrieve and store the code coverage data from the
ci_builds table that will be used by the graph. The API endpoint will then be consumed by the frontend on #33743.
Given there could be a number of different jobs that would run code coverage in a project, we will have to split this into 2 endpoints:
- For fetching all the available job names for the past 3 months. The values returned here will be rendered in the dropdown.
- For fetching the coverage values for the past 3 months for the given job name.
Permissions and Security
This is not a public API but rather will be used by the frontend to fetch data through AJAX requests.
No documentation change.
Availability & Testing
- What's the rate limiting on this look like?
- This would follow the same rate limiting from the other AJAX endpoints we have.
- Is the time range customizable?
- For now, we won't accept any custom time range and have this always return data within 3 months.
- What if there is no data yet?
- The API would return an empty hash or array