From e81351684d343258cd700b308ef3b402ef306ed0 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 28 May 2024 20:09:23 +0530 Subject: [PATCH 1/7] Fix http method check for caching --- ballerina/caching_http_caching_client.bal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina/caching_http_caching_client.bal b/ballerina/caching_http_caching_client.bal index bf1ce49d5d..52b83743ef 100644 --- a/ballerina/caching_http_caching_client.bal +++ b/ballerina/caching_http_caching_client.bal @@ -105,7 +105,7 @@ client isolated class HttpCachingClient { Request request = message; setRequestCacheControlHeader(request); - if httpMethod == HTTP_GET || httpMethod == HTTP_HEAD { + if httpMethod.equalsIgnoreCaseAscii(HTTP_GET) || httpMethod.equalsIgnoreCaseAscii(HTTP_HEAD) { return getCachedResponse(self.cache, self.httpClient, request, httpMethod, path, self.cacheConfig.isShared, false); } @@ -187,7 +187,7 @@ client isolated class HttpCachingClient { # + request - The HTTP request to be forwarded # + return - The response or an `http:ClientError` if failed to establish the communication with the upstream server remote isolated function forward(string path, Request request) returns Response|ClientError { - if request.method == HTTP_GET || request.method == HTTP_HEAD { + if request.method.equalsIgnoreCaseAscii(HTTP_GET) || request.method.equalsIgnoreCaseAscii(HTTP_HEAD) { return getCachedResponse(self.cache, self.httpClient, request, request.method, path, self.cacheConfig.isShared, true); } @@ -367,9 +367,9 @@ isolated function sendNewRequest(HttpClient httpClient, Request request, string if forwardRequest { return httpClient->forward(path, request); } - if httpMethod == HTTP_GET { + if httpMethod.equalsIgnoreCaseAscii(HTTP_GET) { return httpClient->get(path, message = request); - } else if httpMethod == HTTP_HEAD { + } else if httpMethod.equalsIgnoreCaseAscii(HTTP_HEAD) { return httpClient->head(path, message = request); } else { string message = "HTTP method not supported in caching client: " + httpMethod; From e36c19afd1a642ab159004fcc691525ad60d0407 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 07:40:01 +0530 Subject: [PATCH 2/7] Add test cases --- .../http_cache_config_annotation_test.bal | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal index 7dee547114..54b925d9d2 100644 --- a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal +++ b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal @@ -31,6 +31,7 @@ isolated int noCacheHitCountNew = 0; isolated int maxAgeHitCountNew = 0; isolated int numberOfHitsNew = 0; isolated int statusHits = 0; +isolated int greetingHits = 0; final readonly & xml maxAgePayload1 = xml `before cache expiration`; final readonly & xml maxAgePayload2 = xml `after cache expiration`; readonly & string errorBody = "Error"; @@ -160,6 +161,13 @@ service / on new http:Listener(cacheAnnotationTestPort2, httpVersion = http:HTTP return err; } } + + resource function default greeting() returns @http:Cache {maxAge: 10} json { + lock { + greetingHits += 1; + } + return {"message": "Hello, World!"}; + } } @test:Config {} @@ -318,3 +326,50 @@ function testReturnStatusCodeResponsesWithAnnotation() returns error? { common:assertTextPayload(response.getTextPayload(), errorBody); return; } + +@test:Config {} +function testBasicCachingBehaviourWithExecute() returns error? { + check checkBasicCachingBehaviourWithExecute("GET", 1); + runtime:sleep(1); + check checkBasicCachingBehaviourWithExecute("get", 2); + runtime:sleep(1); + check checkBasicCachingBehaviourWithExecute("HEAD", 3); + runtime:sleep(1); + check checkBasicCachingBehaviourWithExecute("head", 4); +} + +function checkBasicCachingBehaviourWithExecute(string method, int hitCount) returns error? { + http:Response|error response = cacheBackendEP->execute(method, "/greeting", new http:Request()); + if response is http:Response { + test:assertEquals(response.statusCode, 200, msg = "Found unexpected output"); + lock { + test:assertEquals(greetingHits, hitCount); + } + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + runtime:sleep(1); + + response = cacheBackendEP->execute(method, "/greeting", new http:Request()); + if response is http:Response { + test:assertEquals(response.statusCode, 200, msg = "Found unexpected output"); + lock { + test:assertEquals(greetingHits, hitCount); + } + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } + + runtime:sleep(1); + + response = cacheBackendEP->execute(method, "/greeting", new http:Request()); + if response is http:Response { + test:assertEquals(response.statusCode, 200, msg = "Found unexpected output"); + lock { + test:assertEquals(greetingHits, hitCount); + } + } else { + test:assertFail(msg = "Found unexpected output type: " + response.message()); + } +} From 2d8eff33aad0e4f7c087a1e09e8a2e6eec7b0ce4 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 08:01:27 +0530 Subject: [PATCH 3/7] Update change log --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index c69226e80f..4cc8a77e5d 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,12 @@ This file contains all the notable changes done to the Ballerina HTTP 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 + +- [Fix caching behaviour with client execute method](https://github.com/ballerina-platform/ballerina-library/issues/6570) + ## [2.9.8] - 2024-05-07 ### Added From 17b711df37faf261ed0e9faf5db8f61362b33525 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 08:28:42 +0530 Subject: [PATCH 4/7] [Automated] Update the native jar versions --- ballerina-tests/http-advanced-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-advanced-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-client-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-client-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-dispatching-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-interceptor-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-misc-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-misc-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-resiliency-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-security-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-security-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-service-tests/Ballerina.toml | 6 +++--- ballerina-tests/http-service-tests/Dependencies.toml | 6 +++--- ballerina-tests/http-test-common/Ballerina.toml | 2 +- ballerina-tests/http-test-common/Dependencies.toml | 2 +- ballerina-tests/http2-tests/Ballerina.toml | 6 +++--- ballerina-tests/http2-tests/Dependencies.toml | 6 +++--- 20 files changed, 56 insertions(+), 56 deletions(-) diff --git a/ballerina-tests/http-advanced-tests/Ballerina.toml b/ballerina-tests/http-advanced-tests/Ballerina.toml index 0e409766e5..e9f621b075 100644 --- a/ballerina-tests/http-advanced-tests/Ballerina.toml +++ b/ballerina-tests/http-advanced-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_advanced_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-advanced-tests/Dependencies.toml b/ballerina-tests/http-advanced-tests/Dependencies.toml index bf24efd8ef..e3e35581c2 100644 --- a/ballerina-tests/http-advanced-tests/Dependencies.toml +++ b/ballerina-tests/http-advanced-tests/Dependencies.toml @@ -72,7 +72,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -105,7 +105,7 @@ modules = [ [[package]] org = "ballerina" name = "http_advanced_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "file"}, @@ -125,7 +125,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-client-tests/Ballerina.toml b/ballerina-tests/http-client-tests/Ballerina.toml index f0d95ecf85..1531fc8496 100644 --- a/ballerina-tests/http-client-tests/Ballerina.toml +++ b/ballerina-tests/http-client-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_client_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-client-tests/Dependencies.toml b/ballerina-tests/http-client-tests/Dependencies.toml index c6f2c75e4a..c6c8f86ae3 100644 --- a/ballerina-tests/http-client-tests/Dependencies.toml +++ b/ballerina-tests/http-client-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_client_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-dispatching-tests/Ballerina.toml b/ballerina-tests/http-dispatching-tests/Ballerina.toml index 1c78da0f5b..a5fe090881 100644 --- a/ballerina-tests/http-dispatching-tests/Ballerina.toml +++ b/ballerina-tests/http-dispatching-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_dispatching_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-dispatching-tests/Dependencies.toml b/ballerina-tests/http-dispatching-tests/Dependencies.toml index be48a04e56..9c8a1755fb 100644 --- a/ballerina-tests/http-dispatching-tests/Dependencies.toml +++ b/ballerina-tests/http-dispatching-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_dispatching_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "http"}, @@ -124,7 +124,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-interceptor-tests/Ballerina.toml b/ballerina-tests/http-interceptor-tests/Ballerina.toml index 5fff0d9ce8..a1b4e34a67 100644 --- a/ballerina-tests/http-interceptor-tests/Ballerina.toml +++ b/ballerina-tests/http-interceptor-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_interceptor_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-interceptor-tests/Dependencies.toml b/ballerina-tests/http-interceptor-tests/Dependencies.toml index f2baa964b4..91accd1445 100644 --- a/ballerina-tests/http-interceptor-tests/Dependencies.toml +++ b/ballerina-tests/http-interceptor-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_interceptor_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -115,7 +115,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-misc-tests/Ballerina.toml b/ballerina-tests/http-misc-tests/Ballerina.toml index 09448c0b60..51e94dd92f 100644 --- a/ballerina-tests/http-misc-tests/Ballerina.toml +++ b/ballerina-tests/http-misc-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_misc_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-misc-tests/Dependencies.toml b/ballerina-tests/http-misc-tests/Dependencies.toml index 24cd9cb0a0..9632523345 100644 --- a/ballerina-tests/http-misc-tests/Dependencies.toml +++ b/ballerina-tests/http-misc-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_misc_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -118,7 +118,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-resiliency-tests/Ballerina.toml b/ballerina-tests/http-resiliency-tests/Ballerina.toml index f7305045bc..4d2aa8aef7 100644 --- a/ballerina-tests/http-resiliency-tests/Ballerina.toml +++ b/ballerina-tests/http-resiliency-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_resiliency_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-resiliency-tests/Dependencies.toml b/ballerina-tests/http-resiliency-tests/Dependencies.toml index d94b8c5fa7..c0a49abbb9 100644 --- a/ballerina-tests/http-resiliency-tests/Dependencies.toml +++ b/ballerina-tests/http-resiliency-tests/Dependencies.toml @@ -66,7 +66,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -99,7 +99,7 @@ modules = [ [[package]] org = "ballerina" name = "http_resiliency_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "http_test_common"}, @@ -116,7 +116,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-security-tests/Ballerina.toml b/ballerina-tests/http-security-tests/Ballerina.toml index 1f41d70d6d..88ded614ea 100644 --- a/ballerina-tests/http-security-tests/Ballerina.toml +++ b/ballerina-tests/http-security-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_security_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-security-tests/Dependencies.toml b/ballerina-tests/http-security-tests/Dependencies.toml index bbf09f6548..5c00f8fe4f 100644 --- a/ballerina-tests/http-security-tests/Dependencies.toml +++ b/ballerina-tests/http-security-tests/Dependencies.toml @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_security_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "http"}, @@ -120,7 +120,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-service-tests/Ballerina.toml b/ballerina-tests/http-service-tests/Ballerina.toml index 4593acc186..c6aec9085b 100644 --- a/ballerina-tests/http-service-tests/Ballerina.toml +++ b/ballerina-tests/http-service-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http_service_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http-service-tests/Dependencies.toml b/ballerina-tests/http-service-tests/Dependencies.toml index b5b35c03c9..4775296da8 100644 --- a/ballerina-tests/http-service-tests/Dependencies.toml +++ b/ballerina-tests/http-service-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http_service_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, diff --git a/ballerina-tests/http-test-common/Ballerina.toml b/ballerina-tests/http-test-common/Ballerina.toml index eb88176a00..bd46ac205f 100644 --- a/ballerina-tests/http-test-common/Ballerina.toml +++ b/ballerina-tests/http-test-common/Ballerina.toml @@ -1,4 +1,4 @@ [package] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" diff --git a/ballerina-tests/http-test-common/Dependencies.toml b/ballerina-tests/http-test-common/Dependencies.toml index 56b8a409f0..03db79b51b 100644 --- a/ballerina-tests/http-test-common/Dependencies.toml +++ b/ballerina-tests/http-test-common/Dependencies.toml @@ -10,7 +10,7 @@ distribution-version = "2201.7.0" [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "lang.string"}, {org = "ballerina", name = "mime"}, diff --git a/ballerina-tests/http2-tests/Ballerina.toml b/ballerina-tests/http2-tests/Ballerina.toml index c1f03b1970..ba12ade8a2 100644 --- a/ballerina-tests/http2-tests/Ballerina.toml +++ b/ballerina-tests/http2-tests/Ballerina.toml @@ -1,17 +1,17 @@ [package] org = "ballerina" name = "http2_tests" -version = "2.9.8" +version = "2.9.9" [[dependency]] org = "ballerina" name = "http_test_common" repository = "local" -version = "2.9.8" +version = "2.9.9" [platform.java11] graalvmCompatible = true [[platform.java11.dependency]] scope = "testOnly" -path = "../../test-utils/build/libs/http-test-utils-2.9.8.jar" +path = "../../test-utils/build/libs/http-test-utils-2.9.9-SNAPSHOT.jar" diff --git a/ballerina-tests/http2-tests/Dependencies.toml b/ballerina-tests/http2-tests/Dependencies.toml index 2f8aa37183..ae329272ab 100644 --- a/ballerina-tests/http2-tests/Dependencies.toml +++ b/ballerina-tests/http2-tests/Dependencies.toml @@ -69,7 +69,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "auth"}, @@ -102,7 +102,7 @@ modules = [ [[package]] org = "ballerina" name = "http2_tests" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, @@ -121,7 +121,7 @@ modules = [ [[package]] org = "ballerina" name = "http_test_common" -version = "2.9.8" +version = "2.9.9" scope = "testOnly" dependencies = [ {org = "ballerina", name = "lang.string"}, From 8405c6f4e5f3085002c411ddc529ad0b4853312e Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 08:28:43 +0530 Subject: [PATCH 5/7] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 6 +++--- ballerina/CompilerPlugin.toml | 2 +- ballerina/Dependencies.toml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 954e79ce53..ae44af3eb5 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" authors = ["Ballerina"] keywords = ["http", "network", "service", "listener", "client"] repository = "https://github.com/ballerina-platform/module-ballerina-http" @@ -16,8 +16,8 @@ graalvmCompatible = true [[platform.java11.dependency]] groupId = "io.ballerina.stdlib" artifactId = "http-native" -version = "2.9.8" -path = "../native/build/libs/http-native-2.9.8.jar" +version = "2.9.9" +path = "../native/build/libs/http-native-2.9.9-SNAPSHOT.jar" [[platform.java11.dependency]] groupId = "io.ballerina.stdlib" diff --git a/ballerina/CompilerPlugin.toml b/ballerina/CompilerPlugin.toml index bb7d9167f6..e17ff2deef 100644 --- a/ballerina/CompilerPlugin.toml +++ b/ballerina/CompilerPlugin.toml @@ -3,4 +3,4 @@ id = "http-compiler-plugin" class = "io.ballerina.stdlib.http.compiler.HttpCompilerPlugin" [[dependency]] -path = "../compiler-plugin/build/libs/http-compiler-plugin-2.9.8.jar" +path = "../compiler-plugin/build/libs/http-compiler-plugin-2.9.9-SNAPSHOT.jar" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 04ba751939..7d4df485a5 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -50,7 +50,7 @@ modules = [ [[package]] org = "ballerina" name = "crypto" -version = "2.4.0" +version = "2.4.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -62,7 +62,7 @@ modules = [ [[package]] org = "ballerina" name = "file" -version = "1.8.0" +version = "1.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -76,7 +76,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.9.8" +version = "2.9.9" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -240,7 +240,7 @@ modules = [ [[package]] org = "ballerina" name = "log" -version = "2.8.0" +version = "2.8.1" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, From e416afbc017bd886259aad83632cae9e3a3bc5c1 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 08:58:12 +0530 Subject: [PATCH 6/7] Update workflow links --- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/process-load-test-result.yml | 2 +- .github/workflows/trigger-load-tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index a60cd84a83..6a516f2735 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -37,7 +37,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-standard-library/.github/workflows/build-with-bal-test-graalvm-template.yml@2201.7.x + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@2201.7.x with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/process-load-test-result.yml b/.github/workflows/process-load-test-result.yml index c1fcb50938..67a30482df 100644 --- a/.github/workflows/process-load-test-result.yml +++ b/.github/workflows/process-load-test-result.yml @@ -6,7 +6,7 @@ on: jobs: call_stdlib_process_load_test_results_workflow: name: Run StdLib Process Load Test Results Workflow - uses: ballerina-platform/ballerina-standard-library/.github/workflows/process-load-test-results-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/process-load-test-results-template.yml@main with: results: ${{ toJson(github.event.client_payload.results) }} secrets: diff --git a/.github/workflows/trigger-load-tests.yml b/.github/workflows/trigger-load-tests.yml index 4e9fb00bdc..66a910ca3d 100644 --- a/.github/workflows/trigger-load-tests.yml +++ b/.github/workflows/trigger-load-tests.yml @@ -22,7 +22,7 @@ jobs: call_stdlib_trigger_load_test_workflow: name: Run StdLib Load Test Workflow if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }} - uses: ballerina-platform/ballerina-standard-library/.github/workflows/trigger-load-tests-template.yml@main + uses: ballerina-platform/ballerina-library/.github/workflows/trigger-load-tests-template.yml@main with: repo_name: 'module-ballerina-http' runtime_artifacts_url: 'https://api.github.com/repos/ballerina-platform/module-ballerina-http/actions/artifacts' From 6a7754c04e405c0f849e2359299f6c98aa252df4 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 29 May 2024 09:50:26 +0530 Subject: [PATCH 7/7] Fix cache key generation with method --- .../tests/http_cache_config_annotation_test.bal | 6 +++--- ballerina/caching_http_cache.bal | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal index 54b925d9d2..e9afd1a256 100644 --- a/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal +++ b/ballerina-tests/http-advanced-tests/tests/http_cache_config_annotation_test.bal @@ -331,11 +331,11 @@ function testReturnStatusCodeResponsesWithAnnotation() returns error? { function testBasicCachingBehaviourWithExecute() returns error? { check checkBasicCachingBehaviourWithExecute("GET", 1); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("get", 2); + check checkBasicCachingBehaviourWithExecute("get", 1); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("HEAD", 3); + check checkBasicCachingBehaviourWithExecute("HEAD", 2); runtime:sleep(1); - check checkBasicCachingBehaviourWithExecute("head", 4); + check checkBasicCachingBehaviourWithExecute("head", 2); } function checkBasicCachingBehaviourWithExecute(string method, int hitCount) returns error? { diff --git a/ballerina/caching_http_cache.bal b/ballerina/caching_http_cache.bal index cf300ffb8b..be06fd6d38 100644 --- a/ballerina/caching_http_cache.bal +++ b/ballerina/caching_http_cache.bal @@ -194,5 +194,5 @@ isolated function weakValidatorEquals(string etag1, string etag2) returns boolea } isolated function getCacheKey(string httpMethod, string url) returns string { - return string `${httpMethod} ${url}`; + return string `${httpMethod.toUpperAscii()} ${url}`; }