EasyPost / easypost-java

EasyPost Shipping API Client Library for Java
https://easypost.com/docs/api
MIT License
54 stars 37 forks source link

add error prone and fix some potential bugs #220

Closed jchen293 closed 1 year ago

jchen293 commented 1 year ago

Description

Add Error Prone to the library and fix the below errors. Modified the CI build to use JDK 19 to build against java 8 - 19, in order to compatible with Error Prone

Screen Shot 2022-12-20 at 4 25 02 PM Screen Shot 2022-12-20 at 4 35 49 PM

Testing

Unit tests pass

Pull Request Type

Please select the option(s) that are relevant to this PR.

jchen293 commented 1 year ago

Closing this PR due to incompatibility with Java 8 for --add-exports which is required for the Error Prone installation setup for Maven. I will reopen this PR when we drop support for Java 8 in the future.

Justintime50 commented 1 year ago

Let's take another look at this after the holidays. Often there is something to be done.

nwithan8 commented 1 year ago

"Build" (compile the code and verify it works on a specific Java version) and "Coverage" (verify all our functions are tested) have been split into two separate CI actions.

"Build" will compile the source code using JDK 19 (the latest JDK), targeting Java 8 (making a JAR that is compatible in Java 8+), and then change the JDK and attempt to run the unit tests with each JDK, to confirm compatibility for that version.

As we can see here, the source code is being compiled using JDK 19 (see the version of JAVA_HOME):

image

And then the compiled code is run with JDK 12 and successfully passed.

image

"Coverage" will compile the source code using JDK 19 (the latest JDK) (still making s Java 8+-compatible JAR) and then immediately run the unit tests with the same JDK, analyzing code coverage and generating a coverage report. This step does not involve a matrix, as it does not need to be run on multiple JDK versions (the different Java versions will not impact coverage results).

nwithan8 commented 1 year ago

Vulnerabilities being suppressed are due to an outdated dependency that ErrorProne uses. ErrorProne is a plugin we use during compilation; it is not a dependency of our source code. The vulnerability does not extend to our compiled JAR.