From b20b200157344acb8b5fca88eb6afeb4bb11efc7 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 12 Mar 2025 15:53:59 +0800 Subject: [PATCH 01/19] ci: modify desc in taosd-ci-build.yml --- .github/workflows/taosd-ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/taosd-ci-build.yml b/.github/workflows/taosd-ci-build.yml index 2179200bb3..a9d429a95e 100644 --- a/.github/workflows/taosd-ci-build.yml +++ b/.github/workflows/taosd-ci-build.yml @@ -21,7 +21,7 @@ concurrency: jobs: build: - name: Build and test on ${{ matrix.os }} + name: Run on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: From e6a509a30979816d6bd38696c10383f8c1473516 Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 12 Mar 2025 16:04:25 +0800 Subject: [PATCH 02/19] ci: modify des --- .github/workflows/taosd-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/taosd-ci.yml b/.github/workflows/taosd-ci.yml index 31eda597ad..a14a32fedb 100644 --- a/.github/workflows/taosd-ci.yml +++ b/.github/workflows/taosd-ci.yml @@ -1,4 +1,4 @@ -name: TDengine CI Test +name: TDengine Test on: pull_request: From 467bb6d46da615600cda2cb24b83b3249063921d Mon Sep 17 00:00:00 2001 From: haoranchen Date: Wed, 12 Mar 2025 16:17:42 +0800 Subject: [PATCH 03/19] ci: add name for fetch parameters --- .github/workflows/taosd-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/taosd-ci.yml b/.github/workflows/taosd-ci.yml index a14a32fedb..d11b363679 100644 --- a/.github/workflows/taosd-ci.yml +++ b/.github/workflows/taosd-ci.yml @@ -19,6 +19,7 @@ env: jobs: fetch-parameters: + name: Prepare Test runs-on: group: CI labels: [self-hosted, Linux, X64, testing] From 794587cbccbcf58dcf4888812e13de2a2c7bba39 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 17:32:29 +0800 Subject: [PATCH 04/19] ci: renamed test workflows yaml to workflows --- .github/workflows/{taosd-ci-build.yml => tdengine-build.yml} | 0 .github/workflows/{taosd-ci.yml => tdengine-ci-test.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{taosd-ci-build.yml => tdengine-build.yml} (100%) rename .github/workflows/{taosd-ci.yml => tdengine-ci-test.yml} (100%) diff --git a/.github/workflows/taosd-ci-build.yml b/.github/workflows/tdengine-build.yml similarity index 100% rename from .github/workflows/taosd-ci-build.yml rename to .github/workflows/tdengine-build.yml diff --git a/.github/workflows/taosd-ci.yml b/.github/workflows/tdengine-ci-test.yml similarity index 100% rename from .github/workflows/taosd-ci.yml rename to .github/workflows/tdengine-ci-test.yml From 47344da61982480d3e645af302fbd5b3b98ad847 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 18:39:25 +0800 Subject: [PATCH 05/19] ci: disable fail-fast in tdengine-build workflow --- .github/workflows/tdengine-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tdengine-build.yml b/.github/workflows/tdengine-build.yml index a9d429a95e..1e89a51c04 100644 --- a/.github/workflows/tdengine-build.yml +++ b/.github/workflows/tdengine-build.yml @@ -24,6 +24,7 @@ jobs: name: Run on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: - ubuntu-20.04 From 055154173b15e9d70f95f0262df17232ff27f274 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 18:47:58 +0800 Subject: [PATCH 06/19] ci: add workflow to cancel ongoing runs on pull request merge --- .github/workflows/cancel-workflow-on-merge.yml | 15 +++++++++++++++ .github/workflows/tdengine-ci-test.yml | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cancel-workflow-on-merge.yml diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml new file mode 100644 index 0000000000..4cd915b526 --- /dev/null +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -0,0 +1,15 @@ +name: Cancel Workflow on Merge + +on: + pull_request: + types: [closed] + +jobs: + cancel-workflow: + runs-on: ubuntu-latest + steps: + - name: Cancel Workflow if Merged + if: ${{ github.event.pull_request.merged }} + run: | + echo "PR has been merged, cancelling workflow..." + gh run cancel --repo ${{ github.repository }} --workflow "TDengine Test" --branch ${{ github.event.pull_request.base.ref }} \ No newline at end of file diff --git a/.github/workflows/tdengine-ci-test.yml b/.github/workflows/tdengine-ci-test.yml index d11b363679..6ce0c4cef4 100644 --- a/.github/workflows/tdengine-ci-test.yml +++ b/.github/workflows/tdengine-ci-test.yml @@ -11,7 +11,7 @@ on: - 'docs/**' concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-TDengine + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} cancel-in-progress: true env: @@ -91,4 +91,4 @@ jobs: needs: fetch-parameters if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} with: - tdinternal: false + tdinternal: false \ No newline at end of file From 9f69dce0cb3c59c190796397fc1cfd078cc36252 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 18:54:00 +0800 Subject: [PATCH 07/19] ci: add input parameters for specified source and target branches in tdengine-ci-test workflow --- .github/workflows/tdengine-ci-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tdengine-ci-test.yml b/.github/workflows/tdengine-ci-test.yml index 212ba691ff..e43955ab72 100644 --- a/.github/workflows/tdengine-ci-test.yml +++ b/.github/workflows/tdengine-ci-test.yml @@ -129,3 +129,6 @@ jobs: if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} with: tdinternal: false + specified_source_branch: ${{ github.event.inputs.specified_source_branch }} + specified_target_branch: ${{ github.event.inputs.specified_target_branch }} + specified_pr_number: ${{ github.event.inputs.specified_pr_number }} \ No newline at end of file From 6fb49512320cdc3fd45619332ead2c417283369f Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 19:08:20 +0800 Subject: [PATCH 08/19] fix: temp test --- utils/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt index 9872a9dc55..56c8248aff 100644 --- a/utils/CMakeLists.txt +++ b/utils/CMakeLists.txt @@ -5,4 +5,4 @@ ADD_SUBDIRECTORY(test/c) # ADD_SUBDIRECTORY(comparisonTest/tdengine) IF(NOT "${TSZ_ENABLED}" MATCHES "false") ADD_SUBDIRECTORY(TSZ) -ENDIF() \ No newline at end of file +ENDIF() From e00422751e179b6d3e27531fcba9ce44664e03cb Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 20:39:17 +0800 Subject: [PATCH 09/19] ci: simplify parameters in tdengine-ci-test workflow --- .github/workflows/tdengine-ci-test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tdengine-ci-test.yml b/.github/workflows/tdengine-ci-test.yml index 2f761b9501..43944a71c3 100644 --- a/.github/workflows/tdengine-ci-test.yml +++ b/.github/workflows/tdengine-ci-test.yml @@ -102,7 +102,4 @@ jobs: needs: fetch-parameters if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} with: - tdinternal: false - specified_source_branch: ${{ github.event.inputs.specified_source_branch }} - specified_target_branch: ${{ github.event.inputs.specified_target_branch }} - specified_pr_number: ${{ github.event.inputs.specified_pr_number }} + tdinternal: false \ No newline at end of file From a89460190750f6c801944cc4af15693a6232fd4d Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 20:46:05 +0800 Subject: [PATCH 10/19] ci: update concurrency group to use pull request number --- .github/workflows/tdengine-ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdengine-ci-test.yml b/.github/workflows/tdengine-ci-test.yml index 43944a71c3..08310c91ff 100644 --- a/.github/workflows/tdengine-ci-test.yml +++ b/.github/workflows/tdengine-ci-test.yml @@ -11,7 +11,7 @@ on: - 'docs/**' concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-TDengine + group: ${{ github.workflow }}-${{ github.event.pull_request.number }}-TDengine cancel-in-progress: true env: From 4adee83552901478e69f9afd7aac503406663c80 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Wed, 12 Mar 2025 20:58:05 +0800 Subject: [PATCH 11/19] ci: update workflow to cancel on pull request close in addition to merge --- .github/workflows/cancel-workflow-on-merge.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 4cd915b526..5d4a5000a2 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -1,4 +1,4 @@ -name: Cancel Workflow on Merge +name: Cancel Workflow on Merge or Close on: pull_request: @@ -8,8 +8,8 @@ jobs: cancel-workflow: runs-on: ubuntu-latest steps: - - name: Cancel Workflow if Merged - if: ${{ github.event.pull_request.merged }} + - name: Cancel Workflow if Merged or Closed + if: ${{ github.event.pull_request.merged || github.event.pull_request.state == 'closed' }} run: | - echo "PR has been merged, cancelling workflow..." - gh run cancel --repo ${{ github.repository }} --workflow "TDengine Test" --branch ${{ github.event.pull_request.base.ref }} \ No newline at end of file + echo "PR has been merged or closed, cancelling workflow..." + gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel {} \ No newline at end of file From ad7afcc437d73ee541b91cc1d4cd98b17f1d3ec1 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 13 Mar 2025 09:39:06 +0800 Subject: [PATCH 12/19] ci: enhance workflow to set up GitHub CLI and cancel on PR merge or close --- .github/workflows/cancel-workflow-on-merge.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 5d4a5000a2..0885fbfdd8 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -8,8 +8,15 @@ jobs: cancel-workflow: runs-on: ubuntu-latest steps: + - name: Set up GitHub CLI + run: | + echo "${{ secrets.GITHUB_TOKEN }}" > ~/.gh_token + gh auth login --with-token < ~/.gh_token + - name: Cancel Workflow if Merged or Closed if: ${{ github.event.pull_request.merged || github.event.pull_request.state == 'closed' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "PR has been merged or closed, cancelling workflow..." gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel {} \ No newline at end of file From cf3582b9641b8fa25e15339bc78fd3da039190cc Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 13 Mar 2025 09:53:16 +0800 Subject: [PATCH 13/19] ci: add GH_TOKEN environment variable for GitHub CLI authentication in workflow --- .github/workflows/cancel-workflow-on-merge.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 0885fbfdd8..68c87cf24d 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -9,6 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up GitHub CLI + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "${{ secrets.GITHUB_TOKEN }}" > ~/.gh_token gh auth login --with-token < ~/.gh_token @@ -19,4 +21,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "PR has been merged or closed, cancelling workflow..." - gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel {} \ No newline at end of file + gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From b721ebed76699cb4cdbeaf469c37eaa8994ceb25 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 13 Mar 2025 10:44:58 +0800 Subject: [PATCH 14/19] ci: streamline GitHub CLI authentication in cancel workflow --- .github/workflows/cancel-workflow-on-merge.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 68c87cf24d..5147a5b204 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -8,17 +8,11 @@ jobs: cancel-workflow: runs-on: ubuntu-latest steps: - - name: Set up GitHub CLI - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "${{ secrets.GITHUB_TOKEN }}" > ~/.gh_token - gh auth login --with-token < ~/.gh_token - - name: Cancel Workflow if Merged or Closed if: ${{ github.event.pull_request.merged || github.event.pull_request.state == 'closed' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "PR has been merged or closed, cancelling workflow..." + gh auth login --with-token $GH_TOKEN gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From 86f4f6571de27fb78a79875ee3dd7b5069baacf6 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 13 Mar 2025 11:00:57 +0800 Subject: [PATCH 15/19] ci: update authentication method in cancel workflow to check status --- .github/workflows/cancel-workflow-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 5147a5b204..235ac2e7b1 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -14,5 +14,5 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | echo "PR has been merged or closed, cancelling workflow..." - gh auth login --with-token $GH_TOKEN + gh auth status gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From 8c8b013565ff06f0d545d34340fc63f701d571ac Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Thu, 13 Mar 2025 11:11:37 +0800 Subject: [PATCH 16/19] ci: update cancel workflow to include queued status in run cancellation --- .github/workflows/cancel-workflow-on-merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 235ac2e7b1..44b3abdd49 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -15,4 +15,4 @@ jobs: run: | echo "PR has been merged or closed, cancelling workflow..." gh auth status - gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file + gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --status queued --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From ab8e2b7590091df93c0fbe38b34dafdd2fec83c7 Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Thu, 13 Mar 2025 17:29:13 +0800 Subject: [PATCH 17/19] refactor: break long line into multiple lines for readability Signed-off-by: WANG Xu --- .github/workflows/cancel-workflow-on-merge.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 44b3abdd49..e9a0403fa3 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -1,4 +1,5 @@ name: Cancel Workflow on Merge or Close +description: Cancels the workflow if the PR is merged or closed to avoid unnecessary runs. on: pull_request: @@ -15,4 +16,11 @@ jobs: run: | echo "PR has been merged or closed, cancelling workflow..." gh auth status - gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --status queued --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file + gh run list \ + --repo ${{ github.repository }} \ + --branch ${{ github.event.pull_request.head.ref }} \ + --workflow "TDengine Test" \ + --status in_progress \ + --status queued + --json databaseId --jq '.[].databaseId' | \ + xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From 1ccaa8048434f28306ce15864801a6e9e00c6337 Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Thu, 13 Mar 2025 17:29:13 +0800 Subject: [PATCH 18/19] refactor: break long line into multiple lines for readability Signed-off-by: WANG Xu --- .github/workflows/cancel-workflow-on-merge.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 44b3abdd49..5c45dbc6fe 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -15,4 +15,11 @@ jobs: run: | echo "PR has been merged or closed, cancelling workflow..." gh auth status - gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --status queued --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file + gh run list \ + --repo ${{ github.repository }} \ + --branch ${{ github.event.pull_request.head.ref }} \ + --workflow "TDengine Test" \ + --status in_progress \ + --status queued \ + --json databaseId --jq '.[].databaseId' | \ + xargs -I {} gh run cancel --repo ${{ github.repository }} {} \ No newline at end of file From 98bed1c2a63a236c7c6b1d5ee9d96259eac3de2a Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Thu, 13 Mar 2025 19:44:17 +0800 Subject: [PATCH 19/19] fix: remove invalid description Signed-off-by: WANG Xu --- .github/workflows/cancel-workflow-on-merge.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 38a18ec87f..5c45dbc6fe 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -1,5 +1,4 @@ name: Cancel Workflow on Merge or Close -description: Cancels the workflow if the PR is merged or closed to avoid unnecessary runs. on: pull_request: