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

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class DownloadStatsResource {
@GET
@Schema(hidden = true)
@Path("/total/{feature_version}/{release_name}")
@Operation(summary = "Get download stats for feature verson", description = "stats", hidden = true)
@Operation(summary = "Get download stats for feature version", description = "stats", hidden = true)
fun getTotalDownloadStatsForTag(
@Parameter(name = "feature_version", description = "Feature version (i.e 8, 9, 10...)", required = true)
@PathParam("feature_version")
Expand All @@ -102,6 +102,7 @@ class DownloadStatsResource {
?: throw BadRequestException("Unable to find version $featureVersion")

return getAdoptReleases(release)
.filter { it.release_type == ReleaseType.ga }
.filter { it.release_name == releaseName }
.flatMap { it.binaries.asSequence() }
.flatMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.junit.jupiter.api.assertThrows
import org.junit.jupiter.api.extension.ExtendWith
import java.time.format.DateTimeFormatter
import jakarta.ws.rs.BadRequestException
import net.adoptium.api.v3.models.ReleaseType

@ExtendWith(value = [DbExtension::class])
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
Expand Down Expand Up @@ -174,6 +175,7 @@ class DownloadStatsPathTest : FrontendTest() {
val releases = getReleases()

val release = releases
.filter { it.release_type == ReleaseType.ga }
.filter { it.vendor == Vendor.getDefault() }
.first()

Expand Down