Skip to content

Commit

Permalink
Merge branch 'master' into support_cast_as_json
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaRise authored Nov 28, 2023
2 parents ffa2478 + ccbd1b5 commit 3b3e662
Show file tree
Hide file tree
Showing 932 changed files with 47,677 additions and 39,023 deletions.
26 changes: 15 additions & 11 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ component_management:
statuses:
- type: project # in this case every component that doens't have a status defined will have a project type one
target: auto
informational: true # resulting status will pass no matter what the coverage is or what other settings are specified.
individual_components:
- component_id: component_dumpling # this is an identifier that should not be changed
name: dumpling # this is a display name, and can be changed freely
Expand All @@ -64,8 +65,10 @@ flag_management:
statuses:
- type: project
target: auto
informational: true # resulting status will pass no matter what the coverage is or what other settings are specified.
- type: patch
target: 85%
target: auto
informational: true # resulting status will pass no matter what the coverage is or what other settings are specified.

ignore:
- "LICENSES"
Expand All @@ -76,15 +79,16 @@ ignore:
- "cmd/.*"
- "docs/.*"
- "vendor/.*"
- "ddl/failtest/.*"
- "ddl/testutil/.*"
- "executor/seqtest/.*"
- "metrics/.*"
- "expression/generator/.*"
- "pkg/ddl/failtest/.*"
- "pkg/ddl/testutil/.*"
- "pkg/executor/seqtest/.*"
- "pkg/metrics/.*"
- "pkg/expression/generator/.*"
- "br/pkg/mock/.*"
- "testkit/.*"
- "server/internal/testutil/.*"
- "statistics/handle/cache/internal/testutil/.*"
- "session/testutil.go"
- "store/mockstore/unistore/testutil.go"
- "pkg/testkit/.*"
- "pkg/server/internal/testutil/.*"
- "pkg/statistics/handle/cache/internal/testutil/.*"
- "pkg/session/testutil.go"
- "pkg/store/mockstore/unistore/testutil.go"
- "k8s.io/apimachinery/pkg/*"

6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PR Title Format:
Please create an issue first to describe the problem.
There MUST be one line starting with "Issue Number: " and
There MUST be one line starting with "Issue Number: " and
linking the relevant issues via the "close" or "ref".
For more info, check https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/contribute-code.html#referring-to-an-issue.
Expand All @@ -24,7 +24,7 @@ Issue Number: close #xxx

Problem Summary:

### What is changed and how it works?
### What changed and how does it work?

### Check List

Expand All @@ -35,7 +35,7 @@ Tests <!-- At least one of them must be included. -->
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test
> - [ ] I checked and no code files have been changed.
> <!-- Or your custom "No need to test" reasons -->
> <!-- Or your custom "No need to test" reasons -->
Side effects

Expand Down
3,673 changes: 1,806 additions & 1,867 deletions DEPS.bzl

Large diffs are not rendered by default.

35 changes: 18 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ bench-daily:
go test -tags intest github.com/pingcap/tidb/pkg/util/rowcodec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test -tags intest github.com/pingcap/tidb/pkg/util/codec -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test -tags intest github.com/pingcap/tidb/pkg/distsql -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test -tags intest github.com/pingcap/tidb/pkg/statistics -run TestBenchDaily -bench Ignore --outfile bench_daily.json
go test -tags intest github.com/pingcap/tidb/pkg/util/benchdaily -run TestBenchDaily -bench Ignore \
-date `git log -n1 --date=unix --pretty=format:%cd` \
-commit `git log -n1 --pretty=format:%h` \
Expand All @@ -312,16 +313,16 @@ br_web:
@cd br/web && npm install && npm run build

build_br:
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(BR_BIN) br/cmd/br/*.go
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(BR_BIN) ./br/cmd/br

build_lightning_for_web:
CGO_ENABLED=1 $(GOBUILD) -tags dev $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(LIGHTNING_BIN) br/cmd/tidb-lightning/main.go

build_lightning:
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(LIGHTNING_BIN) br/cmd/tidb-lightning/main.go
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(LIGHTNING_BIN) ./br/cmd/tidb-lightning

build_lightning-ctl:
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(LIGHTNING_CTL_BIN) br/cmd/tidb-lightning-ctl/main.go
CGO_ENABLED=1 $(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o $(LIGHTNING_CTL_BIN) ./br/cmd/tidb-lightning-ctl

build_for_br_integration_test:
@make failpoint-enable
Expand Down Expand Up @@ -533,89 +534,89 @@ bazel_golangcilinter:
-- run $$($(PACKAGE_DIRECTORIES)) --config ./.golangci.yaml

bazel_brietest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/brietest/...
./build/jenkins_collect_coverage.sh

bazel_pessimistictest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/pessimistictest/...
./build/jenkins_collect_coverage.sh

bazel_sessiontest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/sessiontest/...
./build/jenkins_collect_coverage.sh

bazel_statisticstest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/statisticstest/...
./build/jenkins_collect_coverage.sh

bazel_txntest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/txntest/...
./build/jenkins_collect_coverage.sh

bazel_addindextest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest/...
./build/jenkins_collect_coverage.sh

bazel_addindextest1: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest1/...
./build/jenkins_collect_coverage.sh

bazel_addindextest2: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest2/...
./build/jenkins_collect_coverage.sh

bazel_addindextest3: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest3/...
./build/jenkins_collect_coverage.sh

bazel_addindextest4: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/addindextest4/...
./build/jenkins_collect_coverage.sh

# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always
bazel_importintotest: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/importintotest/...
./build/jenkins_collect_coverage.sh

# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always
bazel_importintotest2: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/importintotest2/...
./build/jenkins_collect_coverage.sh

# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always
bazel_importintotest3: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/importintotest3/...
./build/jenkins_collect_coverage.sh

# on timeout, bazel won't print log sometimes, so we use --test_output=all to print log always
bazel_importintotest4: failpoint-enable bazel_ci_simple_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --instrumentation_filter=//pkg/...,//br/...,//dumpling/... --test_output=all --test_arg=-with-real-tikv --define gotags=deadlock,intest \
--@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //tests/realtikvtest/importintotest4/...
./build/jenkins_collect_coverage.sh
Expand Down
8 changes: 7 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH))):$(PWD)/tools/bin
export PATH := $(path_to_add):$(PATH)

GO := GO111MODULE=on go
GOBUILD := $(GO) build $(BUILD_FLAG) -tags codes
BUILD_FLAG := -tags codes
GOEXPERIMENT=
ifeq ("${ENABLE_FIPS}", "1")
BUILD_FLAG = -tags codes,boringcrypto
GOEXPERIMENT = GOEXPERIMENT=boringcrypto
endif
GOBUILD := $(GOEXPERIMENT) $(GO) build $(BUILD_FLAG)
GOBUILDCOVERAGE := GOPATH=$(GOPATH) cd tidb-server; $(GO) test -coverpkg="../..." -c .
GOTEST := $(GO) test -p $(P)
OVERALLS := GO111MODULE=on overalls
Expand Down
6 changes: 6 additions & 0 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Sort the member alphabetically.
aliases:
sig-critical-approvers-tidb-server:
- yudongusa
Expand Down Expand Up @@ -89,6 +90,11 @@ aliases:
- wjhuang2016
- ywqzzy
- zimulala
sig-approvers-parser: # approvers for `parser` module.
- bb7133
- BornChanger
- D3Hunter
- tangenta
sig-approvers-resourcemanager: # approvers for resourcemanager pkg
- Benjamin2037
- D3Hunter
Expand Down
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ versions.check(minimum_bazel_version = "6.0.0")

http_archive(
name = "io_bazel_rules_go",
sha256 = "eff2811014f8b26d91fadda335000cbfce145674368bcd732fbf782adb53a778",
strip_prefix = "rules_go-df20c987afcbbc721518c79f9c6489d87d73582c",
sha256 = "d6ab6b57e48c09523e93050f13698f708428cfd5e619252e369d377af6597707",
urls = [
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/archive/df20c987afcbbc721518c79f9c6489d87d73582c.zip",
"http://ats.apps.svc/bazelbuild/rules_go/archive/df20c987afcbbc721518c79f9c6489d87d73582c.zip",
"https://github.com/bazelbuild/rules_go/archive/df20c987afcbbc721518c79f9c6489d87d73582c.zip",
"http://bazel-cache.pingcap.net:8080/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip",
"http://ats.apps.svc/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.43.0/rules_go-v0.43.0.zip",
],
)

Expand Down
19 changes: 8 additions & 11 deletions pkg/executor/internal/testkit.go → br/cmd/br/fips.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package internal
//go:build boringcrypto
// +build boringcrypto

package main

import (
"fmt"
_ "crypto/tls/fipsonly"

"github.com/pingcap/tidb/pkg/testkit"
"github.com/pingcap/tidb/br/pkg/version/build"
)

// FillData fill data into table
func FillData(tk *testkit.TestKit, table string) {
tk.MustExec("use test")
tk.MustExec(fmt.Sprintf("create table %s(id int not null default 1, name varchar(255), PRIMARY KEY(id));", table))

// insert data
tk.MustExec(fmt.Sprintf("insert INTO %s VALUES (1, \"hello\");", table))
tk.MustExec(fmt.Sprintf("insert into %s values (2, \"hello\");", table))
func init() {
build.ReleaseVersion += "-fips"
}
28 changes: 28 additions & 0 deletions br/cmd/tidb-lightning-ctl/fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build boringcrypto
// +build boringcrypto

package main

import (
_ "crypto/tls/fipsonly"

"github.com/pingcap/tidb/br/pkg/version/build"
)

func init() {
build.ReleaseVersion += "-fips"
}
28 changes: 28 additions & 0 deletions br/cmd/tidb-lightning/fips.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build boringcrypto
// +build boringcrypto

package main

import (
_ "crypto/tls/fipsonly"

"github.com/pingcap/tidb/br/pkg/version/build"
)

func init() {
build.ReleaseVersion += "-fips"
}
1 change: 1 addition & 0 deletions br/pkg/aws/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ go_library(
"@com_github_aws_aws_sdk_go//aws",
"@com_github_aws_aws_sdk_go//aws/awserr",
"@com_github_aws_aws_sdk_go//aws/session",
"@com_github_aws_aws_sdk_go//service/cloudwatch",
"@com_github_aws_aws_sdk_go//service/ec2",
"@com_github_aws_aws_sdk_go//service/ec2/ec2iface",
"@com_github_pingcap_errors//:errors",
Expand Down
Loading

0 comments on commit 3b3e662

Please sign in to comment.