Skip to content

Commit

Permalink
Merge pull request #1657 from warunalakshitha/updateRuntime
Browse files Browse the repository at this point in the history
Migrate to new Runtime APIs
  • Loading branch information
warunalakshitha authored Nov 14, 2024
2 parents 3da09ef + 29d5420 commit 5188f60
Show file tree
Hide file tree
Showing 24 changed files with 120 additions and 125 deletions.
50 changes: 25 additions & 25 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
org = "ballerina"
name = "grpc"
version = "1.12.2"
distribution = "2201.10.0"
version = "1.13.0"
distribution = "2201.11.0"
authors = ["Ballerina"]
keywords = ["network", "grpc", "protobuf", "server-streaming", "client-streaming", "bidirectional-streaming"]
repository = "https://github.com/ballerina-platform/module-ballerina-grpc"
Expand All @@ -16,7 +16,7 @@ graalvmCompatible = true
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "grpc-native"
version = "1.12.2"
ersion = "1.12.2"
path = "../native/build/libs/grpc-native-1.12.2-SNAPSHOT.jar"

[[platform.java21.dependency]]
Expand All @@ -40,62 +40,62 @@ path = "./lib/http-native-2.13.0-20241029-110700-30ed05b.jar"
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-common"
version = "4.1.108.Final"
path = "./lib/netty-common-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-common-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-buffer"
version = "4.1.108.Final"
path = "./lib/netty-buffer-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-buffer-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-transport"
version = "4.1.108.Final"
path = "./lib/netty-transport-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-transport-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-resolver"
version = "4.1.108.Final"
path = "./lib/netty-resolver-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-resolver-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-handler"
version = "4.1.108.Final"
path = "./lib/netty-handler-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-handler-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-codec-http"
version = "4.1.108.Final"
path = "./lib/netty-codec-http-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-codec-http-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-codec"
version = "4.1.108.Final"
path = "./lib/netty-codec-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-codec-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-handler-proxy"
version = "4.1.108.Final"
path = "./lib/netty-handler-proxy-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-handler-proxy-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-codec-http2"
version = "4.1.108.Final"
path = "./lib/netty-codec-http2-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-codec-http2-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-transport-native-unix-common"
version = "4.1.108.Final"
path = "./lib/netty-transport-native-unix-common-4.1.108.Final.jar"
version = "4.1.115.Final"
path = "./lib/netty-transport-native-unix-common-4.1.115.Final.jar"

[[platform.java21.dependency]]
groupId = "commons.pool.wso2"
Expand Down Expand Up @@ -163,8 +163,8 @@ path = "./lib/proto-google-common-protos-1.17.0.jar"
[[platform.java21.dependency]]
groupId = "org.ballerinalang"
artifactId = "formatter-core"
version = "2201.10.0-20241025-103700-5c9e6a27"
path = "./lib/formatter-core-2201.10.0-20241025-103700-5c9e6a27.jar"
version = "2201.11.0-20241008-112400-81975006"
path = "./lib/formatter-core-2201.11.0-20241008-112400-81975006.jar"

[[platform.java21.dependency]]
groupId = "org.ballerinalang"
Expand Down
13 changes: 12 additions & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ modules = [
{org = "ballerina", packageName = "crypto", moduleName = "crypto"}
]

[[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"
Expand All @@ -67,7 +77,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "grpc"
version = "1.12.2"
version = "1.13.0"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "crypto"},
Expand Down Expand Up @@ -100,6 +110,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"},
Expand Down
2 changes: 1 addition & 1 deletion build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org = "ballerina"
name = "grpc"
version = "@toml.version@"
distribution = "2201.10.0"
distribution = "2201.11.0"
authors = ["Ballerina"]
keywords = ["network", "grpc", "protobuf", "server-streaming", "client-streaming", "bidirectional-streaming"]
repository = "https://github.com/ballerina-platform/module-ballerina-grpc"
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ subprojects {
ballerinaStdLibs "io.ballerina.stdlib:random-ballerina:${stdlibRandomVersion}"
ballerinaStdLibs "io.ballerina.stdlib:observe-ballerina:${observeVersion}"
ballerinaStdLibs "io.ballerina:observe-ballerina:${observeInternalVersion}"
ballerinaStdLibs "io.ballerina.lib:data.jsondata-ballerina:${stdlibDataJsonDataVersion}"
}
}

Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ This file contains all the notable changes done to the Ballerina gRPC package th
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- [Address CVE-2024-47535 vulnerability](https://github.com/ballerina-platform/ballerina-library/issues/7358)

## [1.12.1] - 2024-09-26

### Fixed
Expand Down
47 changes: 24 additions & 23 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.12.2-SNAPSHOT
version=1.13.0-SNAPSHOT
#dependency versions
ballerinaLangVersion=2201.10.0-20241025-103700-5c9e6a27
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87
ballerinaTomlParserVersion=1.2.2
checkstylePluginVersion=10.12.0
commonsLang3Version=3.8.1
slf4jVersion=1.7.30
protoGoogleCommonsVersion=1.17.0
protobufJavaVersion=3.25.5
jknackHandlebarsVersion=4.0.6
nettyVersion=4.1.108.Final
nettyVersion=4.1.115.Final
nettyTcnativeVersion=2.0.65.Final
picocliVersion=4.0.1
githubSpotbugsVersion=6.0.18
Expand All @@ -26,29 +26,30 @@ bouncycastleVersion=1.78
wso2CommonsPoolVersion=1.5.6.wso2v1

#stdlib dependencies
stdlibIoVersion=1.6.2-20240928-084100-656404f
stdlibTimeVersion=2.5.1-20240930-120200-e59222b
stdlibUrlVersion=2.4.1-20240930-120200-b7fb9e1
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
stdlibTimeVersion=2.6.0-20241113-073800-201b904
stdlibUrlVersion=2.4.1-20241113-073900-335ff51

stdlibConstraintVersion=1.5.1-20240930-123400-5ecd396
stdlibCryptoVersion=2.7.3-20240930-132000-5ecc9ab
stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4
stdlibOsVersion=1.8.1-20241001-120600-dd1626e
stdlibProtobufVersion=1.6.2-20240930-192700-1e42210
stdlibRandomVersion=1.5.1-20240930-193000-e5c6c0e
stdlibTaskVersion=2.5.1-20241002-145700-5bdb843
stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5
stdlibCryptoVersion=2.7.3-20241113-081400-d015a39
stdlibLogVersion=2.10.1-20241113-120000-4577868
stdlibOsVersion=1.8.1-20241113-122000-cca973b
stdlibProtobufVersion=1.6.2-20241113-122200-13cac06
stdlibRandomVersion=1.5.1-20241113-122300-1bc770e
stdlibTaskVersion=2.5.1-20241113-123500-f905281

stdlibCacheVersion=3.8.1-20241007-154900-63f4403
stdlibFileVersion=1.10.1-20241007-160900-03f7b64
stdlibMimeVersion=2.10.1-20241009-141200-8b6c9f0
stdlibUuidVersion=1.8.1-20241009-134600-a05012b
stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf
stdlibFileVersion=1.10.1-20241113-151700-e1a2e38
stdlibMimeVersion=2.10.2-20241113-154200-d953747
stdlibUuidVersion=1.8.1-20241113-154400-443c67b

stdlibAuthVersion=2.12.1-20241010-130800-733dbef
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

stdlibHttpVersion=2.13.0-20241029-110700-30ed05b
stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a

# Ballerinax Observer
observeVersion=1.3.1-20241007-161000-645452d
observeInternalVersion=1.3.1-20241007-182700-a5f77a1
observeVersion=1.4.0-20241113-092000-b83ae74
observeInternalVersion=1.3.1-20241113-101700-265054d
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,5 @@ gRPC Route Guide Bidirectional Streaming,3506,482.530775,479.591677,0.0,748.5674
gRPC Route Guide Bidirectional Streaming,3345,505.135709,502.420856,0.0,798.854974,0.0,165.343025,1039.034575,0.0,1.86,0,0,1727460701,0,10
gRPC Route Guide Bidirectional Streaming,3314,510.11138,501.833977,0.0,802.72178,0.0,149.377058,1466.109361,0.0,1.84,0,0,1727547032,0,10
gRPC Route Guide Bidirectional Streaming,3530,481.633746,485.867694,0.0,766.209934,0.0,157.652587,1175.187999,0.0,1.96,0,0,1729102459,0,10
gRPC Route Guide Bidirectional Streaming,3268,514.845909,512.637627,0.0,808.647631,0.0,131.481928,1307.470988,0.0,1.82,0,0,1729188763,0,10
gRPC Route Guide Bidirectional Streaming,3592,473.780663,476.37975,0.0,742.511928,0.0,152.013694,1023.708903,0.0,1.99,0,0,1731521579,0,10
2 changes: 2 additions & 0 deletions load-tests/route_guide_client_streaming/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,5 @@ gRPC Route Guide Client Streaming,898997,1.400038,0.92562,0.0,1.891121,0.0,0.689
gRPC Route Guide Client Streaming,898994,1.441502,0.907615,0.0,2.142536,0.0,0.734512,197.075894,0.0,499.44,0,0,1727462786,0,10
gRPC Route Guide Client Streaming,898997,1.457238,0.914714,0.0,2.213433,0.0,0.728111,196.229934,0.0,499.44,0,0,1727549118,0,10
gRPC Route Guide Client Streaming,898997,1.253074,0.818204,0.0,1.829809,0.0,0.637603,382.899362,0.0,499.44,0,0,1729104567,0,10
gRPC Route Guide Client Streaming,898998,1.647377,1.016311,0.0,2.835227,0.0,0.781205,203.05984,0.0,499.44,0,0,1729190815,0,10
gRPC Route Guide Client Streaming,899001,1.227053,0.808098,0.0,1.758296,0.0,0.631299,223.038223,0.0,499.44,0,0,1731523627,0,10
2 changes: 2 additions & 0 deletions load-tests/route_guide_server_streaming/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -579,3 +579,5 @@ gRPC Route Guide Server Streaming,898998,5.987615,2.046317,0.0,18.504627,0.0,1.2
gRPC Route Guide Server Streaming,898996,8.16116,2.461642,0.0,48.984807,0.0,1.345322,210.027336,0.0,499.44,0,0,1727465663,0,10
gRPC Route Guide Server Streaming,898997,8.74801,2.659339,0.0,51.029056,0.0,1.35652,139.436291,0.0,499.44,0,0,1727552059,0,10
gRPC Route Guide Server Streaming,898994,4.752683,1.799709,0.0,13.739662,0.0,1.250806,180.150065,0.0,499.44,0,0,1729107184,0,10
gRPC Route Guide Server Streaming,898998,13.869668,8.71621,0.0,54.957258,0.0,1.407411,196.414035,0.0,499.44,0,0,1729193305,0,10
gRPC Route Guide Server Streaming,898997,4.404741,1.739797,0.0,13.110902,0.0,1.237798,194.497726,0.0,499.44,0,0,1731526731,0,10
2 changes: 2 additions & 0 deletions load-tests/route_guide_unary/results/summary.csv
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,5 @@ gRPC Route Guide Unary,898997,0.941409,0.715309,0.0,1.479118,0.0,0.509905,90.208
gRPC Route Guide Unary,898996,0.847067,0.675708,0.0,1.167135,0.0,0.472604,90.204033,0.0,499.44,0,0,1726085410,0,10
gRPC Route Guide Unary,898996,0.871588,0.67851,0.0,1.141717,0.0,0.504407,94.7139,0.0,499.44,0,0,1727554142,0,10
gRPC Route Guide Unary,898995,0.734134,0.599803,0.0,0.874304,0.0,0.432902,83.262678,0.0,499.44,0,0,1729109238,0,10
gRPC Route Guide Unary,898999,0.976462,0.747409,0.0,1.259314,0.0,0.540303,100.586353,0.0,499.44,0,0,1729195393,0,10
gRPC Route Guide Unary,898996,0.736169,0.596999,0.0,0.878098,0.0,0.4006,97.861689,0.0,499.44,0,0,1731528821,0,10
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.ballerina.stdlib.grpc;

import com.google.protobuf.DescriptorProtos;
import io.ballerina.runtime.api.async.StrandMetadata;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BString;

Expand All @@ -25,7 +24,6 @@
import java.util.Map;
import java.util.Objects;

import static io.ballerina.runtime.api.constants.RuntimeConstants.BALLERINA_BUILTIN_PKG_PREFIX;
import static io.ballerina.runtime.api.constants.RuntimeConstants.ORG_NAME_SEPARATOR;
import static io.ballerina.stdlib.grpc.nativeimpl.ModuleUtils.getModule;

Expand All @@ -37,7 +35,7 @@
public class GrpcConstants {
//gRPC package name.
public static final String PROTOCOL_PACKAGE_GRPC = "grpc";
public static final String PROTOCOL_PACKAGE_VERSION_GRPC = getModule().getVersion();
public static final String PROTOCOL_PACKAGE_VERSION_GRPC = getModule().getMajorVersion();
public static final String ORG_NAME = "ballerina";
public static final String PROTOCOL_STRUCT_PACKAGE_GRPC = ORG_NAME + ORG_NAME_SEPARATOR +
"grpc:" + PROTOCOL_PACKAGE_VERSION_GRPC;
Expand Down Expand Up @@ -240,11 +238,6 @@ public static <T, E> T getKeyByValue(Map<T, E> map, E value) {
//Observability tag keys
public static final String TAG_KEY_GRPC_ERROR_MESSAGE = "grpc.error_message";

// Strand meta data
public static final StrandMetadata ON_MESSAGE_METADATA =
new StrandMetadata(BALLERINA_BUILTIN_PKG_PREFIX, PROTOCOL_PACKAGE_GRPC, PROTOCOL_PACKAGE_VERSION_GRPC,
ON_MESSAGE_RESOURCE);

public static final BString ENDPOINT_CONFIG_SECURESOCKET = StringUtils.fromString("secureSocket");
public static final BString SECURESOCKET_CONFIG_DISABLE_SSL = StringUtils.fromString("enable");
public static final BString SECURESOCKET_CONFIG_CERT = StringUtils.fromString("cert");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

package io.ballerina.stdlib.grpc;

import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BDecimal;
import io.ballerina.runtime.api.values.BError;
Expand Down
4 changes: 2 additions & 2 deletions native/src/main/java/io/ballerina/stdlib/grpc/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
import com.google.protobuf.TimestampProto;
import com.google.protobuf.WireFormat;
import com.google.protobuf.WrappersProto;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.AnydataType;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.MapType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.TupleType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.types.UnionType;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.MethodType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BError;
import io.ballerina.runtime.api.values.BMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
import com.google.protobuf.InvalidProtocolBufferException;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.types.ErrorType;
import io.ballerina.runtime.api.types.MethodType;
import io.ballerina.runtime.api.types.NullType;
import io.ballerina.runtime.api.types.ObjectType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.StreamType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.types.UnionType;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BMap;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import com.google.protobuf.Descriptors;
import com.google.protobuf.InvalidProtocolBufferException;
import io.ballerina.runtime.api.Module;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.Runtime;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.MethodType;
import io.ballerina.runtime.api.types.NullType;
import io.ballerina.runtime.api.types.ObjectType;
import io.ballerina.runtime.api.types.Parameter;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.StreamType;
import io.ballerina.runtime.api.types.Type;
Expand Down
Loading

0 comments on commit 5188f60

Please sign in to comment.