From fd95ba3cf2f175ce810d9357133ad3fea12170e7 Mon Sep 17 00:00:00 2001 From: wuhuizuo Date: Mon, 3 Jul 2023 14:48:43 +0800 Subject: [PATCH] ci: add component management to `.codecov.yaml` and migrate flag manage (#9252) --- .codecov.yml | 59 +++++++++++++++++++++++++++++++++++++++------------- Makefile | 6 +++--- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 6b043e6c4ba..3980de30380 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -24,7 +24,7 @@ parsers: macro: no comment: - layout: "header, flags, diff" + layout: "header, components, flags, diff" behavior: default require_changes: no @@ -41,20 +41,49 @@ ignore: - "mock/.*" - "*_mock.go" -flags: - cdc: - carryforward: true - paths: - - "cdc/" - - "cmd/" - - "pkg/" +component_management: + default_rules: # default rules that will be inherited by all components + statuses: + - type: project # in this case every component that doens't have a status defined will have a project type one + target: auto + individual_components: + - component_id: component_cdc # this is an identifier that should not be changed + name: cdc # this is a display name, and can be changed freely + paths: + - cdc/** + - cmd/** + - pkg/** + - component_id: component_dm + name: dm + paths: + - dm/** + - component_id: component_engine + name: engine + paths: + - engine/** + # more components. - dm: +flag_management: + default_rules: # the rules that will be followed for any flag added, generally carryforward: true - paths: - - "dm/" + statuses: + - type: project + target: 60% + - type: patch + target: 60% - engine: - carryforward: true - paths: - - "engine/" + individual_flags: # exceptions to the default rules above, stated flag by flag + - name: cdc #fill in your own flag name + paths: + - cdc/** #fill in your own path. Note, accepts globs, not regexes + - cmd/** + - pkg/** + carryforward: true + - name: dm + paths: + - dm/** + carryforward: true + - name: engine + paths: + - engine/** + carryforward: true diff --git a/Makefile b/Makefile index 420e13435f2..47a0cb22870 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,7 @@ unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/gocov || { $(FAILPOINT_DISABLE); exit 1; } tools/bin/gocov convert "$(TEST_DIR)/cov.unit.out" | tools/bin/gocov-xml > cdc-coverage.xml $(FAILPOINT_DISABLE) - @bash <(curl -s https://codecov.io/bash) -F cdc -f $(TEST_DIR)/cov.unit.out -t $(TICDC_CODECOV_TOKEN) + @bash <(curl -s https://codecov.io/bash) -F unit,cdc -f $(TEST_DIR)/cov.unit.out -t $(TICDC_CODECOV_TOKEN) leak_test: check_failpoint_ctl $(FAILPOINT_ENABLE) @@ -417,7 +417,7 @@ dm_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/goc || { $(FAILPOINT_DISABLE); exit 1; } tools/bin/gocov convert "$(DM_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > dm-coverage.xml $(FAILPOINT_DISABLE) - @bash <(curl -s https://codecov.io/bash) -F dm -f $(DM_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN) + @bash <(curl -s https://codecov.io/bash) -F unit,dm -f $(DM_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN) dm_integration_test_build: check_failpoint_ctl $(FAILPOINT_ENABLE) @@ -579,7 +579,7 @@ engine_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin || { $(FAILPOINT_DISABLE); exit 1; } tools/bin/gocov convert "$(ENGINE_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > engine-coverage.xml $(FAILPOINT_DISABLE) - @bash <(curl -s https://codecov.io/bash) -F engine -f $(ENGINE_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN) + @bash <(curl -s https://codecov.io/bash) -F unit,engine -f $(ENGINE_TEST_DIR)/cov.unit_test.out -t $(TICDC_CODECOV_TOKEN) prepare_test_binaries: cd scripts && ./download-integration-test-binaries.sh master && cd ..