Skip to content
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

Fix inconsistency of the data returned by the API #747

Conversation

xavierfacq
Copy link
Member

@xavierfacq xavierfacq commented Oct 17, 2023

This PR is to resolve (partially) this issue adoptium/dash.adoptium.net#385
There is some inconsistency in data returned by the API.

Two endpoints do not return same data because they do not filter values in the same way.

Filter is .filter { it.release_type == ReleaseType.ga }

line 67 getTotalDownloadStats()
⚠️ do not have the filter

and

line 93 getTotalDownloadStatsForTag()
✔️ have a filter

➡️ I have added the filter to both function. Maybe I should remove the filter from the second, let me know.

Checklist

  • You added tests to cover the change
  • mvn clean install build and test completes
  • You changed or added to the documentation

@xavierfacq xavierfacq marked this pull request as ready for review October 17, 2023 19:21
@xavierfacq
Copy link
Member Author

Note that this PR will not fix the difference of counts returned by https://api.adoptium.net/v3/stats/downloads/total/
It will be in another PR.

@karianna
Copy link
Contributor

code change looks OK but @johnoliver to check on the semantics here

@xavierfacq
Copy link
Member Author

@johnoliver Note that I have found that in the following method, data are NOT filtered to compute the Total.
We can talk about that on Slack when your are available.

In GitHubDownloadStatsCalculator, line 55

return repos .repos .values .map { featureRelease -> val total = featureRelease .releases .getReleases() .filter { it.vendor == Vendor.getDefault() } .sumOf { it.download_count.toInt() }

@xavierfacq xavierfacq marked this pull request as draft October 18, 2023 08:27
@xavierfacq
Copy link
Member Author

We chose to add as a parameter the list of types we want to include releaseTypes: List<ReleaseType>? . By leaving the filter on “ga” by default as before.

To fix the related issue (adoptium/dash.adoptium.net#385), we have to modify calls from the dashboard to retrieve all releaseTypes to compute drilldowns.

In api.tsx:
https://api.adoptium.net/v3/stats/downloads/total/${jdkVersion}?release_types=ga&release_types=ea

@xavierfacq xavierfacq marked this pull request as ready for review October 19, 2023 13:31
@johnoliver johnoliver merged commit 6fd13d3 into adoptium:main Oct 19, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants