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
JCLOUDS-1333: JCLOUDS-1334: JCLOUDS-1470: Require Java 8 and Guava 22 #75
Conversation
This will likely fail in CI due to configuration but locally tests fail due a gson issue. I don't understand our tower of hacks. @nacx Any suggestions on how to address this?
|
This is strange, |
Also need to use an older JDK to work around weak 1024-bit SSL certificates. I found that |
if (!command.getCurrentRequest().getMethod().equals("DELETE")) { | ||
exception = new ResourceNotFoundException(message, exception); | ||
} | ||
exception = new ResourceNotFoundException(message, exception); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nacx Any comment on this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a common pattern in jclouds APIs: if you attempt to delete a resource that does not exist, do not fail the operation because you're already in the desired state.
Why does this need to be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see that it is because of a test. I'd say the test is wrong, not this, so I'd just change the test and keep the current behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
<maven.compile.deprecation>true</maven.compile.deprecation> | ||
<maven.site.url.base>gitsite:git@github.com/jclouds/jclouds-maven-site.git</maven.site.url.base> | ||
<guava.version>18.0</guava.version> | ||
<guava.version>22.0</guava.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could support 21.0 with some workarounds for SimpleTimeLimiter
although this doesn't seem worth the effort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
ed06a3b
to
3405e43
Compare
There were some gson hacks we did to be able to make it OSGi friendly, as there are uses of an Basically, we shaded those packages and renamed them so we can safely use them in our codebase. Now we're in a different place, and I think we should revisit our OSGi support. We moved jclouds-Karaf to the Karaf project because we lack the expertise in OSGi and maintaining it was adding too much burden on us. Does the same apply here? Should we just undo this hack, go with standard gson and upgrade normally, and remove the OSGi compatibility from our list of responsibilities? This shading hack is something that can be done by users, or even by the Karaf project, probably in a better way, so I'd be in favour of undoing this at the expense of losing compatibility. The cost of maintaining this is too high for the current community. |
Is this because of the certificates we use in tests? Or something spotted running live tests, or because how we configure the SSL module by default? It would be great if we could upgrade and not be tied to older JDKs. |
Hello, we use your JClouds in our OSGi project. Actually OSGi and all the regulations around packet exports is a difficult topic. Especially when an OSGi compatibility is set by a library and others still access restricted areas of the library. I can't understand why the makers of JSON restrict these sections, instead every package of the library should be exported, after all there is not much to hide
I'm not sure if GSON really intends to keep these packages away from the outside world, or if this is just a misconfiguration. You can try submitting a merge request to GSON by exporting all packages, adding four lines to the "exportcontents" section of the bnd.bnd configuration file Due to other experiences with JSON I can't promise if a change of this kind will be accepted by the developers. After all, very few Java developers know about OSGi and the rules of the construct, developers working at Google are no exception. The proposal to let the user override the GSON module is basically good. The way of proceeding is left to him, but it should be comprehensible, the requirement to do so should be documented in JClouds in any case. My approach at this point is to create a new git project, integrate a git submodule into GSON, and use a script (changing the BND file before build) or a Maven plugin to influence the build process of GSON. An example of where we do this is https://github.com/project-millipede/neo4j-ogm-osgi. Since GSON releases are not released too often, updating the submodule is not a hassle. I am interested in the process, whatever this will look like, I am curious. |
We tried, but unfortunately, it was rejected: google/gson#916 The main issue here is that we can no longer afford to keep the OSGi compatibility because of the lack of expertise in the active contributor group to the project. That's why we offloaded the Karaf support to the Karaf project, and this is a remaining piece that is preventing us from modernizing the codebase. Help there is really welcome. Ideally, we should try to refactor the jclouds core to stop relying on that, or even copy the files to the jclouds codebase and keep them there, but I think we can't afford the overhead of keeping OSGi into account when the expertise is not here. |
#71 should resolve the certificate length but we need to upgrade BouncyCastle first. I don't remember exactly but that was blocked on another dependency. Working through these... |
@gurkerl83 thanks for chiming in. We lack OSGi expertise and would appreciate if you could submit any improvements. I am trying to modernize the dependencies and fear that this will break things I cannot test like OSGi. |
This allows compatibility with Guava 29. Also unwind some older workarounds.
Hi, I have create a follow up JIRA ticket to summarise the GSON problematic https://issues.apache.org/jira/browse/JCLOUDS-1548. Further I wanted to know when the current merge request will be merged. I have also reviewed the changes, which in my opinion are legit, also all tests pass. |
@nacx Any further comments? |
Nope, LGTM. Thanks! |
Probably a few months. We are still working on the OkHttp and gson dependencies. |
This allows compatibility with Guava 29. Also unwind some older
workarounds.