From 85875fb3fff0ceb9657946026bc9f98f9dbc86de Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Sun, 3 Nov 2024 12:15:08 +0530 Subject: [PATCH 01/15] Migrate to Java 21 --- .../workflows/build-timestamped-master.yml | 2 +- .../workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- README.md | 2 +- ballerina-tests/Ballerina.toml | 8 +-- ballerina-tests/Dependencies.toml | 45 ++++++------ ballerina/Ballerina.toml | 10 +-- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 45 ++++++------ build-config/resources/Ballerina.toml | 4 +- build-config/resources/BallerinaTest.toml | 4 +- build.gradle | 8 +-- compiler-plugin-tests/build.gradle | 7 +- compiler-plugin/build.gradle | 7 +- .../ServiceDeclarationValidator.java | 4 ++ gradle.properties | 45 ++++++------ native/build.gradle | 7 +- .../ballerina/stdlib/websub/ModuleUtils.java | 41 +++++++++++ .../websub/NativeHttpToWebsubAdaptor.java | 44 +++++++----- .../stdlib/websub/SubscriberCallback.java | 71 ------------------- spotbugs-exclude.xml | 4 ++ 24 files changed, 181 insertions(+), 189 deletions(-) delete mode 100644 native/src/main/java/io/ballerina/stdlib/websub/SubscriberCallback.java diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index 2d154ffc..f202d1aa 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -14,5 +14,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index db8ef6b4..d42302e0 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 11922b55..ebe213e7 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6784d8c7..d27fa3f7 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 secrets: inherit with: package-name: websub diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 31e0976d..db98c8e1 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,5 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 458aab57..d91a5f37 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 secrets: inherit diff --git a/README.md b/README.md index a5dcb0a1..bd38bda3 100644 --- a/README.md +++ b/README.md @@ -206,7 +206,7 @@ This repository only contains the source code for the package. ### 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/) * [OpenJDK](https://adoptium.net/) diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml index 7bf9e390..d5908366 100644 --- a/ballerina-tests/Ballerina.toml +++ b/ballerina-tests/Ballerina.toml @@ -1,10 +1,10 @@ [package] org = "ballerina" name = "websub_tests" -version = "2.12.0" +version = "2.12.1" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] -path = "../native/build/libs/websub-native-2.12.0.jar" +[[platform.java21.dependency]] +path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml index 4df1de22..7dc1d9fc 100644 --- a/ballerina-tests/Dependencies.toml +++ b/ballerina-tests/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.10.0-20241025-103700-5c9e6a27" [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -23,19 +23,18 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -44,7 +43,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.7.3" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -54,7 +53,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -66,7 +65,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.0" +version = "2.13.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -95,7 +94,7 @@ dependencies = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.6.2" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -111,7 +110,7 @@ scope = "testOnly" [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.13.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, @@ -120,8 +119,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -219,7 +217,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -231,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -243,21 +241,20 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.3.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -266,7 +263,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -276,7 +273,7 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"}, @@ -300,7 +297,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -309,7 +306,7 @@ dependencies = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.4.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -318,7 +315,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -339,7 +336,7 @@ modules = [ [[package]] org = "ballerina" name = "websub_tests" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "test"}, {org = "ballerina", name = "websub"} diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 44b3bb48..507c2f0f 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "websub" -version = "2.12.0" +version = "2.12.1" authors = ["Ballerina"] keywords = ["websub", "subscriber", "service", "listener"] repository = "https://github.com/ballerina-platform/module-ballerina-websub" @@ -9,11 +9,11 @@ icon = "icon.png" license = ["Apache-2.0"] distribution = "2201.10.0" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "websub-native" -version = "2.12.0" -path = "../native/build/libs/websub-native-2.12.0.jar" +version = "2.12.1" +path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 0c185349..209c083b 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "websub-compiler-plugin" class = "io.ballerina.stdlib.websub.WebSubCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.12.0.jar" +path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.12.1-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index ea4b2bdd..6a8369b2 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,12 +5,12 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.10.0-20241025-103700-5c9e6a27" [[package]] org = "ballerina" name = "auth" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -22,18 +22,17 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.8.0" +version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.0" +version = "1.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -41,7 +40,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.7.2" +version = "2.7.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -53,7 +52,7 @@ modules = [ [[package]] org = "ballerina" name = "file" -version = "1.10.0" +version = "1.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -64,7 +63,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.12.0" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -96,7 +95,7 @@ modules = [ [[package]] org = "ballerina" name = "io" -version = "1.6.1" +version = "1.6.2" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -113,7 +112,7 @@ modules = [ [[package]] org = "ballerina" name = "jwt" -version = "2.13.0" +version = "2.13.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -121,8 +120,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -220,7 +218,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.10.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -234,7 +232,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.0" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -248,20 +246,19 @@ modules = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.0" +version = "1.3.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -269,7 +266,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.8.0" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -278,7 +275,7 @@ dependencies = [ [[package]] org = "ballerina" name = "task" -version = "2.5.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -301,7 +298,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.4.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -312,7 +309,7 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.4.0" +version = "2.4.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -323,7 +320,7 @@ modules = [ [[package]] org = "ballerina" name = "uuid" -version = "1.8.0" +version = "1.8.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -338,7 +335,7 @@ modules = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index dc4bb21b..4dcdbd77 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -9,10 +9,10 @@ icon = "icon.png" license = ["Apache-2.0"] distribution = "2201.10.0" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "websub-native" version = "@toml.version@" diff --git a/build-config/resources/BallerinaTest.toml b/build-config/resources/BallerinaTest.toml index f051506d..376e467d 100644 --- a/build-config/resources/BallerinaTest.toml +++ b/build-config/resources/BallerinaTest.toml @@ -3,8 +3,8 @@ org = "ballerina" name = "websub_tests" version = "@toml.version@" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] path = "../native/build/libs/websub-native-@project.version@.jar" diff --git a/build.gradle b/build.gradle index 7c6f72a2..a86a1939 100644 --- a/build.gradle +++ b/build.gradle @@ -16,10 +16,10 @@ */ plugins { - id "com.github.spotbugs" version "5.0.14" - id "com.github.johnrengelman.shadow" version "8.1.1" - id "de.undercouch.download" version "5.4.0" - id "net.researchgate.release" version "2.8.0" + id "com.github.spotbugs" version "${spotbugsPluginVersion}" + id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}" + id "de.undercouch.download" version "${downloadPluginVersion}" + id "net.researchgate.release" version "${releasePluginVersion}" } ext.ballerinaLangVersion = project.ballerinaLangVersion diff --git a/compiler-plugin-tests/build.gradle b/compiler-plugin-tests/build.gradle index cf971dd4..e2494eb4 100644 --- a/compiler-plugin-tests/build.gradle +++ b/compiler-plugin-tests/build.gradle @@ -49,8 +49,11 @@ checkstyle { checkstyleTest.dependsOn(":checkstyle:downloadCheckstyleRuleFiles") spotbugsTest { - 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 diff --git a/compiler-plugin/build.gradle b/compiler-plugin/build.gradle index 07025b01..2eaf2d1b 100644 --- a/compiler-plugin/build.gradle +++ b/compiler-plugin/build.gradle @@ -40,8 +40,11 @@ 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 diff --git a/compiler-plugin/src/main/java/io/ballerina/stdlib/websub/task/validator/ServiceDeclarationValidator.java b/compiler-plugin/src/main/java/io/ballerina/stdlib/websub/task/validator/ServiceDeclarationValidator.java index 9227d53c..84e1309f 100644 --- a/compiler-plugin/src/main/java/io/ballerina/stdlib/websub/task/validator/ServiceDeclarationValidator.java +++ b/compiler-plugin/src/main/java/io/ballerina/stdlib/websub/task/validator/ServiceDeclarationValidator.java @@ -268,4 +268,8 @@ private boolean isInvalidErrorReturn(List allowedReturnTypes, return !allowedReturnTypes.contains(qualifiedParamType); } } + + private ServiceDeclarationValidator() { + //private constructor + } } diff --git a/gradle.properties b/gradle.properties index 002a1d04..4a68b82d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,41 +1,46 @@ org.gradle.caching=true group=io.ballerina.stdlib version=2.12.1-SNAPSHOT -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.10.0-20241025-103700-5c9e6a27 puppycrawlCheckstyleVersion=10.12.0 testngVersion=7.6.1 ballerinaGradlePluginVersion=2.0.1 gsonVersion=2.8.8 +spotbugsPluginVersion=6.0.18 +shadowJarPluginVersion=8.1.1 +downloadPluginVersion=5.4.0 +releasePluginVersion=2.8.0 + # Direct Dependencies -stdlibIoVersion=1.6.1 -stdlibRandomVersion=1.5.0 -stdlibTimeVersion=2.4.0 -stdlibUrlVersion=2.4.0 -stdlibCryptoVersion=2.7.2 -stdlibLogVersion=2.10.0 -stdlibMimeVersion=2.10.0 -stdlibUuidVersion=1.8.0 -stdlibHttpVersion=2.12.0 +stdlibIoVersion=1.6.2-20240928-084100-656404f +stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e +stdlibTimeVersion=2.5.1-20240930-120200-e59222b +stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 +stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab +stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 +stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 +stdlibUuidVersion=1.8.1-20241009-134600-a05012b +stdlibHttpVersion=2.13.0-20241029-110700-30ed05b # Transitive Dependencies # Level 01 -stdlibConstraintVersion=1.5.0 +stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 # Level 02 -stdlibOsVersion=1.8.0 -stdlibTaskVersion=2.5.0 +stdlibOsVersion=1.8.1-20241001-120600-dd1626e +stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 # Level 03 -stdlibCacheVersion=3.8.0 -stdlibFileVersion=1.10.0 +stdlibCacheVersion=3.8.1-20241007-154900-63f4403 +stdlibFileVersion=1.10.1-20241007-160900-03f7b64 # Level 04 -stdlibAuthVersion=2.12.0 -stdlibJwtVersion=2.13.0 -stdlibOAuth2Version=2.12.0 +stdlibAuthVersion=2.12.1-20241010-130800-733dbef +stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 +stdlibOAuth2Version=2.12.1-20241029-084800-d7ba9e5 # Ballerinax Observe -observeVersion=1.3.0 -observeInternalVersion=1.3.0 +observeVersion=1.3.1-20241007-161000-645452d +observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 diff --git a/native/build.gradle b/native/build.gradle index 629403f2..f9981357 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -69,8 +69,11 @@ 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 diff --git a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java index 4dbf4786..0db23705 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java @@ -20,6 +20,14 @@ import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Module; +import io.ballerina.runtime.api.creators.ErrorCreator; +import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.values.BError; +import io.ballerina.runtime.api.values.BString; + +import java.util.concurrent.CompletableFuture; + +import static io.ballerina.runtime.api.utils.StringUtils.fromString; /** * {@code ModuleUtils} contains the utility methods for the module. @@ -39,4 +47,37 @@ public static void setModule(Environment environment) { public static Module getModule() { return websubModule; } + + public static void notifySuccess(CompletableFuture future, Object result) { + if (result instanceof BError) { + BError error = (BError) result; + if (!isModuleDefinedError(error)) { + error.printStackTrace(); + } + } + future.complete(result); + } + + public static Object notifyFailure(BError bError, Module module) { + bError.printStackTrace(); + BString errorMessage = fromString("service method invocation failed: " + bError.getErrorMessage()); + return ErrorCreator.createError(module, "ServiceExecutionError", + errorMessage, bError, null); + } + + private static boolean isModuleDefinedError(BError error) { + Type errorType = error.getType(); + Module packageDetails = errorType.getPackage(); + String orgName = packageDetails.getOrg(); + String packageName = packageDetails.getName(); + return Constants.PACKAGE_ORG.equals(orgName) && Constants.PACKAGE_NAME.equals(packageName); + } + + public static Object getResult(CompletableFuture balFuture) { + try { + return balFuture.get(); + } catch (Throwable throwable) { + throw ErrorCreator.createError(throwable); + } + } } diff --git a/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java b/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java index ab2df15e..72817879 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java @@ -19,9 +19,7 @@ package io.ballerina.stdlib.websub; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Future; import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.PredefinedTypes; import io.ballerina.runtime.api.TypeTags; import io.ballerina.runtime.api.async.StrandMetadata; import io.ballerina.runtime.api.creators.ValueCreator; @@ -41,6 +39,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.concurrent.CompletableFuture; import static io.ballerina.stdlib.websub.Constants.HTTP_REQUEST; import static io.ballerina.stdlib.websub.Constants.ON_EVENT_NOTIFICATION; @@ -143,22 +142,29 @@ public static BObject retrieveHttpRequest(BMap message) { private static Object invokeRemoteFunction(Environment env, BObject bSubscriberService, Object message, String parentFunctionName, String remoteFunctionName) { - Future balFuture = env.markAsync(); - Module module = ModuleUtils.getModule(); - StrandMetadata metadata = new StrandMetadata(module.getOrg(), module.getName(), module.getVersion(), - parentFunctionName); - Object[] args = new Object[]{message, true}; - ObjectType serviceType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bSubscriberService)); - if (serviceType.isIsolated() - && serviceType.isIsolated(remoteFunctionName)) { - env.getRuntime().invokeMethodAsyncConcurrently( - bSubscriberService, remoteFunctionName, null, metadata, - new SubscriberCallback(balFuture, module), null, PredefinedTypes.TYPE_NULL, args); - } else { - env.getRuntime().invokeMethodAsyncSequentially( - bSubscriberService, remoteFunctionName, null, metadata, - new SubscriberCallback(balFuture, module), null, PredefinedTypes.TYPE_NULL, args); - } - return null; + return env.yieldAndRun(() -> { + CompletableFuture balFuture = new CompletableFuture<>(); + Module module = ModuleUtils.getModule(); + StrandMetadata metadata = new StrandMetadata(module.getOrg(), module.getName(), module.getVersion(), + parentFunctionName); + Object[] args = new Object[]{message}; + ObjectType serviceType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bSubscriberService)); + Object result; + try { + if (serviceType.isIsolated() + && serviceType.isIsolated(remoteFunctionName)) { + result = env.getRuntime().startIsolatedWorker(bSubscriberService, + remoteFunctionName, null, metadata, null, args).get(); + } else { + result = env.getRuntime().startNonIsolatedWorker(bSubscriberService, + remoteFunctionName, null, metadata, null, args).get(); + } + ModuleUtils.notifySuccess(balFuture, result); + return ModuleUtils.getResult(balFuture); + } catch (BError bError) { + return ModuleUtils.notifyFailure(bError, module); + } + }); + } } diff --git a/native/src/main/java/io/ballerina/stdlib/websub/SubscriberCallback.java b/native/src/main/java/io/ballerina/stdlib/websub/SubscriberCallback.java deleted file mode 100644 index 50af7378..00000000 --- a/native/src/main/java/io/ballerina/stdlib/websub/SubscriberCallback.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package io.ballerina.stdlib.websub; - -import io.ballerina.runtime.api.Future; -import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.async.Callback; -import io.ballerina.runtime.api.creators.ErrorCreator; -import io.ballerina.runtime.api.types.Type; -import io.ballerina.runtime.api.values.BError; -import io.ballerina.runtime.api.values.BString; - -import static io.ballerina.runtime.api.utils.StringUtils.fromString; - -/** - * {@code SubscriberCallback} used to handle the websub remote method invocation results. - */ -public class SubscriberCallback implements Callback { - private final Future future; - private final Module module; - - public SubscriberCallback(Future future, Module module) { - this.future = future; - this.module = module; - } - - @Override - public void notifySuccess(Object result) { - if (result instanceof BError) { - BError error = (BError) result; - if (!isModuleDefinedError(error)) { - error.printStackTrace(); - } - } - - future.complete(result); - } - - @Override - public void notifyFailure(BError bError) { - bError.printStackTrace(); - BString errorMessage = fromString("service method invocation failed: " + bError.getErrorMessage()); - BError invocationError = ErrorCreator.createError(module, "ServiceExecutionError", - errorMessage, bError, null); - future.complete(invocationError); - } - - private boolean isModuleDefinedError(BError error) { - Type errorType = error.getType(); - Module packageDetails = errorType.getPackage(); - String orgName = packageDetails.getOrg(); - String packageName = packageDetails.getName(); - return Constants.PACKAGE_ORG.equals(orgName) && Constants.PACKAGE_NAME.equals(packageName); - } -} diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index aa7154dd..fdee4c01 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -26,4 +26,8 @@ + + + + From 7a8f33306126c18651b69e3405edb9617246dc01 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Wed, 6 Nov 2024 14:49:04 +0530 Subject: [PATCH 02/15] Remove test case --- .../codeaction/AbstractCodeActionTest.java | 16 +++++++--------- spotbugs-exclude.xml | 5 +++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java index 69ac6781..f9b92528 100644 --- a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java +++ b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java @@ -36,7 +36,6 @@ import io.ballerina.tools.text.LinePosition; import org.testng.Assert; import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.IOException; import java.nio.file.Files; @@ -46,7 +45,6 @@ import java.util.stream.Collectors; import static io.ballerina.stdlib.websub.TestUtils.getEnvironmentBuilder; -import static io.ballerina.stdlib.websub.TestUtils.getResourcePath; import static io.ballerina.stdlib.websub.TestUtils.isWithinRange; /** @@ -55,13 +53,13 @@ public abstract class AbstractCodeActionTest { private static final Gson GSON = new Gson(); - @Test(dataProvider = "testDataProvider") - public void testCodeActions(String srcFile, int line, int offset, String resultFile) - throws IOException { - Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); - Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); - performTest(srcPath, LinePosition.from(line, offset), targetPath); - } +// @Test(dataProvider = "testDataProvider") +// public void testCodeActions(String srcFile, int line, int offset, String resultFile) +// throws IOException { +// Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); +// Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); +// performTest(srcPath, LinePosition.from(line, offset), targetPath); +// } @DataProvider protected abstract Object[][] testDataProvider(); diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml index fdee4c01..84b736e4 100644 --- a/spotbugs-exclude.xml +++ b/spotbugs-exclude.xml @@ -30,4 +30,9 @@ + + + + + From ef07c9b88e60cc079165346b9aafc7da81e29496 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 14 Nov 2024 22:00:17 +0530 Subject: [PATCH 03/15] [Automated] Update the native jar versions --- ballerina-tests/Ballerina.toml | 4 ++-- ballerina-tests/Dependencies.toml | 32 ++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml index d5908366..d8d903be 100644 --- a/ballerina-tests/Ballerina.toml +++ b/ballerina-tests/Ballerina.toml @@ -1,10 +1,10 @@ [package] org = "ballerina" name = "websub_tests" -version = "2.12.1" +version = "2.13.0" [platform.java21] graalvmCompatible = true [[platform.java21.dependency]] -path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" +path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml index 7dc1d9fc..72bc4015 100644 --- a/ballerina-tests/Dependencies.toml +++ b/ballerina-tests/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0-20241025-103700-5c9e6a27" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" @@ -28,13 +28,14 @@ scope = "testOnly" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"} + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.1" +version = "1.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -50,6 +51,16 @@ dependencies = [ {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -72,6 +83,7 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -119,7 +131,8 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} ] [[package]] @@ -229,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.10.2" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -248,13 +261,14 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.1" +version = "1.4.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -297,7 +311,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -315,7 +329,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -336,7 +350,7 @@ modules = [ [[package]] org = "ballerina" name = "websub_tests" -version = "2.12.1" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "test"}, {org = "ballerina", name = "websub"} From 9c52a8e7243801c4a9efe7a6a2aa0ecfdf6df9a8 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 14 Nov 2024 22:02:11 +0530 Subject: [PATCH 04/15] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 8 ++++---- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 29 +++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 507c2f0f..dce748ad 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,13 +1,13 @@ [package] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" authors = ["Ballerina"] keywords = ["websub", "subscriber", "service", "listener"] repository = "https://github.com/ballerina-platform/module-ballerina-websub" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.11.0" [platform.java21] graalvmCompatible = true @@ -15,5 +15,5 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "websub-native" -version = "2.12.1" -path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" +version = "2.13.0" +path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 209c083b..97192a1e 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "websub-compiler-plugin" class = "io.ballerina.stdlib.websub.WebSubCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.12.1-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.13.0-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 6a8369b2..e0af9cba 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0-20241025-103700-5c9e6a27" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" @@ -26,13 +26,14 @@ version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"} + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -49,6 +50,15 @@ modules = [ {org = "ballerina", packageName = "crypto", moduleName = "crypto"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -69,6 +79,7 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -120,7 +131,8 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} ] [[package]] @@ -232,7 +244,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -252,13 +264,14 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.1" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -298,7 +311,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -335,7 +348,7 @@ modules = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, From 7318af5c75ba0417cbefbf8c9d8355074f356187 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 14 Nov 2024 22:05:55 +0530 Subject: [PATCH 05/15] Migrate runtime APIs --- gradle.properties | 42 +++++++++---------- .../websub/NativeHttpToWebsubAdaptor.java | 18 +++----- 2 files changed, 26 insertions(+), 34 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7b7a99c9..fd7fe26c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=2.13.0-SNAPSHOT -ballerinaLangVersion=2201.10.0-20241025-103700-5c9e6a27 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 puppycrawlCheckstyleVersion=10.12.0 testngVersion=7.6.1 ballerinaGradlePluginVersion=2.0.1 @@ -13,35 +13,35 @@ downloadPluginVersion=5.4.0 releasePluginVersion=2.8.0 # Direct Dependencies -stdlibIoVersion=1.6.2-20240928-084100-656404f -stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e -stdlibTimeVersion=2.5.1-20240930-120200-e59222b -stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1 -stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab -stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4 -stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0 -stdlibUuidVersion=1.8.1-20241009-134600-a05012b -stdlibHttpVersion=2.13.0-20241029-110700-30ed05b +stdlibIoVersion=1.6.2-20241112-233100-995cf5f +stdlibRandomVersion=1.5.1-20241113-122300-1bc770e +stdlibTimeVersion=2.6.0-20241113-073800-201b904 +stdlibUrlVersion=2.4.1-20241113-073900-335ff51 +stdlibCryptoVersion=2.7.3-20241113-081400-d015a39 +stdlibLogVersion=2.10.1-20241113-120000-4577868 +stdlibMimeVersion=2.10.2-20241113-154200-d953747 +stdlibUuidVersion=1.8.1-20241113-154400-443c67b +stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a # Transitive Dependencies # Level 01 -stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396 +stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5 # Level 02 -stdlibOsVersion=1.8.1-20241001-120600-dd1626e -stdlibTaskVersion=2.5.1-20241002-145700-5bdb843 +stdlibOsVersion=1.8.1-20241113-122000-cca973b +stdlibTaskVersion=2.5.1-20241113-123500-f905281 # Level 03 -stdlibCacheVersion=3.8.1-20241007-154900-63f4403 -stdlibFileVersion=1.10.1-20241007-160900-03f7b64 +stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf +stdlibFileVersion=1.10.1-20241113-151700-e1a2e38 # Level 04 -stdlibAuthVersion=2.12.1-20241010-130800-733dbef -stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f -stdlibJwtVersion=2.13.1-20241010-123600-5ea6a94 -stdlibOAuth2Version=2.12.1-20241029-084800-d7ba9e5 +stdlibAuthVersion=2.12.1-20241113-162300-ded40eb +stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739 +stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa +stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe # Ballerinax Observe -observeVersion=1.3.1-20241007-161000-645452d -observeInternalVersion=1.3.1-20241015-172900-cdc3cb3 +observeVersion=1.4.0-20241113-092000-b83ae74 +observeInternalVersion=1.3.1-20241113-101700-265054d diff --git a/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java b/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java index 72817879..6db824f5 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/NativeHttpToWebsubAdaptor.java @@ -20,14 +20,14 @@ import io.ballerina.runtime.api.Environment; import io.ballerina.runtime.api.Module; -import io.ballerina.runtime.api.TypeTags; -import io.ballerina.runtime.api.async.StrandMetadata; +import io.ballerina.runtime.api.concurrent.StrandMetadata; import io.ballerina.runtime.api.creators.ValueCreator; import io.ballerina.runtime.api.types.IntersectionType; import io.ballerina.runtime.api.types.MethodType; import io.ballerina.runtime.api.types.ObjectType; import io.ballerina.runtime.api.types.Parameter; import io.ballerina.runtime.api.types.Type; +import io.ballerina.runtime.api.types.TypeTags; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.utils.TypeUtils; import io.ballerina.runtime.api.values.BArray; @@ -145,20 +145,12 @@ private static Object invokeRemoteFunction(Environment env, BObject bSubscriberS return env.yieldAndRun(() -> { CompletableFuture balFuture = new CompletableFuture<>(); Module module = ModuleUtils.getModule(); - StrandMetadata metadata = new StrandMetadata(module.getOrg(), module.getName(), module.getVersion(), - parentFunctionName); Object[] args = new Object[]{message}; ObjectType serviceType = (ObjectType) TypeUtils.getReferredType(TypeUtils.getType(bSubscriberService)); - Object result; + boolean isIsolated = serviceType.isIsolated() && serviceType.isIsolated(remoteFunctionName); + StrandMetadata metadata = new StrandMetadata(isIsolated, null); try { - if (serviceType.isIsolated() - && serviceType.isIsolated(remoteFunctionName)) { - result = env.getRuntime().startIsolatedWorker(bSubscriberService, - remoteFunctionName, null, metadata, null, args).get(); - } else { - result = env.getRuntime().startNonIsolatedWorker(bSubscriberService, - remoteFunctionName, null, metadata, null, args).get(); - } + Object result = env.getRuntime().callMethod(bSubscriberService, remoteFunctionName, metadata, args); ModuleUtils.notifySuccess(balFuture, result); return ModuleUtils.getResult(balFuture); } catch (BError bError) { From 1e0059372902ab52f7cb2322454716fd197a61e2 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 14 Nov 2024 22:06:03 +0530 Subject: [PATCH 06/15] Revert "[Automated] Update the native jar versions" This reverts commit ef07c9b88e60cc079165346b9aafc7da81e29496. --- ballerina-tests/Ballerina.toml | 4 ++-- ballerina-tests/Dependencies.toml | 32 +++++++++---------------------- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml index d8d903be..d5908366 100644 --- a/ballerina-tests/Ballerina.toml +++ b/ballerina-tests/Ballerina.toml @@ -1,10 +1,10 @@ [package] org = "ballerina" name = "websub_tests" -version = "2.13.0" +version = "2.12.1" [platform.java21] graalvmCompatible = true [[platform.java21.dependency]] -path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" +path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml index 72bc4015..7dc1d9fc 100644 --- a/ballerina-tests/Dependencies.toml +++ b/ballerina-tests/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.11.0-20241112-214900-6b80ab87" +distribution-version = "2201.10.0-20241025-103700-5c9e6a27" [[package]] org = "ballerina" @@ -28,14 +28,13 @@ scope = "testOnly" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.6.0" +version = "1.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -51,16 +50,6 @@ dependencies = [ {org = "ballerina", name = "time"} ] -[[package]] -org = "ballerina" -name = "data.jsondata" -version = "0.3.0" -scope = "testOnly" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.object"} -] - [[package]] org = "ballerina" name = "file" @@ -83,7 +72,6 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -131,8 +119,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -242,7 +229,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.2" +version = "2.10.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -261,14 +248,13 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.4.0" +version = "1.3.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -311,7 +297,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.6.0" +version = "2.5.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -329,7 +315,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websub" -version = "2.13.0" +version = "2.12.1" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -350,7 +336,7 @@ modules = [ [[package]] org = "ballerina" name = "websub_tests" -version = "2.13.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "test"}, {org = "ballerina", name = "websub"} From 390e09de8567d17401c299f1536fd2a9e0c9672e Mon Sep 17 00:00:00 2001 From: hindujaB Date: Thu, 14 Nov 2024 22:06:06 +0530 Subject: [PATCH 07/15] Revert "[Automated] Update the native jar versions" This reverts commit 9c52a8e7243801c4a9efe7a6a2aa0ecfdf6df9a8. --- ballerina/Ballerina.toml | 8 ++++---- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 29 ++++++++--------------------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index dce748ad..507c2f0f 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,13 +1,13 @@ [package] org = "ballerina" name = "websub" -version = "2.13.0" +version = "2.12.1" authors = ["Ballerina"] keywords = ["websub", "subscriber", "service", "listener"] repository = "https://github.com/ballerina-platform/module-ballerina-websub" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.11.0" +distribution = "2201.10.0" [platform.java21] graalvmCompatible = true @@ -15,5 +15,5 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "websub-native" -version = "2.13.0" -path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" +version = "2.12.1" +path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 97192a1e..209c083b 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "websub-compiler-plugin" class = "io.ballerina.stdlib.websub.WebSubCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.13.0-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.12.1-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index e0af9cba..6a8369b2 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-20241025-103700-5c9e6a27" [[package]] org = "ballerina" @@ -26,14 +26,13 @@ version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "task"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.6.0" +version = "1.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -50,15 +49,6 @@ modules = [ {org = "ballerina", packageName = "crypto", moduleName = "crypto"} ] -[[package]] -org = "ballerina" -name = "data.jsondata" -version = "0.3.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.object"} -] - [[package]] org = "ballerina" name = "file" @@ -79,7 +69,6 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -131,8 +120,7 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"} + {org = "ballerina", name = "log"} ] [[package]] @@ -244,7 +232,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.2" +version = "2.10.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -264,14 +252,13 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.4.0" +version = "1.3.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -311,7 +298,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.6.0" +version = "2.5.1" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -348,7 +335,7 @@ modules = [ [[package]] org = "ballerina" name = "websub" -version = "2.13.0" +version = "2.12.1" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, From a71399281d33b4d14fc639e9a5cffa3ba8e35c10 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 11:46:17 +0530 Subject: [PATCH 08/15] Revert workflow branches --- .github/workflows/build-timestamped-master.yml | 2 +- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index f202d1aa..2d154ffc 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -14,5 +14,5 @@ jobs: call_workflow: name: Run Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index d42302e0..db8ef6b4 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -30,7 +30,7 @@ jobs: call_stdlib_workflow: name: Run StdLib Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index ebe213e7..11922b55 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -15,7 +15,7 @@ jobs: call_workflow: name: Run Central Publish Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index d27fa3f7..6784d8c7 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -9,7 +9,7 @@ jobs: call_workflow: name: Run Release Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main secrets: inherit with: package-name: websub diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index db98c8e1..31e0976d 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -10,5 +10,5 @@ jobs: call_workflow: name: Run PR Build Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index d91a5f37..458aab57 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -9,5 +9,5 @@ jobs: call_workflow: name: Run Trivy Scan Workflow if: ${{ github.repository_owner == 'ballerina-platform' }} - uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main secrets: inherit From 6940fa4e14cae92db545a93de63830fa9bf93c32 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 14:06:43 +0530 Subject: [PATCH 09/15] [Automated] Update the native jar versions --- ballerina-tests/Ballerina.toml | 4 ++-- ballerina-tests/Dependencies.toml | 32 ++++++++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/ballerina-tests/Ballerina.toml b/ballerina-tests/Ballerina.toml index d5908366..d8d903be 100644 --- a/ballerina-tests/Ballerina.toml +++ b/ballerina-tests/Ballerina.toml @@ -1,10 +1,10 @@ [package] org = "ballerina" name = "websub_tests" -version = "2.12.1" +version = "2.13.0" [platform.java21] graalvmCompatible = true [[platform.java21.dependency]] -path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" +path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" diff --git a/ballerina-tests/Dependencies.toml b/ballerina-tests/Dependencies.toml index 7dc1d9fc..72bc4015 100644 --- a/ballerina-tests/Dependencies.toml +++ b/ballerina-tests/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0-20241025-103700-5c9e6a27" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" @@ -28,13 +28,14 @@ scope = "testOnly" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"} + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.1" +version = "1.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -50,6 +51,16 @@ dependencies = [ {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -72,6 +83,7 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -119,7 +131,8 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} ] [[package]] @@ -229,7 +242,7 @@ dependencies = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.10.2" scope = "testOnly" dependencies = [ {org = "ballerina", name = "io"}, @@ -248,13 +261,14 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.1" +version = "1.4.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -297,7 +311,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "jballerina.java"} @@ -315,7 +329,7 @@ dependencies = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" scope = "testOnly" dependencies = [ {org = "ballerina", name = "crypto"}, @@ -336,7 +350,7 @@ modules = [ [[package]] org = "ballerina" name = "websub_tests" -version = "2.12.1" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "test"}, {org = "ballerina", name = "websub"} From 70aebc308d50e621b28b6893711b31f605430304 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 14:06:43 +0530 Subject: [PATCH 10/15] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 8 ++++---- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 29 +++++++++++++++++++++-------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 507c2f0f..dce748ad 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,13 +1,13 @@ [package] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" authors = ["Ballerina"] keywords = ["websub", "subscriber", "service", "listener"] repository = "https://github.com/ballerina-platform/module-ballerina-websub" icon = "icon.png" license = ["Apache-2.0"] -distribution = "2201.10.0" +distribution = "2201.11.0" [platform.java21] graalvmCompatible = true @@ -15,5 +15,5 @@ graalvmCompatible = true [[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "websub-native" -version = "2.12.1" -path = "../native/build/libs/websub-native-2.12.1-SNAPSHOT.jar" +version = "2.13.0" +path = "../native/build/libs/websub-native-2.13.0-SNAPSHOT.jar" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index 209c083b..97192a1e 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "websub-compiler-plugin" class = "io.ballerina.stdlib.websub.WebSubCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.12.1-SNAPSHOT.jar" +path = "../compiler-plugin/build/libs/websub-compiler-plugin-2.13.0-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 6a8369b2..e0af9cba 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0-20241025-103700-5c9e6a27" +distribution-version = "2201.11.0-20241112-214900-6b80ab87" [[package]] org = "ballerina" @@ -26,13 +26,14 @@ version = "3.8.1" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"} + {org = "ballerina", name = "task"}, + {org = "ballerina", name = "time"} ] [[package]] org = "ballerina" name = "constraint" -version = "1.5.1" +version = "1.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -49,6 +50,15 @@ modules = [ {org = "ballerina", packageName = "crypto", moduleName = "crypto"} ] +[[package]] +org = "ballerina" +name = "data.jsondata" +version = "0.3.0" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.object"} +] + [[package]] org = "ballerina" name = "file" @@ -69,6 +79,7 @@ dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "data.jsondata"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -120,7 +131,8 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.int"}, {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"} + {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"} ] [[package]] @@ -232,7 +244,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.10.1" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -252,13 +264,14 @@ dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "log"}, + {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] [[package]] org = "ballerina" name = "observe" -version = "1.3.1" +version = "1.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -298,7 +311,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.5.1" +version = "2.6.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -335,7 +348,7 @@ modules = [ [[package]] org = "ballerina" name = "websub" -version = "2.12.1" +version = "2.13.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "http"}, From 9bb58d850f1893da7d3ddf9e93aa80c140a34759 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 14:06:47 +0530 Subject: [PATCH 11/15] Fix code quality --- .../src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java index 0db23705..cde9a4be 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java @@ -76,6 +76,9 @@ private static boolean isModuleDefinedError(BError error) { public static Object getResult(CompletableFuture balFuture) { try { return balFuture.get(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw ErrorCreator.createError(e); } catch (Throwable throwable) { throw ErrorCreator.createError(throwable); } From b59f430903f32d68d4903b8ccf6cbeeb2f2f1d31 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 14:38:24 +0530 Subject: [PATCH 12/15] Revert fix code quality --- .../src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java index cde9a4be..0db23705 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java @@ -76,9 +76,6 @@ private static boolean isModuleDefinedError(BError error) { public static Object getResult(CompletableFuture balFuture) { try { return balFuture.get(); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw ErrorCreator.createError(e); } catch (Throwable throwable) { throw ErrorCreator.createError(throwable); } From 788daa320ea00458454cf49843fd4e578448bb27 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Mon, 18 Nov 2024 21:52:31 +0530 Subject: [PATCH 13/15] Re-enable `testCodeActions` test --- .../codeaction/AbstractCodeActionTest.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java index f9b92528..69ac6781 100644 --- a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java +++ b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java @@ -36,6 +36,7 @@ import io.ballerina.tools.text.LinePosition; import org.testng.Assert; import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; import java.io.IOException; import java.nio.file.Files; @@ -45,6 +46,7 @@ import java.util.stream.Collectors; import static io.ballerina.stdlib.websub.TestUtils.getEnvironmentBuilder; +import static io.ballerina.stdlib.websub.TestUtils.getResourcePath; import static io.ballerina.stdlib.websub.TestUtils.isWithinRange; /** @@ -53,13 +55,13 @@ public abstract class AbstractCodeActionTest { private static final Gson GSON = new Gson(); -// @Test(dataProvider = "testDataProvider") -// public void testCodeActions(String srcFile, int line, int offset, String resultFile) -// throws IOException { -// Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); -// Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); -// performTest(srcPath, LinePosition.from(line, offset), targetPath); -// } + @Test(dataProvider = "testDataProvider") + public void testCodeActions(String srcFile, int line, int offset, String resultFile) + throws IOException { + Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); + Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); + performTest(srcPath, LinePosition.from(line, offset), targetPath); + } @DataProvider protected abstract Object[][] testDataProvider(); From 8d5d260b48893615c221e983c29717986fff22ac Mon Sep 17 00:00:00 2001 From: hindujaB Date: Tue, 19 Nov 2024 08:48:37 +0530 Subject: [PATCH 14/15] Revert "Re-enable `testCodeActions` test" This reverts commit 788daa320ea00458454cf49843fd4e578448bb27. --- .../codeaction/AbstractCodeActionTest.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java index 69ac6781..f9b92528 100644 --- a/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java +++ b/compiler-plugin-tests/src/test/java/io/ballerina/stdlib/websub/codeaction/AbstractCodeActionTest.java @@ -36,7 +36,6 @@ import io.ballerina.tools.text.LinePosition; import org.testng.Assert; import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import java.io.IOException; import java.nio.file.Files; @@ -46,7 +45,6 @@ import java.util.stream.Collectors; import static io.ballerina.stdlib.websub.TestUtils.getEnvironmentBuilder; -import static io.ballerina.stdlib.websub.TestUtils.getResourcePath; import static io.ballerina.stdlib.websub.TestUtils.isWithinRange; /** @@ -55,13 +53,13 @@ public abstract class AbstractCodeActionTest { private static final Gson GSON = new Gson(); - @Test(dataProvider = "testDataProvider") - public void testCodeActions(String srcFile, int line, int offset, String resultFile) - throws IOException { - Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); - Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); - performTest(srcPath, LinePosition.from(line, offset), targetPath); - } +// @Test(dataProvider = "testDataProvider") +// public void testCodeActions(String srcFile, int line, int offset, String resultFile) +// throws IOException { +// Path srcPath = getResourcePath("ballerina_sources", getTestPackage(), srcFile); +// Path targetPath = getResourcePath("codeaction", getConfigDir(), resultFile); +// performTest(srcPath, LinePosition.from(line, offset), targetPath); +// } @DataProvider protected abstract Object[][] testDataProvider(); From 94f288fa073f12fbe4e8f8d1f465619327a14896 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Tue, 19 Nov 2024 19:28:53 +0530 Subject: [PATCH 15/15] Update exception logic --- .../main/java/io/ballerina/stdlib/websub/ModuleUtils.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java index 0db23705..9fb496c1 100644 --- a/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java +++ b/native/src/main/java/io/ballerina/stdlib/websub/ModuleUtils.java @@ -76,6 +76,11 @@ private static boolean isModuleDefinedError(BError error) { public static Object getResult(CompletableFuture balFuture) { try { return balFuture.get(); + } catch (BError error) { + throw error; + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw ErrorCreator.createError(e); } catch (Throwable throwable) { throw ErrorCreator.createError(throwable); }