From 9582b27d05c7e5b4ca1f621b34812847a6019a7a Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 2 Oct 2024 15:08:41 +0530 Subject: [PATCH 1/5] Migrate to Java 21 --- .github/workflows/build-timestamped-master.yml | 4 ++-- .github/workflows/central-publish.yml | 4 ++-- .github/workflows/daily-build.yml | 12 ++++++------ .github/workflows/publish-release.yml | 4 ++-- .github/workflows/pull-request.yml | 12 ++++++------ .github/workflows/trivy-scan.yml | 4 ++-- README.md | 2 +- ballerina/Ballerina.toml | 12 ++++++------ build-config/resources/Ballerina.toml | 12 ++++++------ gradle.properties | 4 ++-- native/build.gradle | 7 +++++-- 11 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index abc06ed..1389a38 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 17.0.7 + java-version: 21 - name: Change to Timestamped Version run: | startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00') diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 1310269..2d10d26 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -18,11 +18,11 @@ jobs: if: github.repository_owner == 'ballerina-platform' steps: - uses: actions/checkout@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index da964a2..1d4d6ea 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -12,11 +12,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} @@ -34,11 +34,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} @@ -54,11 +54,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 0d1cc2d..b5bd129 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -11,11 +11,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index d67c2b7..37d7549 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,11 +9,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} @@ -31,11 +31,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} @@ -51,11 +51,11 @@ jobs: steps: - name: Checkout Repository uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index f20c296..f56dee1 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -11,11 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v2 with: distribution: 'adopt' - java-version: 17.0.7 + java-version: 21 - name: Build with Gradle env: packageUser: ${{ github.actor }} diff --git a/README.md b/README.md index 18dbd3e..0af070b 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ By default, observability is not included in the executable created by Ballerina ### Set Up the prerequisites -1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations). +1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations). * [Oracle](https://www.oracle.com/java/technologies/downloads/) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index e87e6f2..3dd516e 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -5,30 +5,30 @@ version = "1.3.0" distribution = "2201.10.0" export = ["observe", "observe.mockextension" ] -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "../native/build/libs/observe-native-1.3.0.jar" groupId = "ballerina" artifactId = "observe" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-trace" version = "1.0.0" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-testing" version = "1.0.0" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-common" version = "1.0.0" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-semconv" version = "1.0.0-alpha" diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index ae34269..b64e46e 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -5,30 +5,30 @@ version = "@toml.version@" distribution = "2201.10.0" export = ["observe", "observe.mockextension" ] -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "../native/build/libs/observe-native-@project.version@.jar" groupId = "ballerina" artifactId = "observe" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-trace" version = "@opentelemetry.version@" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-testing" version = "@opentelemetry.version@" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-sdk-common" version = "@opentelemetry.version@" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.opentelemetry" artifactId = "opentelemetry-semconv" version = "@opentelemetry.version@-alpha" diff --git a/gradle.properties b/gradle.properties index 7d94bff..b3602a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,8 +15,8 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.3.1-SNAPSHOT -ballerinaLangVersion=2201.10.0 -githubSpotbugsVersion=5.0.14 +ballerinaLangVersion=2201.10.0-20241007-143200-6b69ca80 +githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0 researchgateReleaseVersion=2.8.0 diff --git a/native/build.gradle b/native/build.gradle index bc8f716..fc1a0e9 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -52,8 +52,11 @@ tasks.withType(Checkstyle) { checkstyleMain.dependsOn(":checkstyle:downloadCheckstyleRuleFiles") spotbugsMain { - effort "max" - reportLevel "low" + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort") + effort = SpotBugsEffort.MAX + reportLevel = SpotBugsConfidence.LOW reportsDir = file("$project.buildDir/reports/spotbugs") reports { html.enabled true From 81ec5813eff396550ea241d5d36196a4b1c5fb66 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Wed, 13 Nov 2024 09:12:02 +0530 Subject: [PATCH 2/5] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a432a49..f0b3778 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" From 00bd9fc2852117ea5aebe1240090320c78601c53 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Wed, 13 Nov 2024 09:13:22 +0530 Subject: [PATCH 3/5] Migrate runtime APIs for java 21 --- gradle.properties | 2 +- .../io/ballerina/stdlib/observe/nativeimpl/GetAllMetrics.java | 2 +- .../io/ballerina/stdlib/observe/nativeimpl/GetSpanContext.java | 2 +- .../io/ballerina/stdlib/observe/nativeimpl/LookupMetric.java | 2 +- .../main/java/io/ballerina/stdlib/observe/nativeimpl/Utils.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2a905a5..65acb13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.4.0-SNAPSHOT -ballerinaLangVersion=2201.10.0-20241007-143200-6b69ca80 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0 diff --git a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetAllMetrics.java b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetAllMetrics.java index 5cb09b0..0e775f6 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetAllMetrics.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetAllMetrics.java @@ -19,9 +19,9 @@ package io.ballerina.stdlib.observe.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetSpanContext.java b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetSpanContext.java index 60410e2..86e9fd5 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetSpanContext.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/GetSpanContext.java @@ -19,9 +19,9 @@ package io.ballerina.stdlib.observe.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.values.BMap; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.observability.ObserveUtils; diff --git a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/LookupMetric.java b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/LookupMetric.java index 868fe84..b83d3f8 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/LookupMetric.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/LookupMetric.java @@ -19,9 +19,9 @@ package io.ballerina.stdlib.observe.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BArray; import io.ballerina.runtime.api.values.BMap; diff --git a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/Utils.java b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/Utils.java index 4d08776..7f7f54c 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/Utils.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/Utils.java @@ -21,9 +21,9 @@ import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.creators.TypeCreator; import io.ballerina.runtime.api.creators.ValueCreator; +import io.ballerina.runtime.api.types.PredefinedTypes; import io.ballerina.runtime.api.types.Type; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BArray; From e6a937b531056b67bfd008caa74f99dab5a0c412 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Wed, 13 Nov 2024 09:13:40 +0530 Subject: [PATCH 4/5] Revert "[Automated] Update the native jar versions" This reverts commit 81ec5813eff396550ea241d5d36196a4b1c5fb66. --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index f0b3778..a432a49 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.11.0-20241112-214900-6b80ab87" +distribution-version = "2201.10.0" [[package]] org = "ballerina" From c8a7f3c2cb8486bdcb44b469ce38e92e795c0527 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 18 Nov 2024 14:52:38 +0530 Subject: [PATCH 5/5] Use main branch for github actions --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 65acb13..ed144a2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.4.0-SNAPSHOT -ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 +ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77 githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0