From fe6ef75ab44d4e48fa9434ec446b9d67957cafe3 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 16:56:35 +0800 Subject: [PATCH 1/8] try opt-in-mode --- ci/workflows/pull-request.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index d08740408141d..06b6d141924cb 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -57,6 +57,7 @@ steps: - label: "docslt" command: "ci/scripts/docslt.sh" key: "docslt" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-docslt") plugins: - docker-compose#v4.9.0: run: rw-build-env From 95e98627d2a6f9c819cdac586d6d5fa7e7b98407 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:12:17 +0800 Subject: [PATCH 2/8] add labels for all components --- ci/workflows/pull-request.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 06b6d141924cb..a1f4871bfebb3 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -19,6 +19,7 @@ steps: - label: "build" command: "ci/scripts/build.sh -p ci-dev" key: "build" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -30,6 +31,7 @@ steps: - label: "build other components" command: "ci/scripts/build-other.sh" key: "build-other" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-other") plugins: - seek-oss/aws-sm#v2.3.1: env: @@ -46,6 +48,7 @@ steps: - label: "build (deterministic simulation)" command: "ci/scripts/build-simulation.sh" key: "build-simulation" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-deterministic-simulation") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -68,6 +71,7 @@ steps: - label: "end-to-end test" command: "ci/scripts/e2e-test.sh -p ci-dev -m ci-3streaming-2serving-3fe" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-test") depends_on: - "build" - "build-other" @@ -83,6 +87,7 @@ steps: - label: "end-to-end test (parallel)" command: "ci/scripts/e2e-test-parallel.sh -p ci-dev" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-parallel-tests") depends_on: - "build" - "docslt" @@ -125,6 +130,7 @@ steps: - label: "end-to-end source test" command: "ci/scripts/e2e-source-test.sh -p ci-dev" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-source-tests") depends_on: - "build" - "build-other" @@ -139,6 +145,7 @@ steps: - label: "end-to-end sink test" command: "ci/scripts/e2e-sink-test.sh -p ci-dev" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-sink-tests") depends_on: - "build" - "build-other" @@ -249,6 +256,7 @@ steps: - label: "regress test" command: "ci/scripts/regress-test.sh -p ci-dev" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-regress-test") depends_on: "build" plugins: - docker-compose#v4.9.0: @@ -264,6 +272,7 @@ steps: # This ensures our `main-cron` workflow will be stable. - label: "unit test" command: "ci/scripts/pr-unit-test.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-unit-test") plugins: - ./ci/plugins/swapfile - seek-oss/aws-sm#v2.3.1: @@ -279,6 +288,7 @@ steps: - label: "check" command: "ci/scripts/check.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-check") plugins: - gencer/cache#v2.4.10: id: cache @@ -300,6 +310,7 @@ steps: - label: "unit test (deterministic simulation)" command: "ci/scripts/deterministic-unit-test.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-unit-test-deterministic-simulation") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -311,6 +322,7 @@ steps: - label: "integration test (deterministic simulation)" command: "TEST_NUM=5 ci/scripts/deterministic-it-test.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-integration-test-deterministic-simulation") depends_on: "build-simulation" plugins: - docker-compose#v4.9.0: @@ -322,6 +334,7 @@ steps: - label: "end-to-end test (deterministic simulation)" command: "TEST_NUM=16 ci/scripts/deterministic-e2e-test.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-test-deterministic-simulation") depends_on: "build-simulation" plugins: - seek-oss/aws-sm#v2.3.1: @@ -340,6 +353,7 @@ steps: - label: "recovery test (deterministic simulation)" command: "TEST_NUM=8 KILL_RATE=0.5 ci/scripts/deterministic-recovery-test.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-recovery-test-deterministic-simulation") depends_on: "build-simulation" plugins: # - seek-oss/aws-sm#v2.3.1: @@ -359,6 +373,7 @@ steps: - label: "misc check" command: "ci/scripts/misc-check.sh" + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-misc-check") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -495,6 +510,7 @@ steps: - label: "fuzz test" command: "ci/scripts/pr-fuzz-test.sh -p ci-dev" + if: build.pull_request.labels includes "ci/run-fuzz-test" depends_on: - "build" - "build-simulation" From 6ac3cacda4e6856149fa349879ee72c2a0654e6b Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:23:03 +0800 Subject: [PATCH 3/8] make sqlsmith tests label triggered --- ci/scripts/pr-fuzz-test.sh | 26 ++------------------------ ci/workflows/pull-request.yml | 1 + 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/ci/scripts/pr-fuzz-test.sh b/ci/scripts/pr-fuzz-test.sh index ad4b8270fb5dc..66923c4fb8a71 100755 --- a/ci/scripts/pr-fuzz-test.sh +++ b/ci/scripts/pr-fuzz-test.sh @@ -5,16 +5,6 @@ set -euo pipefail source ci/scripts/common.sh -set +e -# Set features, depending on our workflow -# If sqlsmith files are modified, we run tests with sqlsmith enabled. -MATCHES="ci/scripts/cron-fuzz-test.sh\ -\|ci/scripts/pr-fuzz-test.sh\ -\|ci/scripts/run-fuzz-test.sh\ -\|src/tests/sqlsmith" -NOT_MATCHES="\.md" -CHANGED=$(git diff --name-only origin/main | grep -v "$NOT_MATCHES" | grep "$MATCHES") -set -e # NOTE(kwannoel): Disabled because there's some breakage after #12485, # see https://github.com/risingwavelabs/risingwave/issues/12577. @@ -23,19 +13,7 @@ set -e export RUN_SQLSMITH_FRONTEND=0 export RUN_SQLSMITH=1 export SQLSMITH_COUNT=100 - -# Run e2e tests if changes to sqlsmith source files detected. -if [[ -n "$CHANGED" ]]; then - echo "--- Checking whether to run all sqlsmith tests" - echo "origin/main SHA: $(git rev-parse origin/main)" - echo "Changes to Sqlsmith source files detected:" - echo "$CHANGED" - export RUN_SQLSMITH=1 - export SQLSMITH_COUNT=100 - export TEST_NUM=32 - echo "Enabled Sqlsmith tests." -else - export RUN_SQLSMITH=0 -fi +export TEST_NUM=32 +echo "Enabled Sqlsmith tests." source ci/scripts/run-fuzz-test.sh diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index a1f4871bfebb3..8df443d45ceab 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -508,6 +508,7 @@ steps: timeout_in_minutes: 30 retry: *auto-retry + # FIXME(kwannoel): Let the github PR labeller label it, if sqlsmith source files has changes. - label: "fuzz test" command: "ci/scripts/pr-fuzz-test.sh -p ci-dev" if: build.pull_request.labels includes "ci/run-fuzz-test" From 54b96625f356f773b84a320bbc83816d85a6f917 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:28:47 +0800 Subject: [PATCH 4/8] fix typos --- ci/workflows/pull-request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 8df443d45ceab..41676a85075eb 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -48,7 +48,7 @@ steps: - label: "build (deterministic simulation)" command: "ci/scripts/build-simulation.sh" key: "build-simulation" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-deterministic-simulation") + if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-simulation") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -511,7 +511,7 @@ steps: # FIXME(kwannoel): Let the github PR labeller label it, if sqlsmith source files has changes. - label: "fuzz test" command: "ci/scripts/pr-fuzz-test.sh -p ci-dev" - if: build.pull_request.labels includes "ci/run-fuzz-test" + if: build.pull_request.labels includes "ci/run-sqlsmith-fuzzing-tests" depends_on: - "build" - "build-simulation" From 4060a9a6dc370d5b108db418c28e6f04dac646e9 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:48:03 +0800 Subject: [PATCH 5/8] rename ci/enable-pr-opt-in-mode to ci/skip-ci + ban skip-ci in non-draft PRs --- ci/workflows/pull-request.yml | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 41676a85075eb..96fc5f9a3fc0d 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -19,7 +19,7 @@ steps: - label: "build" command: "ci/scripts/build.sh -p ci-dev" key: "build" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-build") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -31,7 +31,7 @@ steps: - label: "build other components" command: "ci/scripts/build-other.sh" key: "build-other" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-other") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-build-other") plugins: - seek-oss/aws-sm#v2.3.1: env: @@ -48,7 +48,7 @@ steps: - label: "build (deterministic simulation)" command: "ci/scripts/build-simulation.sh" key: "build-simulation" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-build-simulation") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-build-simulation") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -60,7 +60,7 @@ steps: - label: "docslt" command: "ci/scripts/docslt.sh" key: "docslt" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-docslt") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-docslt") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -71,7 +71,7 @@ steps: - label: "end-to-end test" command: "ci/scripts/e2e-test.sh -p ci-dev -m ci-3streaming-2serving-3fe" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-test") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-e2e-test") depends_on: - "build" - "build-other" @@ -87,7 +87,7 @@ steps: - label: "end-to-end test (parallel)" command: "ci/scripts/e2e-test-parallel.sh -p ci-dev" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-parallel-tests") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-e2e-parallel-tests") depends_on: - "build" - "docslt" @@ -130,7 +130,7 @@ steps: - label: "end-to-end source test" command: "ci/scripts/e2e-source-test.sh -p ci-dev" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-source-tests") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-e2e-source-tests") depends_on: - "build" - "build-other" @@ -145,7 +145,7 @@ steps: - label: "end-to-end sink test" command: "ci/scripts/e2e-sink-test.sh -p ci-dev" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-sink-tests") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-e2e-sink-tests") depends_on: - "build" - "build-other" @@ -256,7 +256,7 @@ steps: - label: "regress test" command: "ci/scripts/regress-test.sh -p ci-dev" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-regress-test") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-regress-test") depends_on: "build" plugins: - docker-compose#v4.9.0: @@ -272,7 +272,7 @@ steps: # This ensures our `main-cron` workflow will be stable. - label: "unit test" command: "ci/scripts/pr-unit-test.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-unit-test") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-unit-test") plugins: - ./ci/plugins/swapfile - seek-oss/aws-sm#v2.3.1: @@ -288,7 +288,7 @@ steps: - label: "check" command: "ci/scripts/check.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-check") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-check") plugins: - gencer/cache#v2.4.10: id: cache @@ -310,7 +310,7 @@ steps: - label: "unit test (deterministic simulation)" command: "ci/scripts/deterministic-unit-test.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-unit-test-deterministic-simulation") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-unit-test-deterministic-simulation") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -322,7 +322,7 @@ steps: - label: "integration test (deterministic simulation)" command: "TEST_NUM=5 ci/scripts/deterministic-it-test.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-integration-test-deterministic-simulation") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-integration-test-deterministic-simulation") depends_on: "build-simulation" plugins: - docker-compose#v4.9.0: @@ -334,7 +334,7 @@ steps: - label: "end-to-end test (deterministic simulation)" command: "TEST_NUM=16 ci/scripts/deterministic-e2e-test.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-e2e-test-deterministic-simulation") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-e2e-test-deterministic-simulation") depends_on: "build-simulation" plugins: - seek-oss/aws-sm#v2.3.1: @@ -353,7 +353,7 @@ steps: - label: "recovery test (deterministic simulation)" command: "TEST_NUM=8 KILL_RATE=0.5 ci/scripts/deterministic-recovery-test.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-recovery-test-deterministic-simulation") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-recovery-test-deterministic-simulation") depends_on: "build-simulation" plugins: # - seek-oss/aws-sm#v2.3.1: @@ -373,7 +373,7 @@ steps: - label: "misc check" command: "ci/scripts/misc-check.sh" - if: (!build.pull_request.labels includes "ci/enable-pr-opt-in-mode" || build.pull_request.labels includes "ci/run-misc-check") + if: (!build.pull_request.labels includes "ci/skip-ci" || build.pull_request.labels includes "ci/run-misc-check") plugins: - docker-compose#v4.9.0: run: rw-build-env @@ -524,3 +524,9 @@ steps: - ./ci/plugins/upload-failure-logs timeout_in_minutes: 15 retry: *auto-retry + + - label: "enable ci/skip-ci only in draft PRs" + if: build.pull_request.labels includes "ci/skip-ci && !build.pull_request.draft + command: | + echo "ci/skip-ci is only usable for draft Pull Requests" + exit 1 \ No newline at end of file From d1034d152eebb653ca86386c8330569b949f6255 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:54:23 +0800 Subject: [PATCH 6/8] fix parse --- ci/workflows/pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 96fc5f9a3fc0d..49da651815177 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -527,6 +527,6 @@ steps: - label: "enable ci/skip-ci only in draft PRs" if: build.pull_request.labels includes "ci/skip-ci && !build.pull_request.draft - command: | - echo "ci/skip-ci is only usable for draft Pull Requests" - exit 1 \ No newline at end of file + commands: + - echo "ci/skip-ci is only usable for draft Pull Requests" + - exit 1 \ No newline at end of file From 0cce272620c429002792032ebaded74eb2767c62 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 17:56:17 +0800 Subject: [PATCH 7/8] fix quote --- ci/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index 49da651815177..da61daae72b14 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -526,7 +526,7 @@ steps: retry: *auto-retry - label: "enable ci/skip-ci only in draft PRs" - if: build.pull_request.labels includes "ci/skip-ci && !build.pull_request.draft + if: build.pull_request.labels includes "ci/skip-ci" && build.pull_request.labels includes "!build.pull_request.draft" commands: - echo "ci/skip-ci is only usable for draft Pull Requests" - exit 1 \ No newline at end of file From d7c45275b6ca41fefcbea30cdfbd7b4fdac39cdb Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Mon, 16 Oct 2023 19:07:39 +0800 Subject: [PATCH 8/8] fix --- ci/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/workflows/pull-request.yml b/ci/workflows/pull-request.yml index da61daae72b14..367aaee3730e0 100644 --- a/ci/workflows/pull-request.yml +++ b/ci/workflows/pull-request.yml @@ -526,7 +526,7 @@ steps: retry: *auto-retry - label: "enable ci/skip-ci only in draft PRs" - if: build.pull_request.labels includes "ci/skip-ci" && build.pull_request.labels includes "!build.pull_request.draft" + if: build.pull_request.labels includes "ci/skip-ci" && !build.pull_request.draft commands: - echo "ci/skip-ci is only usable for draft Pull Requests" - exit 1 \ No newline at end of file