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

fix: check java version was criteria was ambiguous #5363

Merged
merged 7 commits into from
Jan 26, 2024

Conversation

peternhale
Copy link
Contributor

Modified the check to include java option XshowSettings:properties

What does this PR do?

What issues does this PR fix or reference?

@W-14888195@ #5358

Functionality Before

The validation of java version used a string match for build 17. and the customer's java version reported build 17+ causing a false positive when check version during startup

Functionality After

The validation function has been changed to run the java version command with an option that displays all of the assign System properties the JVM will be using. One of the is java.version = nn[.nn[.nn]]. This representation is more reliable that using the build string from the java version command.

@W-14888195@
Modified the check to include java option `XshowSettings:properties`
@peternhale peternhale requested a review from a team as a code owner January 25, 2024 16:13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the test from integration to jest.

Copy link
Contributor

@daphne-sfdc daphne-sfdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! 🎉

Check Java Version worked for the following Java versions:

  1. Salesforce-approved Java 11 use for Core development ✅
  2. Zulu Java 17 ✅
  3. Oracle Java 17 ✅

Copy link
Contributor

@daphne-sfdc daphne-sfdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved! 🎉

Test Cases (run using VSIXs generated from Commit Workflow):

  1. Leave the Java Home setting blank -> Java Home should take the value of the $JAVA_HOME environment variable set locally ✅ (this was working as expected for Pete but Daphne has a system issue)
  2. Invalid Java version (Java 21) -> should get wrong_java_version_text error message ✅
  3. Path to random empty folder -> should get wrong_java_version_text error message ✅
  4. Salesforce-approved Java 11 use for Core development ✅
  5. Zulu Java 17 ✅
  6. Oracle Java 17 ✅

@daphne-sfdc daphne-sfdc merged commit 577da2d into develop Jan 26, 2024
12 checks passed
@daphne-sfdc daphne-sfdc deleted the phale/W-14888195-fix-java-check branch January 26, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants