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

feat(build): fail if Gradle is started with Java 20 or older #12780

Merged
merged 4 commits into from
Apr 19, 2024

Conversation

anthony-swirldslabs
Copy link
Contributor

@anthony-swirldslabs anthony-swirldslabs commented Apr 12, 2024

Description:
Require Gradle to be started using Java 21+. Fail the build if the default JDK (in JAVA_HOME/PATH) points to an older version of Java.

Related issue(s):

Fixes #12779

Notes for reviewer:
For testing purposes, when JAVA_HOME points to Java 17, the build fails as:

$ g qualityGate

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/anthony/ws/27-buildJavaVersion/hedera-services/platform-sdk/platform-apps/tests/AddressBookTestingTool/build.gradle.kts' line: 17

* What went wrong:
An exception occurred applying plugin request [id: 'com.hedera.hashgraph.application']
> Failed to apply plugin 'com.hedera.hashgraph.java'.
   > ERROR: Gradle is started with Java 17. This project requires running Gradle with Java 21 or above. Please check your JAVA_HOME and/or PATH and configure the default JDK to use Java version 21 or above.

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Anthony Petrov <[email protected]>
Copy link

github-actions bot commented Apr 12, 2024

Node: HAPI Test (Restart) Results

2 tests   2 ✅  5m 55s ⏱️
2 suites  0 💤
2 files    0 ❌

Results for commit c7e950d.

♻️ This comment has been updated with latest results.

Copy link

Node: HAPI Test (Node Death Reconnect) Results

1 tests   1 ✅  23s ⏱️
1 suites  0 💤
2 files    0 ❌
1 errors

For more details on these parsing errors, see this check.

Results for commit c7e950d.

Copy link

Node: HAPI Test (Token) Results

212 tests   212 ✅  18m 49s ⏱️
 16 suites    0 💤
 16 files      0 ❌

Results for commit c7e950d.

Copy link

Node: HAPI Test (Crypto) Results

317 tests   317 ✅  36m 41s ⏱️
 25 suites    0 💤
 25 files      0 ❌

Results for commit c7e950d.

Copy link

Node: HAPI Test (Misc) Results

435 tests   425 ✅  36m 35s ⏱️
 75 suites   10 💤
 75 files      0 ❌

Results for commit c7e950d.

Copy link

Node: HAPI Test (Time Consuming) Results

21 tests   21 ✅  54m 10s ⏱️
 3 suites   0 💤
 3 files     0 ❌

Results for commit c7e950d.

Copy link

Node: HAPI Test (Smart Contract) Results

556 tests   556 ✅  1h 8m 2s ⏱️
 61 suites    0 💤
 61 files      0 ❌

Results for commit c7e950d.

Copy link

github-actions bot commented Apr 12, 2024

Node: Unit Test Results

  2 281 files  ±0    2 281 suites  ±0   3h 29m 30s ⏱️ + 1h 26m 10s
112 317 tests ±0  112 248 ✅ ±0  69 💤 ±0  0 ❌ ±0 
120 805 runs  ±0  120 736 ✅ ±0  69 💤 ±0  0 ❌ ±0 

Results for commit c7e950d. ± Comparison against base commit 2dde6dc.

This pull request removes 3996 and adds 3761 tests. Note that renamed tests count towards both.

  
             IssuerDN: CN=s-aaaa
            SubjectDN: CN=s-aaaa
           Final Date: Fri Jan 01 00:00:00 UTC 2100
           Public Key: RSA Public Key [2e:28:bc:1e:d3:83:25:92:8e:cb:98:b1:b6:84:06:9c:d5:d8:14:d5],[56:66:d1:a4]
           Start Date: Sat Jan 01 00:00:00 UTC 2000
         SerialNumber: 12482092706667292405
        modulus: c1a0ff5d2372b53d12d12bb87dd03f5…
   Address[id=0,nickname=Austin,selfName=aaaa,weight=1000,hostnameInternal=127.0.0.1,portInternalIpv4=15480,hostnameExternal=151.134.50.62,portExternalIpv4=5497,sigPublicKey=<null>,agreePublicKey=<null>,sigCert=com.swirlds.platform.crypto.SerializableX509Certificate@1e3e5741,agreeCert=com.swirlds.platform.crypto.SerializableX509Certificate@186b56b0,memo=bnJ2M9twqV],
…
com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [4] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [6] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [7]   
  
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [10] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@f668ccc3
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [11] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@e790d939
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [12] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@4c6e4e30
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [13] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@d3a4cb59
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [14] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@2787172a
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [15] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@33a3eea0
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [16] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@c52c34eb
…

♻️ This comment has been updated with latest results.

@jjohannes
Copy link
Collaborator

Created #12798 and autonomousapps/dependency-analysis-gradle-plugin#1167 for further work in this area.

For now, I think this is a good step forward. From my side, this can be merged.

@anthony-swirldslabs anthony-swirldslabs merged commit 03d1063 into develop Apr 19, 2024
41 of 43 checks passed
@anthony-swirldslabs anthony-swirldslabs deleted the issue-12779-1 branch April 19, 2024 16:28
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.

Verify Java version that Gradle is started with
3 participants