Open-Source Wikis

/

TiDB

/

How to contribute

/

Tooling

pingcap/tidb

Tooling

The repo combines make, Bazel, and a handful of script-driven tools. This page lists what's where.

Top-level entry points

Where What
Makefile, Makefile.common Default build/test/lint orchestration. Run make help for a documented target list.
WORKSPACE, MODULE.bazel, DEPS.bzl, BUILD.bazel Bazel build configuration.
.bazelrc, .bazelversion Bazel toolchain pins.
.golangci.yml golangci-lint config used by make check-static.
.pre-commit-config.yaml Optional pre-commit hooks.
tools/check/ Shell scripts and config for make check, make lint, make errdoc.
tools/dashboard-linter/ Lints the Grafana dashboards under pkg/metrics/grafana/.
tools/tazel/ Helper around Bazel/Gazelle for this repo.
tools/patch-go/ Patches applied to the Go toolchain for the build.
tools/gen-parquet/, tools/fake-oauth/, tools/check-bidi/ Test helpers and small utilities.

Generated code

The repo has several generated files. Don't hand-edit them.

File / dir Source / generator
pkg/parser/parser.go pkg/parser/parser.y (yacc), regenerated via make parser
pkg/parser/hintparser.go pkg/parser/hintparser.y
pkg/util/collate/ucadata/*_generated.go UCA collation tables; regenerated via go generate in the ucadata package
pkg/expression/builtin_*_vec_generated.go pkg/expression/generator/, run via go generate ./pkg/expression/...
pkg/lightning/mydump/*_generated.go go generate in the same package
errors.toml Regenerated by make errdoc (tools/check/check-errdoc.sh)
BUILD.bazel, **/*.bazel, **/*.bzl Regenerated by make bazel_prepare (Gazelle)

Common Make targets

Target Purpose
make Default — builds tidb-server
make server, make server_debug, make server_check, make server_coverage Server build variants
make build_br / build_lightning / build_dumpling / build_tools Companion CLIs
make parser Regenerate the parser
make gogenerate Run all go generate directives
make fmt Format Go code
make lint Run revive linter and Grafana dashboard linter
make check-static golangci-lint
make tidy go mod tidy
make errdoc Regenerate errors.toml
make ut / ut-long / race Run unit tests in various modes
make integrationtest Drive the integration test harness
make bazel_prepare Regenerate BUILD files
make bazel_test Full Bazel CI
make bazel_lint, make bazel_lint_changed CI linting (don't run locally without need)
make bazel_<area>test (e.g., bazel_addindextest1..4, bazel_importintotest1..4, bazel_pessimistictest, bazel_brietest, bazel_ddltest, …) Subsystem-specific Bazel test targets

The Makefile lists everything; make help prints the documented user-facing subset.

CI

  • .github/workflows/ holds GitHub Actions definitions (compatibility tests, mirroring, etc.).
  • The main test/lint pipeline runs on Prow (prow.tidb.net); the Build Status badge in the README points at it.
  • .codecov.yml configures coverage thresholds.
  • Jenkinsfile exists for legacy/internal pipelines.

Repo-local skills

The repository ships a .agents/skills/ directory of operational skills that contributors and agents are expected to follow:

  • .agents/skills/tidb-bazel-prepare-gate — when to run make bazel_prepare.
  • .agents/skills/tidb-failpoint-test-runner — failpoint enable/disable for unit tests.
  • .agents/skills/tidb-integrationtest-recorder — recording integration-test results.
  • .agents/skills/tidb-realtikv-runner — TiUP-playground lifecycle for realtikv tests.
  • .agents/skills/tidb-test-diff-triage — debugging unexpected test diffs.
  • .agents/skills/tidb-test-guidelines — placement, naming, sharding rules for tests.
  • .agents/skills/tidb-verify-profileWIP/Ready/Heavy validation profile selection.

These are listed in .agents/skills/README.md and indexed automatically when working from the repo root.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Tooling – TiDB wiki | Factory