-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 devfile component preferences deserialization through GSON #14306
Conversation
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
Results of automated E2E tests of Eclipse Che Multiuser on OCP: |
/cc @tolusha |
In general looks ok to me. @mshaposhnik @metlos @sleshchenko wdyt? |
Ok if it fixes the problem |
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
@sleshchenko @mshaposhnik @skabashnyuk @metlos (there are numbers of issues in GSON repo for this, like this one google/gson#1084) I'm not sure whether it's critical in our case, but I thought it might be important to have our parsers to behave the same way, so I added a custom type adapter with the last commit to fix this problem in the simplest option. So the question is, do we need to bother with this at all, and if are there any better alternatives to it |
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
...re-api-dto/src/main/java/org/eclipse/che/dto/server/SerializableInterfaceAdapterFactory.java
Outdated
Show resolved
Hide resolved
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has failed:
|
E2E tests of Eclipse Che Multiuser on OCP has failed:
|
the latest master needs to be merged into this PR for the happy paths to succeed. |
E2E Happy path tests of Eclipse Che Single User on K8S (minikube v1.1.1) has been successful:
|
E2E tests of Eclipse Che Multiuser on OCP has been successful:
|
ci-build |
What does this PR do?
Add TypeAdapterFactory for GSON in DtoFactory, that would support Serializable type, that we have in Devfile Preferences
Special Note regarding parsing of numbers:
It is known problem that by default all numeric types are parsed as
double
in Gson library, resulting in conversion of integer numbers like1
into decimal point form1.0
and rounding dome double type values. [1], [2]. This is a not a problem for JSON itself, since it is doesn't have strict typing, and as a numeric, those two values are identical. But to preserve user input maximally, we're added code that tries to parse value as anLong
first, and than if wasn't succesfull, fallback to theDouble
form. This preserves the integer values, but may result that decimal zeroes may be trimmed, e.g.1.00
will be converted into1
, which is for sure much more rare form of defining integer numbers.[1] google/gson#1084
[2] https://stackoverflow.com/questions/24926786/make-gson-deserialize-numbers-to-integers-or-doubles
What issues does this PR fix or reference?
#14289
Release Notes
Docs PR