Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Locks and Replace Clone Methods in Parser #2175

Merged
merged 14 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,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@2201.10.x
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@2201.10.x
with:
lang_tag: ${{ inputs.lang_tag }}
lang_version: ${{ inputs.lang_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@2201.10.x
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
2 changes: 1 addition & 1 deletion .github/workflows/process-load-test-result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-library/.github/workflows/process-load-test-results-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/process-load-test-results-template.yml@2201.10.x
with:
results: ${{ toJson(github.event.client_payload.results) }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@2201.10.x
secrets: inherit
with:
package-name: graphql
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@2201.10.x
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/trigger-load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-library/.github/workflows/trigger-load-tests-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/trigger-load-tests-template.yml@2201.10.x
with:
repo_name: 'module-ballerina-graphql'
runtime_artifacts_url: 'https://api.github.com/repos/ballerina-platform/module-ballerina-graphql/actions/artifacts'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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@2201.10.x
secrets: inherit
2 changes: 1 addition & 1 deletion ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "graphql_tests"
version = "1.13.2"
version = "1.13.3"

[build-options]
observabilityIncluded = true
18 changes: 9 additions & 9 deletions ballerina-tests/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.9.0"
[[package]]
org = "ballerina"
name = "auth"
version = "2.11.0"
version = "2.11.2"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -44,7 +44,7 @@ modules = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.0"
version = "2.7.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -67,7 +67,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.13.2"
version = "1.13.3"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -99,7 +99,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql_tests"
version = "1.13.2"
version = "1.13.3"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "file"},
Expand All @@ -123,7 +123,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.11.0"
version = "2.11.8"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -155,7 +155,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.0"
version = "1.6.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand All @@ -172,7 +172,7 @@ version = "0.0.0"
[[package]]
org = "ballerina"
name = "jwt"
version = "2.11.0"
version = "2.12.1"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
Expand Down Expand Up @@ -355,7 +355,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down Expand Up @@ -388,7 +388,7 @@ modules = [
[[package]]
org = "ballerina"
name = "websocket"
version = "2.11.0"
version = "2.11.2"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "constraint"},
Expand Down
10 changes: 5 additions & 5 deletions ballerina-tests/tests/02_request_validation.bal
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? {
check wsClient->writeMessage({"type": WS_SUBSCRIBE, id: "1", payload: payload});
string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" +
" 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand All @@ -186,7 +186,7 @@ isolated function testInvalidWebSocketRequestWithoutQuery() returns error? {
check wsClient->writeMessage({"type": WS_SUBSCRIBE, id: "1", payload: {}});
string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" +
" 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand All @@ -202,7 +202,7 @@ isolated function testInvalidVariableInWebSocketPayload() returns error? {
check sendSubscriptionMessage(wsClient, document, variables = variables);
string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" +
" 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand All @@ -216,7 +216,7 @@ isolated function testEmptyWebSocketPayload() returns error? {
check wsClient->writeMessage(payload);
string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" +
" 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand All @@ -229,5 +229,5 @@ isolated function testInvalidWebSocketPayload() returns error? {
check wsClient->writeMessage(payload);
string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the"
+ " 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}
8 changes: 4 additions & 4 deletions ballerina-tests/tests/36_subscriptions.bal
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ isolated function testInvalidMultipleConnectionInitMessages() returns error? {
check initiateGraphqlWsConnection(wsClient);
check sendConnectionInitMessage(wsClient);

string expectedErrorMsg = "Too many initialisation requests: Status code: 4429";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
string expectedErrorMsg = "Too many initialization requests: Status code: 4429";
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand All @@ -284,7 +284,7 @@ isolated function testUnauthorizedAccess() returns error? {
check sendSubscriptionMessage(wsClient, document);

string expectedErrorMsg = "Unauthorized: Status code: 4401";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand Down Expand Up @@ -402,7 +402,7 @@ isolated function testSubscriptionWithInvalidPayload() returns error? {

string expectedErrorMsg = "Invalid format: payload does not conform to the format required by the" +
" 'graphql-transport-ws' subprotocol: Status code: 1003";
validateConnectionClousureWithError(wsClient, expectedErrorMsg);
validateConnectionClosureWithError(wsClient, expectedErrorMsg);
}

@test:Config {
Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/tests/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ isolated function readMessageExcludingPingMessages(websocket:Client wsClient) re
message = check wsClient->readMessage();
if message == null {
continue;
}
}
if message.'type == WS_PING {
check sendPongMessage(wsClient);
continue;
Expand Down Expand Up @@ -169,7 +169,7 @@ isolated function validateCompleteMessage(websocket:Client wsClient, string id =
assertJsonValuesWithOrder(actualPayload, expectedPayload);
}

isolated function validateConnectionClousureWithError(websocket:Client wsClient, string expectedErrorMsg) {
isolated function validateConnectionClosureWithError(websocket:Client wsClient, string expectedErrorMsg) {
json|error response = readMessageExcludingPingMessages(wsClient);
if response is error {
test:assertEquals(response.message(), expectedErrorMsg);
Expand Down
10 changes: 5 additions & 5 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "graphql"
version = "1.13.2"
version = "1.13.3"
authors = ["Ballerina"]
export=["graphql", "graphql.subgraph", "graphql.dataloader"]
keywords = ["gql", "network", "query", "service"]
Expand All @@ -16,11 +16,11 @@ graalvmCompatible = true
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "graphql-native"
version = "1.13.2"
path = "../native/build/libs/graphql-native-1.13.2.jar"
version = "1.13.3"
path = "../native/build/libs/graphql-native-1.13.3-SNAPSHOT.jar"

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "graphql-commons"
version = "1.13.2"
path = "../commons/build/libs/graphql-commons-1.13.2.jar"
version = "1.13.3"
path = "../commons/build/libs/graphql-commons-1.13.3-SNAPSHOT.jar"
4 changes: 2 additions & 2 deletions ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id = "graphql-compiler-plugin"
class = "io.ballerina.stdlib.graphql.compiler.GraphqlCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/graphql-compiler-plugin-1.13.2.jar"
path = "../compiler-plugin/build/libs/graphql-compiler-plugin-1.13.3-SNAPSHOT.jar"

[[dependency]]
path = "../commons/build/libs/graphql-commons-1.13.2.jar"
path = "../commons/build/libs/graphql-commons-1.13.3-SNAPSHOT.jar"
16 changes: 8 additions & 8 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ distribution-version = "2201.9.0"
[[package]]
org = "ballerina"
name = "auth"
version = "2.11.0"
version = "2.11.2"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -47,7 +47,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.0"
version = "2.7.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -73,7 +73,7 @@ modules = [
[[package]]
org = "ballerina"
name = "graphql"
version = "1.13.2"
version = "1.13.3"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -106,7 +106,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.11.0"
version = "2.11.8"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -138,7 +138,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.0"
version = "1.6.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand All @@ -158,7 +158,7 @@ modules = [
[[package]]
org = "ballerina"
name = "jwt"
version = "2.11.0"
version = "2.12.1"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
Expand Down Expand Up @@ -357,7 +357,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down Expand Up @@ -390,7 +390,7 @@ modules = [
[[package]]
org = "ballerina"
name = "websocket"
version = "2.11.0"
version = "2.11.2"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "constraint"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina/auth_utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ballerina/oauth2;
// Uses for declarative auth design, where the authentication decision is taken by reading the auth annotations
// provided in service and the `Authorization` header of request.
isolated function authenticateService(ListenerAuthConfig[]? authConfigs, http:Request req) returns http:Response? {
if authConfigs is () {
if authConfigs == () {
return;
}
string|http:HeaderNotFoundError header = req.getHeader("Authorization");
Expand Down Expand Up @@ -62,7 +62,7 @@ isolated function tryAuthenticate(ListenerAuthConfig[] authConfig, string header
log:printDebug("Invalid configurations for 'Bearer' scheme.");
}
}
if authResult is () || authResult is http:Forbidden {
if authResult == () || authResult is http:Forbidden {
return authResult;
}
}
Expand Down
Loading
Loading