Skip to content

Commit

Permalink
Merge pull request #92 from ballerina-platform/fix-main
Browse files Browse the repository at this point in the history
Update main branch with latest changes
  • Loading branch information
LakshanSS authored May 10, 2023
2 parents d06a7c1 + 041d0d4 commit 104c811
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
run: chmod +x gradlew
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev-stg-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: |
./gradlew build
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@2201.2.1
uses: ballerina-platform/ballerina-action/@2201.4.1
with:
args:
pack ./cosmosdb
Expand All @@ -41,7 +41,7 @@ jobs:

- name: Push to Staging
if: github.event.inputs.bal_central_environment == 'STAGE'
uses: ballerina-platform/ballerina-action/@2201.2.1
uses: ballerina-platform/ballerina-action/@2201.4.1
with:
args:
push
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Push to Dev
if: github.event.inputs.bal_central_environment == 'DEV'
uses: ballerina-platform/ballerina-action/@2201.2.1
uses: ballerina-platform/ballerina-action/@2201.4.1
with:
args:
push
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
run: |
./gradlew build
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@nightly
with:
args:
pack ./cosmosdb
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
./gradlew build
- name: Ballerina Build
uses: ballerina-platform/ballerina-action//@2201.2.1
uses: ballerina-platform/ballerina-action//@2201.4.1
with:
args:
pack ./cosmosdb
Expand All @@ -34,7 +34,7 @@ jobs:
MASTER_OR_RESOURCE_TOKEN: ${{ secrets.MASTER_OR_RESOURCE_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
- name: Ballerina Push
uses: ballerina-platform/ballerina-action//@2201.2.1
uses: ballerina-platform/ballerina-action//@2201.4.1
with:
args:
push
Expand Down
2 changes: 1 addition & 1 deletion cosmosdb-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ jar {
'io/netty/channel/group/**', 'io/netty/channel/local/**', 'io/netty/channel/embedded/**',
'io/netty/channel/oio/**', 'io/netty/channel/internal/**', 'io/netty/bootstrap/**', 'io/netty/util/**',
'io/netty/buffer/**', 'javax/activation/**', 'org/codehaus/stax2/**', 'org/HdrHistogram/**', 'com/ctc/wstx/**',
'org/slf4j/**'
'org/slf4j/**', 'io/netty/**', 'reactor/netty/**', 'io/micrometer/**'
}
}
48 changes: 42 additions & 6 deletions cosmosdb/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
distribution = "2201.3.0"
distribution = "2201.4.1"
org= "ballerinax"
name= "azure_cosmosdb"
version= "4.0.0"
version= "4.1.1"
authors = ["Ballerina"]
keywords = ["IT Operations/Databases", "Cost/Paid", "Vendor/Microsoft"]
icon = "icon.png"
Expand All @@ -13,17 +13,53 @@ license = ["Apache-2.0"]
observabilityIncluded=true

[[platform.java11.dependency]]
path = "../cosmosdb-native/build/libs/cosmosdb-native-4.0.0.jar"
path = "../cosmosdb-native/build/libs/cosmosdb-native-4.1.1.jar"
groupId = "io.ballerinax"
artifactId = "cosmosdb"
version = "4.0.0"
version = "4.1.1"

[[platform.java11.dependency]]
groupId = "io.netty"
artifactId = "netty-resolver-dns"
version = "4.1.77.Final"
version = "4.1.86.Final"

[[platform.java11.dependency]]
groupId = "io.netty"
artifactId = "netty-handler"
version = "4.1.77.Final"
version = "4.1.86.Final"

[[platform.java11.dependency]]
groupId = "io.netty"
artifactId = "netty-transport-native-unix-common"
version = "4.1.86.Final"

[[platform.java11.dependency]]
groupId = "io.projectreactor.netty"
artifactId = "reactor-netty-core"
version = "1.1.2"

[[platform.java11.dependency]]
groupId = "io.projectreactor.netty"
artifactId = "reactor-netty"
version = "1.1.2"

[[platform.java11.dependency]]
groupId = "io.projectreactor.netty"
artifactId = "reactor-netty-http"
version = "1.1.2"

[[platform.java11.dependency]]
groupId = "io.micrometer"
artifactId = "micrometer-observation"
version = "1.10.3"

[[platform.java11.dependency]]
groupId = "io.micrometer"
artifactId = "micrometer-core"
version = "1.10.3"

[[platform.java11.dependency]]
groupId = "io.micrometer"
artifactId = "micrometer-commons"
version = "1.10.3"

2 changes: 1 addition & 1 deletion cosmosdb/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `azure_cosmosdb` is a [Ballerina](https://ballerina.io/) connector for Azure
### Compatibility
| | Version |
|----------------------|-------------------------------|
| Ballerina Language | Ballerina Swan Lake 2201.3.0 |
| Ballerina Language | Ballerina Swan Lake 2201.4.1 |
| Cosmos DB (SQL)API | 2018-12-31 |

## Report issues
Expand Down
1 change: 0 additions & 1 deletion cosmosdb/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ function testGetDocumentList() returns error? {
stream<Person, error?> result = check azureCosmosClient->getDocumentList(databaseId, containerId,
valueOfPartitionKey);
check result.forEach(isolated function(Person queryResult) {
test:assertTrue(queryResult is Person);
test:assertEquals(1234, queryResult.AccountNumber);
});
}
Expand Down
1 change: 1 addition & 0 deletions cosmosdb/types.bal
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import ballerinax/'client.config;
@display {label: "Connection Config"}
public type ManagementClientConfig record {|
*config:ConnectionConfig;
# Excluded auth configurations (Provide primaryKey or ResourceToken instead)
never auth?;
# Base URL of the Azure Cosmos DB account
string baseUrl;
Expand Down
2 changes: 1 addition & 1 deletion cosmosdb/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ isolated function getTokenType(string token) returns string {
# + url - The Base URL given by the user from which we want to extract host
# + return - String representing the resource id
isolated function getHost(string url) returns string {
string replacedString = regex:replaceFirst(url, HTTPS_REGEX, EMPTY_STRING);
string replacedString = regex:replace(url, HTTPS_REGEX, EMPTY_STRING);
int? lastIndex = replacedString.lastIndexOf(FORWARD_SLASH);
if (lastIndex is int) {
replacedString = replacedString.substring(0, lastIndex);
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.caching=true
group=org.ballerinalang.azure_cosmosdb
version=4.0.0
ballerinaLangVersion=2201.3.0-rc1
azureCosmosVersion=4.21.1
version=4.1.1
ballerinaLangVersion=2201.4.1
azureCosmosVersion=4.43.0

0 comments on commit 104c811

Please sign in to comment.