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

Merge Service based implementation to master #538

Merged
merged 76 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
4b80b6a
Bump update 1 rc version
xlight05 May 23, 2022
e004a60
Add initial service based implementation
xlight05 Mar 28, 2022
78b6402
Merge pull request #477 from xlight05/af-svc
xlight05 Jul 21, 2022
46a2210
[Automated] Update the native jar versions
Thevakumar-Luheerathan Jul 21, 2022
a1e143e
Add support for HTTP response
Thevakumar-Luheerathan Aug 1, 2022
28a3622
Add tests for HTTP response support
Thevakumar-Luheerathan Aug 1, 2022
6374326
Modify based on review
Thevakumar-Luheerathan Aug 2, 2022
40dfc92
Merge pull request #489 from Thevakumar-Luheerathan/svc-impl-http-res
xlight05 Aug 3, 2022
240ba33
Add blob implementation
xlight05 Jul 26, 2022
fbb5d21
Add azure local dev env implementation
xlight05 Aug 1, 2022
20177c8
Improve function name generation
xlight05 Aug 3, 2022
90e0130
Add http service route literal support
xlight05 Aug 3, 2022
b5df20c
Add default accessor support
xlight05 Aug 4, 2022
dbdc250
Merge pull request #492 from xlight05/blob-impl
xlight05 Aug 4, 2022
d6881f8
Implement HTTP Return implicit status codes and content types
Thevakumar-Luheerathan Aug 9, 2022
5be607f
Modify based on review
Thevakumar-Luheerathan Aug 10, 2022
052bbd7
Merge pull request #493 from Thevakumar-Luheerathan/svc-impl-issue491
xlight05 Aug 10, 2022
b59f63a
Add payload error handling
xlight05 Aug 8, 2022
c14ae42
Add base64 encoded http raw response
xlight05 Aug 12, 2022
72928c3
Fix blob datatypes
xlight05 Aug 15, 2022
dc3d184
Add query param support
xlight05 Aug 16, 2022
a9e5255
[Automated] Update the native jar versions
xlight05 Aug 18, 2022
9e180ec
[Automated] Update the native jar versions
xlight05 Aug 18, 2022
28f15ac
Add query types support
xlight05 Aug 18, 2022
2990de0
Merge pull request #495 from xlight05/error-handling
xlight05 Aug 18, 2022
70d60f7
Handle escape sequences
Thevakumar-Luheerathan Aug 25, 2022
ce3bf6d
Merge pull request #496 from Thevakumar-Luheerathan/escape-handling-i…
xlight05 Aug 29, 2022
22c0f83
[Automated] Update the native jar versions
xlight05 Aug 29, 2022
ccc21f8
[Automated] Update the native jar versions
xlight05 Aug 29, 2022
deb6678
Reuse http typed response records and annotations
xlight05 Aug 30, 2022
e2fa557
Remove Payload annotation usage from non http triggers
xlight05 Aug 31, 2022
1d02613
Merge pull request #499 from xlight05/test-svc1
xlight05 Sep 2, 2022
dcac226
Add runtime header annotation support
Thevakumar-Luheerathan Sep 13, 2022
7a802cb
Add code analyzer for header annotation
Thevakumar-Luheerathan Sep 13, 2022
af64a53
Add testcases for header annotation
Thevakumar-Luheerathan Sep 13, 2022
4298de2
Add compiler plugin test cases
Thevakumar-Luheerathan Sep 13, 2022
8b6c758
Remove old compiler plugin tests
Thevakumar-Luheerathan Sep 13, 2022
6eab2db
Modify based on review
Thevakumar-Luheerathan Sep 13, 2022
bba1e95
Merge pull request #507 from Thevakumar-Luheerathan/header-annotation…
xlight05 Sep 16, 2022
70e6c41
Fix bug for header annotation implementation
Thevakumar-Luheerathan Sep 16, 2022
82dfa22
Merge pull request #508 from Thevakumar-Luheerathan/header-annotation…
xlight05 Sep 21, 2022
33b6591
Add azure functions tooling artifact generation
xlight05 Oct 3, 2022
1eae531
Merge pull request #518 from xlight05/tooling-support
xlight05 Oct 3, 2022
f51147f
Improve Code Coverage of service based implementation
xlight05 Oct 3, 2022
17261bc
Fix optional payload annotation bug in compiler extensions
xlight05 Oct 4, 2022
260b857
Merge pull request #519 from xlight05/svc-improve-codecov
xlight05 Oct 4, 2022
3eb2c41
Add inline listener support
Thevakumar-Luheerathan Oct 4, 2022
4802947
Merge pull request #522 from Thevakumar-Luheerathan/handle-inline-lis…
xlight05 Oct 4, 2022
02a740e
Add code coverage for ballerina tests
Thevakumar-Luheerathan Oct 6, 2022
d76d16b
Change AzureFunction annotation to Function
xlight05 Oct 5, 2022
47c1891
Merge pull request #525 from Thevakumar-Luheerathan/bal-test-nat-code…
xlight05 Oct 7, 2022
71d19e3
Fix artifact generation when service path is empty
xlight05 Oct 10, 2022
e3125ef
Remove http prefix and migrate to runtime v4
xlight05 Oct 10, 2022
7812ace
Remove artifacts before generating while persisting existing local.se…
xlight05 Oct 10, 2022
eefec7a
Remove api/ prefix from tests
xlight05 Oct 10, 2022
4580f47
Fix tests
xlight05 Oct 10, 2022
f384081
Merge pull request #534 from xlight05/svc-fixes
xlight05 Oct 10, 2022
2905d95
[Automated] Update the native jar versions
xlight05 Oct 10, 2022
8c2c86e
[Automated] Update the native jar versions
xlight05 Oct 10, 2022
ce446a7
Add pre release
xlight05 Oct 10, 2022
d9fc249
[Automated] Update the native jar versions
xlight05 Oct 11, 2022
2adc661
[Automated] Update the native jar versions
xlight05 Oct 11, 2022
008a5d7
Bump dependencies to latest and related fixes
xlight05 Oct 11, 2022
44856cd
Address review suggestions
xlight05 Oct 11, 2022
0c93763
[Automated] Update the native jar versions
xlight05 Oct 11, 2022
dc02644
Add constraint lib to the pack
xlight05 Oct 11, 2022
92a2548
Merge pull request #536 from xlight05/dry-run
xlight05 Oct 11, 2022
3219eb0
Merge remote-tracking branch 'upstream/svc-impl'
xlight05 Oct 11, 2022
57ad32b
[Automated] Update the native jar versions
xlight05 Oct 11, 2022
f6ddca7
[Automated] Update the native jar versions
xlight05 Oct 11, 2022
07ffbe2
Refactor Code
xlight05 Oct 11, 2022
c3e3110
Fix code modifer prefix issue
xlight05 Oct 12, 2022
51fdd9d
Modify based on review
Thevakumar-Luheerathan Oct 13, 2022
c8db946
Merge pull request #2 from Thevakumar-Luheerathan/header-review
xlight05 Oct 13, 2022
22d98e0
[Automated] Update the native jar versions
xlight05 Oct 13, 2022
40f9acd
Address several review suggestions
xlight05 Oct 13, 2022
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
58 changes: 58 additions & 0 deletions .github/workflows/publish-pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish pre-release

on:
workflow_dispatch:

jobs:
publish-release:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 11
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config --global user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
./gradlew build -x check -x test
- name: Set version env variable
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties)" >> $GITHUB_ENV
- name: Pre release dependency version update
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
echo "Version: ${VERSION}"
git checkout -b release-${VERSION}
sed -i 's/ballerinaLangVersion=\(.*\)-SNAPSHOT/ballerinaLangVersion=\1/g' gradle.properties
sed -i 's/ballerinaLangVersion=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/ballerinaLangVersion=\1/g' gradle.properties
sed -i 's/stdlib\(.*\)=\(.*\)-SNAPSHOT/stdlib\1=\2/g' gradle.properties
sed -i 's/stdlib\(.*\)=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/stdlib\1=\2/g' gradle.properties
sed -i 's/observe\(.*\)=\(.*\)-SNAPSHOT/observe\1=\2/g' gradle.properties
sed -i 's/observe\(.*\)=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/observe\1=\2/g' gradle.properties
git add gradle.properties
git commit -m "Move dependencies to stable version" || echo "No changes to commit"
- name: Publish artifact
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
./gradlew clean release -Prelease.useAutomaticVersion=true
./gradlew -Pversion=${VERSION} publish -x test -PpublishToCentral=true
- name: GitHub Release and Release Sync PR
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
gh release create v$VERSION --title "module-ballerinax-azure.functions-v$VERSION"
gh pr create --title "[Automated] Sync master after $VERSION release" --body "Sync master after $VERSION release"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ target
.ballerina
.idea
*.iml

compiler-plugin-tests/src/test/resources/handlers/.vscode/
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import ballerinax/azure_functions as af;
// HTTP request/response with no authentication
@af:Function
public isolated function hello(@af:HTTPTrigger { authLevel: "anonymous" } string payload)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
return "Hello, " + payload + "!";
}

Expand All @@ -39,7 +39,7 @@ public isolated function hello(@af:HTTPTrigger { authLevel: "anonymous" } string
public isolated function fromHttpToQueue(af:Context ctx,
@af:HTTPTrigger af:HTTPRequest req,
@af:QueueOutput { queueName: "queue1" } af:StringOutputBinding msg)
returns @af:HTTPOutput af:HTTPBinding {
returns @af:HttpOutput af:HTTPBinding {
msg.value = req.body;
return { statusCode: 200, payload: "Request: " + req.toString() };
}
Expand Down Expand Up @@ -68,7 +68,7 @@ public isolated function fromBlobToQueue(af:Context ctx,
@af:Function
public isolated function httpTriggerBlobInput(@af:HTTPTrigger af:HTTPRequest req,
@af:BlobInput { path: "bpath1/{Query.name}" } byte[]? blobIn)
returns @af:HTTPOutput string {
returns @af:HttpOutput string {
int length = 0;
if blobIn is byte[] {
length = blobIn.length();
Expand All @@ -81,7 +81,7 @@ public isolated function httpTriggerBlobInput(@af:HTTPTrigger af:HTTPRequest req
@af:Function
public isolated function httpTriggerBlobOutput(@af:HTTPTrigger af:HTTPRequest req,
@af:BlobOutput { path: "bpath1/{Query.name}" } af:StringOutputBinding bb)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
bb.value = req.body;
return "Blob: " + req.query["name"].toString() + " Content: " +
bb?.value.toString();
Expand All @@ -91,7 +91,7 @@ public isolated function httpTriggerBlobOutput(@af:HTTPTrigger af:HTTPRequest re
@af:Function
public isolated function httpTriggerBlobOutput2(@af:HTTPTrigger af:HTTPRequest req,
@af:BlobOutput { path: "bpath1/{Query.name}" } af:BytesOutputBinding bb)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
bb.value = [65, 66, 67, 97, 98];
return "Blob: " + req.query["name"].toString() + " Content: " +
bb?.value.toString();
Expand All @@ -102,7 +102,7 @@ public isolated function httpTriggerBlobOutput2(@af:HTTPTrigger af:HTTPRequest r
public isolated function sendSMS(@af:HTTPTrigger af:HTTPRequest req,
@af:TwilioSmsOutput { fromNumber: "+12069845840" }
af:TwilioSmsOutputBinding tb)
returns @af:HTTPOutput string {
returns @af:HttpOutput string {
tb.to = req.query["to"].toString();
tb.body = req.body.toString();
return "Message - to: " + tb?.to.toString() + " body: " + tb?.body.toString();
Expand Down Expand Up @@ -138,7 +138,7 @@ public isolated function httpTriggerCosmosDBInput1(
@af:CosmosDBInput { connectionStringSetting: "CosmosDBConnection",
databaseName: "db1", collectionName: "c1",
id: "{Query.id}", partitionKey: "{Query.country}" } json dbReq)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
return dbReq.toString();
}

Expand All @@ -148,7 +148,7 @@ public isolated function httpTriggerCosmosDBInput2(
@af:CosmosDBInput { connectionStringSetting: "CosmosDBConnection",
databaseName: "db1", collectionName: "c1",
id: "{Query.id}", partitionKey: "{Query.country}" } Person? dbReq)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
return dbReq.toString();
}

Expand All @@ -159,14 +159,14 @@ public isolated function httpTriggerCosmosDBInput3(
databaseName: "db1", collectionName: "c1",
sqlQuery: "select * from c1 where c1.country = {country}" }
Person[] dbReq)
returns @af:HTTPOutput string|error {
returns @af:HttpOutput string|error {
return dbReq.toString();
}

// HTTP request to write records to CosmosDB
@af:Function
public isolated function httpTriggerCosmosDBOutput1(
@af:HTTPTrigger af:HTTPRequest httpReq, @af:HTTPOutput af:HTTPBinding hb)
@af:HTTPTrigger af:HTTPRequest httpReq, @af:HttpOutput af:HTTPBinding hb)
returns @af:CosmosDBOutput { connectionStringSetting: "CosmosDBConnection",
databaseName: "db1", collectionName: "c1" } json {
json entry = { id: uuid:createType1AsString(), name: "Saman", country: "Sri Lanka" };
Expand All @@ -177,7 +177,7 @@ public isolated function httpTriggerCosmosDBOutput1(
@af:Function
public isolated function httpTriggerCosmosDBOutput2(
@af:HTTPTrigger af:HTTPRequest httpReq,
@af:HTTPOutput af:HTTPBinding hb)
@af:HttpOutput af:HTTPBinding hb)
returns @af:CosmosDBOutput {
connectionStringSetting: "CosmosDBConnection",
databaseName: "db1", collectionName: "c1" } json {
Expand Down
7 changes: 6 additions & 1 deletion ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[package]
org = "ballerinax"
name = "azure_functions_tests"
version = "2.1.1"
version = "3.0.0-alpha.1"

[[dependency]]
org = "ballerinax"
name = "azure_functions"
version = "3.0.0-alpha.1"
4 changes: 2 additions & 2 deletions ballerina-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import org.apache.tools.ant.taskdefs.condition.Os
description = 'Ballerinax - Azure Functions Tests'

def packageName = "azure_functions"
def packageOrg = "ballerinax" //TODO change
def packageOrg = "ballerinax"
def moduleName = "tests"
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaTomlFilePlaceHolder = new File("${project.rootDir}/build-config/resources/BallerinaTest.toml")
def ballerinaTomlFile = new File("$project.projectDir/Ballerina.toml")
def ballerinaDist = "${project.rootDir}/target/ballerina-runtime"
def distributionBinPath = "${ballerinaDist}/bin"
def testCoverageParam = "--code-coverage --includes=*"
def testCoverageParam = "--test-report --code-coverage --coverage-format=xml --includes=io.ballerina.stdlib.azure.functions.*:ballerinax.azure_functions"

def stripBallerinaExtensionVersion(String extVersion) {
if (extVersion.matches(project.ext.timestampedVersionRegex)) {
Expand Down
187 changes: 0 additions & 187 deletions ballerina-tests/main.bal

This file was deleted.

Loading