Skip to content

Commit

Permalink
Remove PATCH version method
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0der committed Jun 2, 2024
1 parent 374af93 commit db59a83
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,33 +76,6 @@ trait VersionReleaseRoutes
}
}
}
} ~ patch {
entity(as[PatchVersionReleaseRequest]) { req =>
validate(req.candidate, req.platform, req.url, req.checksums) {
complete {
onFinding(req.candidate, req.version, req.platform) {
(candidateO, versionO, platform) =>
val existing = for {
existingCandidate <- candidateO
oldVersion <- versionO
newVersion = Version(
existingCandidate.candidate,
oldVersion.version,
platform,
req.url getOrElse oldVersion.url,
req.vendor orElse oldVersion.vendor,
req.visible orElse oldVersion.visible,
req.checksums orElse oldVersion.checksums
)
} yield updateVersion(oldVersion, newVersion)
.map(res => res)
existing.map(noContentResponseF()) getOrElse badRequestResponseF(
s"Does not exist: ${req.candidate} ${req.version} $platform"
)
}
}
}
}
} ~ delete {
entity(as[DeleteVersionReleaseRequest]) { req =>
validate(req.candidate, Some(req.platform), None, None) {
Expand Down
22 changes: 0 additions & 22 deletions src/test/resources/features/release_version_checksums.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,3 @@ Feature: Release version with checksums
Then the status received is 400 BAD_REQUEST
And the message containing "Invalid checksum for algorithm(s): MD5,SHA-1,SHA-224,SHA-384,SHA-512" is received

Scenario: Change the checksum of an existing candidate version
Given the consumer for candidate groovy is making a request
And the URI /groovy-x.y.z.zip is available for download
And the UNIVERSAL candidate groovy with default version 2.3.6 already exists
And an existing UNIVERSAL groovy version 2.3.6 exists
When a JSON PATCH on the /versions endpoint:
"""
|{
| "candidate" : "groovy",
| "version" : "2.3.6",
| "platform": "UNIVERSAL",
| "url" : "http://localhost:8080/groovy-x.y.z.zip",
| "checksums" : {
| "MD5": "8f817c305a1bb15428b4aa29b844d75c",
| "SHA-256": "01bfe9d471b7cb1f8321204e6fa05a574db3ae5b67c5bd2f17184ffd521387f1"
| }
|}
"""
Then the status received is 204 NO_CONTENT
And groovy version 2.3.6 with URL http://localhost:8080/groovy-x.y.z.zip was published for UNIVERSAL to mongodb
And groovy version 2.3.6 on platform UNIVERSAL has a checksum "8f817c305a1bb15428b4aa29b844d75c" using algorithm MD5
And groovy version 2.3.6 on platform UNIVERSAL has a checksum "01bfe9d471b7cb1f8321204e6fa05a574db3ae5b67c5bd2f17184ffd521387f1" using algorithm SHA-256
123 changes: 0 additions & 123 deletions src/test/resources/features/release_version_update.feature

This file was deleted.

0 comments on commit db59a83

Please sign in to comment.