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

State api integration #71

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a4335df
Update scalafmt config
marc0der Jan 5, 2025
716e003
Introduce StateApi class
marc0der Jan 5, 2025
e7b0c17
Wire StateApi into VersionsController
marc0der Jan 5, 2025
512de79
Introduce http caching for remote calls
marc0der Jan 7, 2025
bb01864
Make state api configurable
marc0der Jan 7, 2025
b0b67a6
Refine naming
marc0der Jan 8, 2025
0621696
First steps moving off Mongo Versions collection.
marc0der Jan 21, 2025
cdafeda
Introduce StateApi trait and rename method
marc0der Feb 8, 2025
ddfd0c9
More renaming.
marc0der Feb 8, 2025
054cbca
Code tweak
marc0der Feb 8, 2025
8b3dfa9
Update state api url structure
marc0der Feb 24, 2025
4353464
Code formatting
marc0der Feb 24, 2025
a24e9be
Move Json Reads into trait
marc0der Feb 24, 2025
d71b788
Move state api request building to collaborator
marc0der Feb 24, 2025
3979b7b
Move RequestBuilder into clients package
marc0der Feb 24, 2025
ed88058
Add TODOs to all version repository callsites
marc0der Feb 24, 2025
5ab2e53
Introduce hidden parameter to request builder method
marc0der Feb 24, 2025
f48d47e
Only consider visible versions in this service
marc0der Feb 24, 2025
575f430
Cut over JavaListController to use StateApi
marc0der Feb 24, 2025
435d58a
Delete obsolete stub
marc0der Feb 25, 2025
ddf9d01
Cut over version list to use the state API.
marc0der Feb 26, 2025
e06c45d
Version list doesn't blow up but returns 404 if candidate is not found.
marc0der Feb 26, 2025
b0b0599
Cut version validation over to state API
marc0der Feb 26, 2025
707899a
Clean up code
marc0der Feb 26, 2025
76090ad
Remove VersionRepo
marc0der Feb 27, 2025
c2ae2ec
Fix internal naming of Platform
marc0der Feb 27, 2025
ac5624b
Cut over from repo Version to StateApiVersion
marc0der Feb 27, 2025
cad7341
Move Platform into domain package
marc0der Feb 27, 2025
a244b16
Run scalafmt
marc0der Feb 27, 2025
cba72fc
Rename StateApiVersion to Version and remove repo Version remnants
marc0der Feb 27, 2025
4b21dee
Move Version to the domain package
marc0der Feb 27, 2025
142d692
Make visible field in Version optional and fix tests
marc0der Feb 27, 2025
24b2132
Scalafmt
marc0der Feb 27, 2025
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
Prev Previous commit
Next Next commit
Run scalafmt
marc0der committed Feb 27, 2025
commit a244b169bc028392b1bc39af3c8e759224efc635
4 changes: 2 additions & 2 deletions app/controllers/ValidationController.scala
Original file line number Diff line number Diff line change
@@ -18,8 +18,8 @@ class ValidationController @Inject() (
def validate(candidate: String, versionVendor: String, platformId: String): Action[AnyContent] =
Action.async(parse.anyContent) { _ =>
val versionParts = versionVendor.split("-")
val version = versionParts(0)
val maybeVendor = versionParts.lift(1)
val version = versionParts(0)
val maybeVendor = versionParts.lift(1)
val maybeUniversalF =
stateApi.findVersionByCandidateAndPlatform(
candidate,
6 changes: 3 additions & 3 deletions app/domain/Platform.scala
Original file line number Diff line number Diff line change
@@ -36,9 +36,9 @@ object Platform {
val FreeBSD = Platform("FREE_BSD", "FreeBSD")
val SunOS = Platform("SUN_OS", "Solaris")

val Universal = Platform("UNIVERSAL", "Universal")
val Universal = Platform("UNIVERSAL", "Universal")

//fallback to UNIVERSAL for exotic (unsupported) platforms
//allows exotic platforms to install only UNIVERSAL candidates
// fallback to UNIVERSAL for exotic (unsupported) platforms
// allows exotic platforms to install only UNIVERSAL candidates
val Exotic = Platform("UNIVERSAL", "Exotic")
}