From 6bccf2f754418fc78200935e5a9d16f6342ce4ac Mon Sep 17 00:00:00 2001 From: bhashinee Date: Fri, 24 Feb 2023 17:16:46 +0530 Subject: [PATCH 1/4] Add codecov token to pr build workflow and add workflow calls to load tests --- .../workflows/process-load-test-result.yml | 79 ++----------------- .github/workflows/pull-request.yml | 56 +++---------- .github/workflows/trigger-load-tests.yml | 70 +++++----------- 3 files changed, 41 insertions(+), 164 deletions(-) diff --git a/.github/workflows/process-load-test-result.yml b/.github/workflows/process-load-test-result.yml index c5efd752..05b8cee6 100644 --- a/.github/workflows/process-load-test-result.yml +++ b/.github/workflows/process-load-test-result.yml @@ -1,77 +1,14 @@ name: Process load test results - on: repository_dispatch: types: [tcp-load-test] jobs: - process-results: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - name: Process results - id: processResults - run: | - git config --global user.email "ballerina-bot@ballerina.org" - git config --global user.name "ballerina-bot" - git pull - git checkout -b "load-test-results" - echo '${{ toJson(github.event.client_payload.results) }}' | jq -c '.[]' | - while read -r result; do - status=$(echo "$result" | jq -r '.status') - test_scenario=$(echo "$result" | jq -r '.name') - if [[ $status == "success" ]] - then - echo $(echo "$result" | jq -r '.result') >> load-tests/$test_scenario/results/summary.csv - git add load-tests/$test_scenario/results/summary.csv - git commit -m "Update $test_scenario test results on $(date)" - printf "hasPassed=true" >> $GITHUB_OUTPUT - else - echo $test_scenario "test has failed with error rate" $(echo "$result" | jq -r '.errorRate') - printf "hasFailed=true" >> $GITHUB_OUTPUT - fi - done - env: - GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} - - name: Push results - if: ${{ steps.processResults.outputs.hasPassed }} - run: git push origin "load-test-results" - - name: Create pull request for new summary - id: createPR - if: ${{ steps.processResults.outputs.hasPassed }} - run: printf "prUrl=%s" $(gh pr create --title "[Automated] Update summary csv files" --body "Update summary csv files") >> $GITHUB_OUTPUT - env: - GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} - - name: Approve PR - if: ${{ steps.processResults.outputs.hasPassed }} - run: | - sleep 5 - gh pr review --approve ${{ steps.createPR.outputs.prUrl }} - env: - GITHUB_TOKEN: ${{ secrets.BALLERINA_REVIEWER_BOT_TOKEN }} - - name: Merge PR - if: ${{ steps.processResults.outputs.hasPassed }} - run: | - checkCount="0" - while [ "$checkCount" != "3" ] - do - sleep 20 - checkCount=$(gh pr status --jq '[.currentBranch .statusCheckRollup[] | select((.conclusion=="SUCCESS") and ((.name=="Build on Ubuntu") or (.name=="Build on Windows") or (.name=="codecov/project")))] | length' --json statusCheckRollup) - failedCount=$(gh pr status --jq '[.currentBranch .statusCheckRollup[] | select((.conclusion=="FAILURE") and ((.name=="Build on Ubuntu") or (.name=="Build on Windows") or (.name=="codecov/project")))]|length' --json statusCheckRollup) - if [[ "$failedCount" != "0" ]] - then - echo "PR Build has failed" - exit 1 - fi - done - sleep 20 - gh pr merge --merge --delete-branch - env: - GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} - - name: Fail workflow - if: ${{ steps.processResults.outputs.hasFailed }} - run: | - echo "One or more load tests have been failed" - echo '${{ toJson(github.event.client_payload.results) }}' - exit 1 + 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@master + with: + results: ${{ toJson(github.event.client_payload.results) }} + secrets: + ballerina_bot_token: ${{ secrets.BALLERINA_BOT_TOKEN }} + ballerina_reviewer_bot_token: ${{ secrets.BALLERINA_REVIEWER_BOT_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 129f3898..63108d86 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -8,7 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout Repository + uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v2 with: @@ -18,57 +19,26 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew build --scan --no-daemon - - name: Archive Error Log + run: ./gradlew build --scan + - name: Archive Code Coverage JSON uses: actions/upload-artifact@v2 - if: failure() with: - name: Ballerina Internal Log - path: tcp-ballerina/ballerina-internal.log - if-no-files-found: ignore - - name: Generate CodeCov Report Try 1 + name: Code Coverage JSON + path: tcp-ballerina/target/report/test_results.json + if-no-files-found: ignore + - name: Generate CodeCov Report if: github.event_name == 'pull_request' - id: uploadReport1 uses: codecov/codecov-action@v2 - continue-on-error: true with: - fail_ci_if_error: true - - name: Wait after upload failure - if: steps.uploadReport1.outcome == 'failure' - run: | - sleep 300s - - name: Generate CodeCov Report Try 2 - if: steps.uploadReport1.outcome == 'failure' - id: uploadReport2 - uses: codecov/codecov-action@v2 - continue-on-error: true - with: - fail_ci_if_error: true - - name: Wait after upload failure - if: steps.uploadReport2.outcome == 'failure' - run: | - sleep 300s - - name: Generate CodeCov Report Try 3 - if: steps.uploadReport2.outcome == 'failure' - id: uploadReport3 - uses: codecov/codecov-action@v2 - continue-on-error: true - with: - fail_ci_if_error: true - - name: Wait after upload failure - if: steps.uploadReport3.outcome == 'failure' - run: | - sleep 300s - - name: Generate CodeCov Report Try 4 - if: steps.uploadReport3.outcome == 'failure' - uses: codecov/codecov-action@v2 - + token: ${{ secrets.CODECOV_TOKEN }} + windows-build: name: Build on Windows runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - name: Checkout Repository + uses: actions/checkout@v2 - name: Set up JDK 11 uses: actions/setup-java@v2 with: @@ -78,4 +48,4 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} - run: ./gradlew.bat build --scan --no-daemon + run: ./gradlew.bat build --scan diff --git a/.github/workflows/trigger-load-tests.yml b/.github/workflows/trigger-load-tests.yml index 28bd6b79..52b3a3f0 100644 --- a/.github/workflows/trigger-load-tests.yml +++ b/.github/workflows/trigger-load-tests.yml @@ -1,64 +1,34 @@ -name: Trigger load tests +name: Trigger Load Tests on: workflow_dispatch: inputs: tests: description: > - List of test names - This needs to be filled only if you want to run a specific set of tests. Example: [“foo”, “bar”] + List of test names. This needs to be filled only if you want to run a specific set of tests. Example: foo,bar required: false clusterName: description: 'Cluster name' default: 'tcp-perf-cluster-test' required: false + branch: + description: 'Branch of the given repository' + default: '' + required: false schedule: - - cron: '30 2 * * *' + - cron: '0 0 * * *' jobs: - invokeLoadTests: - runs-on: ubuntu-latest - if: github.repository_owner == 'ballerina-platform' - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Process cluster name - id: processClusterName - run: | - clusterName="${{github.event.inputs.clusterName}}" - if [ "$clusterName" = "" ]; then - clusterName="tcp-perf-cluster-test" - fi - printf "clusterName=%s" $clusterName >> $GITHUB_OUTPUT - - name: Get latest ballerina runtime artifact - id: setRuntimeUrl - shell: bash - run: | - printf "runtimeUrl=%s" $(curl -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/ballerina-platform/module-ballerina-tcp/actions/artifacts | \ - jq '[.artifacts[] | select(.name=="ballerina-runtime" and .expired==false)]|max|.archive_download_url') >> $GITHUB_OUTPUT - - name: Format test names - id: formatTestNames - shell: bash - run: | - tests="${{github.event.inputs.tests}}" - if [ ! "$tests" = "" ]; then - testsInput=(${tests//,/ }) - testsCount=${#testsInput[@]} - testsOutput="" - for (( i=0; i<$testsCount; i++ )); - do - testsOutput+=\\'"'${testsInput[$i]}\\'"', - done - printf "testNames=%s" [${testsOutput:0:-1}] >> $GITHUB_OUTPUT - else - printf "testNames=%s" $tests >> $GITHUB_OUTPUT - fi - - name: Invoke standard library load test workflow - uses: benc-uk/workflow-dispatch@v1 - with: - workflow: Stdlib Workflow - repo: ballerina-platform/ballerina-performance-cloud - ref: refs/heads/main - token: ${{ secrets.BALLERINA_BOT_TOKEN }} - inputs: '{ "repo-name": "module-ballerina-tcp", "tests": "${{ steps.formatTestNames.outputs.testNames }}", "zipURL": ${{ steps.setRuntimeUrl.outputs.runtimeUrl}}, "clusterName": "${{ steps.processClusterName.outputs.clusterName }}", "dispatchType": "tcp-load-test" }' + 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@master + with: + repo_name: 'module-ballerina-tcp' + runtime_artifacts_url: 'https://api.github.com/repos/ballerina-platform/module-ballerina-tcp/actions/artifacts' + dispatch_type: 'tcp-load-test' + cluster_name: ${{ inputs.clusterName }} + tests: ${{ inputs.tests }} + branch: ${{ inputs.branch }} + secrets: + ballerina_bot_token: ${{ secrets.BALLERINA_BOT_TOKEN }} From 519d81b9b3b4bb849f3a1f1a2a42196ec2d32e93 Mon Sep 17 00:00:00 2001 From: bhashinee Date: Fri, 29 Mar 2024 12:24:13 +0530 Subject: [PATCH 2/4] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index cfadf09a..d4cc9e91 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -25,50 +25,50 @@ scope = "testOnly" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-handler" -version = "4.1.100.Final" -path = "./lib/netty-handler-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-handler-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-buffer" -version = "4.1.100.Final" -path = "./lib/netty-buffer-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-buffer-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-transport" -version = "4.1.100.Final" -path = "./lib/netty-transport-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-transport-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-common" -version = "4.1.100.Final" -path = "./lib/netty-common-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-common-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-resolver" -version = "4.1.100.Final" -path = "./lib/netty-resolver-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-resolver-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-codec" -version = "4.1.100.Final" -path = "./lib/netty-codec-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-codec-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-transport-native-unix-common" -version = "4.1.100.Final" -path = "./lib/netty-transport-native-unix-common-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-transport-native-unix-common-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "io.netty" artifactId = "netty-codec-socks" -version = "4.1.100.Final" -path = "./lib/netty-codec-socks-4.1.100.Final.jar" +version = "4.1.108.Final" +path = "./lib/netty-codec-socks-4.1.108.Final.jar" [[platform.java17.dependency]] groupId = "org.jboss.marshalling" From f8642872077d7b053324d6ff09335430b016f0f8 Mon Sep 17 00:00:00 2001 From: bhashinee Date: Fri, 29 Mar 2024 12:26:20 +0530 Subject: [PATCH 3/4] Update the Netty version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 4cd0756a..ce960b82 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ githubJohnrengelmanShadowVersion=8.1.1 checkstyleToolVersion=10.12.0 githubSpotbugsVersion=5.0.14 testngVersion=7.6.1 -nettyVersion=4.1.100.Final +nettyVersion=4.1.108.Final underCouchDownloadVersion=5.4.0 researchgateReleaseVersion=2.8.0 slf4jVersion=1.7.30 From 0a6bd75487b2db33946bd1e67a1beb2159a41645 Mon Sep 17 00:00:00 2001 From: bhashinee Date: Mon, 1 Apr 2024 10:20:59 +0530 Subject: [PATCH 4/4] Update the code owners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d1fa4741..9535c35e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,4 +4,4 @@ # See: https://help.github.com/articles/about-codeowners/ # These owners will be the default owners for everything in the repo. -* @shafreenAnfar @Bhashinee +* @shafreenAnfar @Bhashinee @MohamedSabthar