CI Report — presplit-4.1-patch (parent #35823357380) #136813
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI Report | |
| run-name: >- | |
| CI Report — | |
| ${{ github.event.workflow_run.pull_requests[0].number | |
| && format('PR #{0} ({1})', github.event.workflow_run.pull_requests[0].number, github.event.workflow_run.head_branch) | |
| || github.event.workflow_run.head_branch }} | |
| (parent #${{ github.event.workflow_run.id }}) | |
| on: | |
| workflow_run: | |
| workflows: ["CI PIPELINE", "CI PIPELINE - BRANCH"] | |
| types: | |
| - completed | |
| permissions: | |
| checks: write | |
| actions: write | |
| contents: write | |
| deployments: write | |
| discussions: write | |
| issues: write | |
| packages: write | |
| pages: write | |
| pull-requests: write | |
| repository-projects: write | |
| security-events: write | |
| statuses: write | |
| env: | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | |
| REPO: ${{ github.repository }} | |
| jobs: | |
| INFO: | |
| runs-on: [self-hosted, quick] | |
| if: > | |
| github.event.workflow_run.event == 'pull_request' && | |
| (github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure') | |
| outputs: | |
| PR_NUMBER: ${{ steps.pr_details.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ steps.pr_details.outputs.BASE_REF }} | |
| HEAD_REF: ${{ steps.pr_details.outputs.HEAD_REF }} | |
| PR_STATE: ${{ steps.pr_details.outputs.PR_STATE }} | |
| BUCKET_PREFIX: ${{ steps.bucket_info.outputs.bucket_prefix }} | |
| SKIP_COV: ${{ steps.pr_details.outputs.SKIP_COV }} | |
| steps: | |
| - name: Surface parent CI PIPELINE link | |
| env: | |
| PARENT_RUN_ID: ${{ github.event.workflow_run.id }} | |
| PARENT_RUN_URL: ${{ github.event.workflow_run.html_url }} | |
| HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }} | |
| HEAD_SHA: ${{ github.event.workflow_run.head_sha }} | |
| run: | | |
| { | |
| echo "## Parent CI PIPELINE run" | |
| echo "" | |
| printf '[Run #%s](%s) - branch `%s` @ `%s`\n' \ | |
| "$PARENT_RUN_ID" "$PARENT_RUN_URL" "$HEAD_BRANCH" "$HEAD_SHA" | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| - run: | | |
| sleep 10 | |
| - name: INFO | |
| id: bucket_info | |
| run: | | |
| bucket_prefix=`echo ${REPO%/*} | tr '[:upper:]' '[:lower:]'` | |
| echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT | |
| - name: Download workflow artifact - PR | |
| uses: dawidd6/action-download-artifact@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| run_id: ${{ github.event.workflow_run.id }} | |
| name: "pr_num" | |
| - name: Read the pr num file | |
| id: pr_num_reader | |
| uses: juliangruber/read-file-action@v1 | |
| with: | |
| path: ./pr_num.txt | |
| - name: PR DETAILS | |
| id: pr_details | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PR_NUMBER: ${{ steps.pr_num_reader.outputs.content }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| PR_NUMBER=`echo ${PR_NUMBER}` | |
| pr_info=`gh pr view ${PR_NUMBER} -R ${REPO} --json baseRefName,headRefName,state,title` | |
| base_ref=$(echo ${pr_info} | jq -r .baseRefName) | |
| head_ref=$(echo ${pr_info} | jq -r .headRefName) | |
| pr_state=$(echo ${pr_info} | jq -r .state) | |
| pr_title=$(echo ${pr_info} | jq -r .title) | |
| echo "BASE_REF=${base_ref}" >> $GITHUB_OUTPUT | |
| echo "HEAD_REF=${head_ref}" >> $GITHUB_OUTPUT | |
| echo "PR_STATE=${pr_state}" >> $GITHUB_OUTPUT | |
| echo "PR_NUMBER=${PR_NUMBER}" >> $GITHUB_OUTPUT | |
| if [[ "${pr_title}" == *"[UT]"* || "${pr_title}" == *"[Doc]"* ]]; then | |
| echo "SKIP_COV=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "SKIP_COV=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: INFO | |
| id: info | |
| run: | | |
| echo ${{ steps.pr_details.outputs.PR_NUMBER }} | |
| echo ${{ steps.pr_details.outputs.BASE_REF }} | |
| FE-REPORT: | |
| runs-on: [self-hosted, quick] | |
| needs: INFO | |
| if: needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ needs.INFO.outputs.BASE_REF }} | |
| bucket_prefix: ${{ needs.INFO.outputs.BUCKET_PREFIX }} | |
| SKIP_COV: ${{ needs.INFO.outputs.SKIP_COV }} | |
| # Scratch dir the FE UT tarball unpacks into. Deliberately NOT the repo's own `fe/`: | |
| # that is a tracked path, so it survives `git clean` and collides. Untracked, so the | |
| # CLEAN / Clean ENV steps clear it between runs. | |
| FE_UT_UNPACK_DIR: fe-ut-report | |
| outputs: | |
| FE_INCREMENTAL_RESULT: ${{ steps.fe_incremental_check.outputs.fe_incremental_check }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Download FE UT XML | |
| id: download-ut-xml | |
| run: | | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/UT-Report/${PR_NUMBER} | |
| size=$(ossutil64 --config-file ~/.ossutilconfig ls ${oss_path}/fe_ut_report.tar.gz | grep "Object Number is" | awk '{print $NF}') | |
| echo "size=${size}" >> $GITHUB_OUTPUT | |
| if [[ "$size" != "0" ]]; then | |
| # Unpack into a dedicated scratch dir, NOT the repo's own `fe/`. | |
| # | |
| # This used to be `mkdir fe && cd fe`, which broke on any runner whose workspace | |
| # still held a checkout: `fe` is a TRACKED directory, so it survives the | |
| # `git clean -ffdxq` in CLEAN / Clean ENV, mkdir failed, the `cd` was skipped, | |
| # and `set -e` did not abort (a non-final member of an && list is exempt). The | |
| # tarball -- whose root is fe-core/... -- then unpacked into the workspace ROOT, | |
| # so every consumer looked under fe/fe-core/... and found nothing: 0 surefire | |
| # XMLs parsed, then `cp: cannot stat .../fe/fe-core/target/jacoco.exec`. | |
| # | |
| # A scratch name cannot collide with a tracked path, and being untracked it is | |
| # cleared by `git clean -ffdxq` between runs -- so no stale jacoco.exec from a | |
| # previous PR can be silently reused. The tarball carries the whole fe/ tree | |
| # (sources included, see elastic-ut.sh: `cp -rf .../fe/* ${cov_dir}`), so this | |
| # job needs nothing from the workspace checkout. | |
| rm -rf ${FE_UT_UNPACK_DIR} && mkdir ${FE_UT_UNPACK_DIR} && cd ${FE_UT_UNPACK_DIR} | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path}/ . --recursive | |
| tar zxf fe_ut_report.tar.gz | |
| fi | |
| if [[ "${BASE_REF}" == "main" ]] && [[ "$size" == 0 || "${SKIP_COV}" == "true" ]]; then | |
| cd ${GITHUB_WORKSPACE} | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover /var/local/env/empty_cov_result --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type jacoco | |
| fi | |
| - name: Publish UT Report | |
| uses: mikepenz/action-junit-report@v4 | |
| id: publish_report | |
| if: steps.download-ut-xml.outputs.size != '0' | |
| env: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| check_name: "FE UT Report" | |
| detailed_summary: true | |
| fail_on_failure: true | |
| commit: ${{ github.event.workflow_run.head_sha }} | |
| report_paths: ./${{ env.FE_UT_UNPACK_DIR }}/fe-core/target/surefire-reports/*.xml | |
| - name: Merge FE Coverage | |
| id: merge_report | |
| if: steps.publish_report.outcome == 'success' && env.BASE_REF == 'main' && env.SKIP_COV != 'true' | |
| env: | |
| fe_path: ${{ github.workspace }}/${{ env.FE_UT_UNPACK_DIR }} | |
| run: | | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| if [[ -e ${fe_path}/test.exec || -e ${fe_path}/test_admit.exec ]]; then | |
| if [[ -e ${fe_path}/test.exec ]]; then | |
| file_str="${fe_path}/test.exec" | |
| fi | |
| if [[ -e ${fe_path}/test_admit.exec ]]; then | |
| file_str="${file_str} ${fe_path}/test_admit.exec" | |
| fi | |
| java -jar package/jacococli.jar merge \ | |
| ${fe_path}/fe-core/target/jacoco.exec ${file_str} \ | |
| --destfile ${fe_path}/merge.exec | |
| else | |
| cp ${fe_path}/fe-core/target/jacoco.exec ${fe_path}/merge.exec | |
| fi | |
| - name: Generate XML Report | |
| id: generate-xml-report | |
| env: | |
| package_path: ${{ github.workspace }}/ci-tool/package | |
| fe_path: ${{ github.workspace }}/${{ env.FE_UT_UNPACK_DIR }} | |
| fe_core_path: ${{ github.workspace }}/${{ env.FE_UT_UNPACK_DIR }}/fe-core | |
| if: steps.merge_report.outcome == 'success' | |
| run: | | |
| rm -rf result | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| cd ${fe_core_path}/target/classes; | |
| rm -rf org; | |
| cd com/starrocks && rm -rf thrift proto sql/parser builtins common/Version.class; | |
| cd ${{ github.workspace }}; | |
| java -jar $package_path/jacococli.jar report ${fe_path}/merge.exec --classfiles ${fe_core_path}/target/classes/ \ | |
| --html ./result --xml ${{ github.workspace }}/coverage.xml \ | |
| --sourcefiles ${fe_core_path}/src/main/java/ --encoding utf-8 --name fe-coverage | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/UT-Report/${PR_NUMBER}/ | |
| ossutil64 --config-file ~/.ossutilconfig cp coverage.xml ${oss_path} -f | |
| # Incremental Total Coverage | |
| - name: Publish Incremental Coverage Report - Total | |
| if: steps.generate-xml-report.outcome == 'success' | |
| id: fe_incremental_check | |
| env: | |
| fe_path: ${{ github.workspace }}/${{ env.FE_UT_UNPACK_DIR }} | |
| run: | | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| if [[ -e "${fe_path}/diff.txt" ]]; then | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover ${{ github.workspace }}/result/ --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type jacoco \ | |
| -d ${fe_path}/diff.txt -dt file | |
| echo "fe_incremental_check=SUCCESS" >> $GITHUB_OUTPUT | |
| else | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover ${{ github.workspace }}/result/ --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type jacoco | |
| echo "fe_incremental_check=FAILURE" >> $GITHUB_OUTPUT | |
| fi | |
| rm -rf coverchecker | |
| rm -rf ci-tools | |
| # total coverage | |
| - name: Coverage Report | |
| uses: codecov/codecov-action@v3 | |
| if: steps.generate-xml-report.outcome == 'success' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ${{ github.workspace }}/coverage.xml | |
| dry_run: false | |
| name: fe-total | |
| flags: fe-total | |
| fail_ci_if_error: false | |
| verbose: true | |
| override_pr: ${{ env.PR_NUMBER }} | |
| override_branch: ${{ env.BASE_REF }} | |
| override_commit: ${{ env.HEAD_SHA }} | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| # sonarcloud-fe-checker: | |
| SONAR_FE_CHECKER: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - FE-REPORT | |
| - INFO | |
| if: needs.FE-REPORT.outputs.FE_INCREMENTAL_RESULT == 'SUCCESS' && github.repository == 'StarRocks/starrocks' && needs.INFO.outputs.BASE_REF == 'main' | |
| name: FE Sonarcloud Check | |
| timeout-minutes: 60 | |
| env: | |
| CODE_PATH: ${{ github.workspace }} | |
| GH_TOKEN: ${{ github.token }} | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BRANCH: ${{ needs.INFO.outputs.BASE_REF }} | |
| HEAD_REF: ${{ needs.INFO.outputs.HEAD_REF }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| id: checkout_code | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout PR | |
| id: checkout_pr | |
| run: | | |
| git config --global user.name "wanpengfei-git"; | |
| git config --global user.email "wanpengfei91@163.com"; | |
| git checkout $BRANCH; | |
| git pull; | |
| BRANCH_NAME="${BRANCH}-${PR_NUMBER}"; | |
| git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME}; | |
| git checkout $BRANCH_NAME; | |
| git checkout -b merge_pr; | |
| git merge --squash --no-edit ${BRANCH} || (echo "Merge conflict, please check." && exit -1); | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| id: setup_java | |
| if: steps.checkout_pr.outcome == 'success' | |
| with: | |
| java-version: 21 | |
| distribution: "temurin" | |
| - name: Cache SonarCloud packages | |
| id: cache_sonarcloud_packages | |
| if: steps.setup_java.outcome == 'success' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Cache Maven packages | |
| id: cache_maven_packages | |
| if: steps.cache_sonarcloud_packages.outcome == 'success' | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-maven | |
| - name: Install Apache Thrift | |
| id: install_thrift | |
| if: steps.cache_maven_packages.outcome == 'success' | |
| run: | | |
| curl -fsSL --retry 3 --retry-delay 2 https://cdn-thirdparty.starrocks.com/thrift-binaries/latest/thrift.xz -o ./thrift.xz | |
| xz -d ./thrift.xz | |
| chmod +x ./thrift | |
| mv -f ./thrift /usr/local/bin/thrift | |
| - name: Analyze FE | |
| id: analyze_fe | |
| if: steps.install_thrift.outcome == 'success' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| thrift --version | |
| whereis thrift | |
| export STARROCKS_HOME=${{ github.workspace }} | |
| source env.sh | |
| mkdir -p thirdparty/installed/bin/ | |
| cd thirdparty/installed/bin/ && ln -s /usr/local/bin/thrift thrift | |
| cd ${{ github.workspace }}/fe | |
| export SONAR_SCANNER_OPTS="-Xms3072m -Xmx12288m" | |
| export MAVEN_OPTS="-Xms3072m -Xmx12288m" | |
| mvn -B -DskipTests verify org.sonarsource.scanner.maven:sonar-maven-plugin:4.0.0.4121:sonar \ | |
| -Dsonar.projectKey=StarRocks_starrocks -Dsonar.pullrequest.key=${{ env.PR_NUMBER }} \ | |
| -Dsonar.pullrequest.base=${{ env.BRANCH }} -Dsonar.pullrequest.branch=${{ env.HEAD_REF }} | |
| BE-REPORT: | |
| runs-on: [self-hosted, quick] | |
| needs: INFO | |
| if: needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.BASE_REF == 'main' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| REPO: ${{ github.repository }} | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ needs.INFO.outputs.BASE_REF }} | |
| bucket_prefix: ${{ needs.INFO.outputs.BUCKET_PREFIX }} | |
| SKIP_COV: ${{ needs.INFO.outputs.SKIP_COV }} | |
| # Scratch dir, deliberately not the tracked `be/`. See FE_UT_UNPACK_DIR. | |
| BE_UT_UNPACK_DIR: be-ut-report | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| # No checkout here on purpose: this job never reads repo source. Its | |
| # inputs are the OSS objects downloaded below (be_ut_coverage.xml / | |
| # base_version.txt / diff.txt), /var/lib/ci-tool and /var/local/env -- | |
| # exactly like FE-REPORT and JAVA-EXTENSION-REPORT, neither of which | |
| # checks anything out. The `fetch-depth: 0` clone that used to sit here | |
| # cost ~158s of pure fetch per run (1394 branches + 307 tags, no reuse | |
| # because CLEAN wipes the workspace first), and it checked out | |
| # origin/main rather than the PR head, so the tree was not even the code | |
| # under test. The only thing it really provided was a `be/` directory for | |
| # the download step to cd into; ${BE_UT_UNPACK_DIR} replaces that. | |
| - name: Download BE UT XML | |
| id: download-ut-xml | |
| run: | | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/UT-Report/${PR_NUMBER} | |
| be_ut_res_path=${oss_path}/flag/be_ut_res | |
| size=$(ossutil64 --config-file ~/.ossutilconfig ls ${be_ut_res_path} | grep "Object Number is" | awk '{print $NF}') | |
| echo "size=${size}" >> $GITHUB_OUTPUT | |
| if [[ "$size" != "0" && "$SKIP_COV" != "true" ]]; then | |
| ossutil64 --config-file ~/.ossutilconfig cp ${be_ut_res_path} . >/dev/null | |
| res=`cat be_ut_res` | |
| if [[ "$res" != "0" ]]; then | |
| echo "::error::BE UT failed!" | |
| exit 1 | |
| fi | |
| rm -rf ${BE_UT_UNPACK_DIR} && mkdir ${BE_UT_UNPACK_DIR} && cd ${BE_UT_UNPACK_DIR} | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path}/be_ut_coverage.xml . -f 1>/dev/null | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path}/base_version.txt . -f 1>/dev/null | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path}/diff.txt . -f 1>/dev/null | |
| echo "base_version=`cat base_version.txt`" >> $GITHUB_OUTPUT | |
| else | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover /var/local/env/be_empty_coverage.xml --github-token ${{ secrets.GITHUB_TOKEN }} --pr ${PR_NUMBER} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com -type cobertura --module BE | |
| fi | |
| - name: Merge BE Total Coverage | |
| id: merge | |
| if: > | |
| steps.download-ut-xml.outputs.size != '0' | |
| && steps.download-ut-xml.outcome == 'success' | |
| && env.SKIP_COV != 'true' | |
| && !contains(github.event.workflow_run.head_branch, '-sync-pr-') | |
| && !startsWith(github.event.workflow_run.head_branch, 'mergify/') | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| export ECI_ID=`./bin/create_eci.sh ${BASE_REF} ${REPO}` | |
| export TOTAL_COV_XML=/var/local/env/be_total_coverage_${PR_NUMBER}.xml | |
| export COV_LOG=/var/local/env/be_total_coverage_${PR_NUMBER}.log | |
| export RES_FILE=/var/local/env/be_total_coverage_res_${PR_NUMBER}.log | |
| echo ${ECI_ID} | |
| echo "ECI_ID=${ECI_ID}" >> $GITHUB_OUTPUT | |
| echo "COV_XML=${TOTAL_COV_XML}" >> $GITHUB_OUTPUT | |
| echo "COV_LOG=${COV_LOG}" >> $GITHUB_OUTPUT | |
| echo "RES_FILE=${RES_FILE}" >> $GITHUB_OUTPUT | |
| ./bin/gen_be_cov.sh ${REPO} ${BASE_REF} ${PR_NUMBER} ${HEAD_SHA} | |
| # Incremental Total Coverage | |
| # | |
| # The SKIP_COV guard is needed here too, not just on `merge`: SKIP_COV | |
| # also sends the download step above into its else branch, which | |
| # downloads nothing. Without it, a [UT]-titled PR that touched be/ (so | |
| # BE UT ran and size != 0) still reached this step, and the | |
| # `merge_outcome == skipped` fallback below read a be_ut_coverage.xml / | |
| # diff.txt that were never downloaded -- FileNotFoundException, and a | |
| # red BE-REPORT nobody sees, since this job's check run lands on the | |
| # default branch rather than the PR (workflow_run). See #77990 and run | |
| # 32167039568. That else branch has already published an empty-coverage | |
| # status by this point, so skipping here leaves no gap. | |
| - name: Publish Incremental Coverage Report - Total | |
| if: > | |
| always() | |
| && steps.download-ut-xml.outputs.size != '0' | |
| && steps.download-ut-xml.outcome == 'success' | |
| && env.SKIP_COV != 'true' | |
| && !contains(github.event.workflow_run.head_branch, '-sync-pr-') | |
| && !startsWith(github.event.workflow_run.head_branch, 'mergify/') | |
| env: | |
| be_path: ${{ github.workspace }}/${{ env.BE_UT_UNPACK_DIR }} | |
| merge_outcome: ${{ steps.merge.outcome }} | |
| total_xml: ${{ steps.merge.outputs.COV_XML }} | |
| run: | | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| # Fallback to raw BE UT coverage only when merge actually failed or was skipped. | |
| # Previous code keyed on repository name; now both repos run merge by default, | |
| # so the only signal is merge_outcome. | |
| if [[ "${merge_outcome}" == "failure" || "${merge_outcome}" == "skipped" ]]; then | |
| total_xml=${be_path}/be_ut_coverage.xml | |
| fi | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover ${total_xml} --github-token ${{ secrets.GITHUB_TOKEN }} --repo ${{ github.repository }} \ | |
| --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type cobertura --module BE \ | |
| -d ${be_path}/diff.txt -dt file | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| eci rm ${{ steps.merge.outputs.ECI_ID }} || true | |
| rm -rf ${{ steps.merge.outputs.COV_LOG }} ${{ steps.merge.outputs.COV_XML }} ${{ steps.merge.outputs.RES_FILE }} | |
| JAVA-EXTENSION-REPORT: | |
| runs-on: [self-hosted, quick] | |
| needs: INFO | |
| if: needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ needs.INFO.outputs.BASE_REF }} | |
| bucket_prefix: ${{ needs.INFO.outputs.BUCKET_PREFIX }} | |
| # Scratch dir, deliberately not the tracked `java-extensions/`. See FE_UT_UNPACK_DIR. | |
| JAVA_EXT_UT_UNPACK_DIR: java-extensions-ut-report | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Download Java Extension UT XML | |
| id: download-ut-xml | |
| run: | | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/UT-Report/${PR_NUMBER} | |
| size=$(ossutil64 --config-file ~/.ossutilconfig ls ${oss_path}/java_extension_ut_report.tar.gz | grep "Object Number is" | awk '{print $NF}') | |
| echo "size=${size}" >> $GITHUB_OUTPUT | |
| if [[ "$size" != "0" ]]; then | |
| # Same defect as the FE report above: `java-extensions` is a TRACKED repo | |
| # directory, so it survives `git clean`, mkdir fails, and the `cd` is silently | |
| # skipped. Unpack into a scratch dir that cannot collide with a tracked path. | |
| rm -rf ${JAVA_EXT_UT_UNPACK_DIR} && mkdir ${JAVA_EXT_UT_UNPACK_DIR} && cd ${JAVA_EXT_UT_UNPACK_DIR} | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path}/java_extension_ut_report.tar.gz . --recursive | |
| tar zxf java_extension_ut_report.tar.gz | |
| elif [[ "${BASE_REF}" == "main" ]]; then | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover /var/local/env/java_extension_empty_coverage --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type jacoco \ | |
| --module "Java-Extensions" | |
| fi | |
| - name: Publish UT Report | |
| uses: mikepenz/action-junit-report@v4 | |
| id: publish_report | |
| if: steps.download-ut-xml.outputs.size != '0' | |
| env: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| check_name: "Java Extensions UT Report" | |
| detailed_summary: true | |
| fail_on_failure: true | |
| commit: ${{ github.event.workflow_run.head_sha }} | |
| report_paths: ./${{ env.JAVA_EXT_UT_UNPACK_DIR }}/xml_dir/*.xml | |
| # Incremental Total Coverage | |
| - name: Publish Incremental Coverage Report - Total | |
| if: steps.publish_report.outcome == 'success' && env.BASE_REF == 'main' | |
| env: | |
| code_path: ${{ github.workspace }}/${{ env.JAVA_EXT_UT_UNPACK_DIR }} | |
| run: | | |
| rm -rf ./coverchecker && ln -s /var/local/env/coverchecker ./coverchecker && cd coverchecker && git pull | |
| export JAVA_HOME=/var/local/env/jdk1.8.0_202; | |
| export PATH=$JAVA_HOME/bin:$PATH; | |
| java -jar cover-checker-console/target/cover-checker-console-1.4.0-jar-with-dependencies.jar \ | |
| --cover ${code_path}/result/ --github-token ${{ secrets.GITHUB_TOKEN }} \ | |
| --repo ${{ github.repository }} --threshold 80 --github-url api.github.com --pr ${PR_NUMBER} -type jacoco \ | |
| -d ${code_path}/diff.txt -dt file --module "Java-Extensions" | |
| rm -rf coverchecker | |
| rm -rf ci-tools | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* | |
| SQL-Tester-REPORT: | |
| runs-on: [self-hosted, quick] | |
| needs: INFO | |
| if: needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.BASE_REF == 'main' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ needs.INFO.outputs.BASE_REF }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: INFO | |
| id: info | |
| run: | | |
| repo="${{ github.repository }}" | |
| bucket_prefix=`echo ${repo%/*} | tr '[:upper:]' '[:lower:]'` | |
| echo "bucket_prefix=${bucket_prefix}" >> $GITHUB_OUTPUT | |
| - name: Download SQL-Tester XML | |
| id: download-SQL-Tester-xml | |
| env: | |
| bucket_prefix: ${{ steps.info.outputs.bucket_prefix }} | |
| run: | | |
| mkdir sql-tester-result && cd sql-tester-result | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/SQL-Tester-XML/${PR_NUMBER}/ | |
| size=$(ossutil64 --config-file ~/.ossutilconfig ls ${oss_path} | grep "Object Number is" | awk '{print $NF}') | |
| echo "size=${size}" >> $GITHUB_OUTPUT | |
| if [[ "$size" != "0" ]]; then | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path} . --recursive | |
| else | |
| cp /var/local/env/sqltester_empty_coverage.xml . | |
| fi | |
| - name: Prepare Tools | |
| id: prepare-tools | |
| run: | | |
| mkdir -p .actions/nose-report-action | |
| cd .actions/nose-report-action | |
| git clone https://github.com/StarRocks/action-junit-report.git . | |
| - name: Publish SQL-Tester Report | |
| uses: ./.actions/nose-report-action | |
| if: steps.prepare-tools.outcome == 'success' | |
| with: | |
| check_name: "SQL-Tester Report" | |
| fail_on_failure: true | |
| detailed_summary: true | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit: ${{ env.HEAD_SHA }} | |
| report_paths: "sql-tester-result/*.xml" | |
| Admit-REPORT: | |
| runs-on: [self-hosted, quick] | |
| needs: INFO | |
| if: needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.BASE_REF == 'main' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| BASE_REF: ${{ needs.INFO.outputs.BASE_REF }} | |
| bucket_prefix: ${{ needs.INFO.outputs.bucket_prefix }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: Download Admit XML | |
| id: download-admit-xml | |
| run: | | |
| mkdir admit-result && cd admit-result | |
| oss_path=oss://${bucket_prefix}-ci-release/$BASE_REF/Release/pr/Admit-XML/${PR_NUMBER}/ | |
| size=$(ossutil64 --config-file ~/.ossutilconfig ls ${oss_path} | grep "Object Number is" | awk '{print $NF}') | |
| echo "size=${size}" >> $GITHUB_OUTPUT | |
| if [[ "$size" != "0" ]]; then | |
| ossutil64 --config-file ~/.ossutilconfig cp ${oss_path} . --recursive | |
| fi | |
| - name: Prepare Tools | |
| if: steps.download-admit-xml.outputs.size != '0' | |
| id: prepare-tools | |
| run: | | |
| mkdir -p .actions/nose-report-action | |
| cd .actions/nose-report-action | |
| git clone https://github.com/StarRocks/action-junit-report.git . | |
| - name: Publish Admit Report | |
| uses: ./.actions/nose-report-action | |
| if: steps.prepare-tools.outcome == 'success' | |
| with: | |
| check_name: "Admit Report" | |
| fail_on_failure: true | |
| detailed_summary: true | |
| commit: ${{ env.HEAD_SHA }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| report_paths: "admit-result/*.xml" | |
| NOTIFICATION: | |
| runs-on: [self-hosted, quick] | |
| needs: | |
| [ | |
| INFO, | |
| FE-REPORT, | |
| Admit-REPORT, | |
| BE-REPORT, | |
| SQL-Tester-REPORT, | |
| JAVA-EXTENSION-REPORT, | |
| ] | |
| if: always() && needs.INFO.outputs.PR_NUMBER != '' && needs.INFO.outputs.PR_STATE != 'MERGED' | |
| env: | |
| WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} | |
| FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }} | |
| FEISHU_APP_SECRET: ${{ secrets.FEISHU_APP_SECRET }} | |
| SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
| PR_NUMBER: ${{ needs.INFO.outputs.PR_NUMBER }} | |
| steps: | |
| - name: CLEAN | |
| run: | | |
| rm -rf ${{ github.workspace }} && mkdir -p ${{ github.workspace }} | |
| - name: NOTIFY | |
| run: | | |
| rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh | |
| ./bin/notify.sh | |
| - name: Clean ENV | |
| if: always() | |
| run: | | |
| rm -rf ${{ github.workspace }}/* |