Before submitting a topic, please confirm the following
I have searched for similar issues before creating this topic.
I have verified that my repository is using the Codecov GitHub app, if using GitHub
I have validated my codecov.yaml configuration file.
I have filled out the below sections to the best of my ability.
Description
Using Codecov API to retrieve coverage for flags gives incorrect results. The start_date param is not properly handled on the server side, thus I receive the response with the dates preceding the one that I wanted to start with. I am using a YYYY-MM-DD format to return all coverage for each dayfor the last 30 days but the API responds with the coverage starting nearly a year ago.
Documentation about the request I am using: Coverage trend
This is my request: https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/flags/js/coverage?interval=1d&start_date=2023-01-20&page_size=35
CI/CD URL
Not related.
Codecov Output
Not related
Expected Results
I expect to have the coverage for the provided ‘js’ flag for each day starting from the 30 days ago till today, all in one page. I expect only 30 days time range so it should all fit into one page size (35).
Actual Results
I receive the coverage for the provided flag since May 2022. The response includes 238 results (days), while it should have only 30. Thus, the response is paginated and I need to also add a ‘page’ param to retrieve exactly the data I want.
It happens only for the flag coverage.
When I request: https://api.codecov.io/api/v2/github/{owner}/repos/{repo}/coverage?interval=1d&start_date=2023-01-20&page_size=35 (same as before, but without /flags/js part), it returns the coverage starting from the date specified in the parameters. So the issue is definitely with the Flags Coverage endpoint.