pingcap / pingcap/tidb

RFC: reorganize packages layout for this repository

Open
#41,241 17 comments 7 reactions 0 assignees View on GitHub
type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

(Comments & suggestions are appreciated!)

## Motivation

As you might notice, the codebase of this repository is organized in a ‘flattened’ way: there are 40+ level-1 directories/packages, which, in my option, has the following cons:

(1) It looks tedious.
(2) Similar to (1), the hierarchical structure is not clear enough.

So, here I would like to propose the reorganization of the packages.

## The structure

As shown in the figure below, I would like to make the following changes:
* Move the package of Data Platform tools(`br` and `dumpling`) to `tools` directory.
* Move `tidb-server` package to `cmd` directory.
* Add `pkg` directory, which contains the packages for "TiDB kernel"(most of the level-1 directories today).

```
tidb
├── LICENSES
├── cmd
│ ├── tidb-server
| └── ...
├── build
├── docs
├── hooks
├── pkg
| ├── autoid_service
| ├── bindinfo
│ ├── config
│ ├── ddl
│ ├── distsql
│ ├── domain
│ ├── errno
│ ├── executor
│ ├── extension
│ ├── errno
│ ├── infoschema
│ ├── keyspace
│ ├── kv
│ ├── lock
│ ├── meta
│ ├── metrics
│ ├── owner
│ ├── meta
│ ├── parser
│ ├── planner
│ ├── plugin
│ ├── resourcemanager
│ ├── server
│ ├── session
│ ├── sessionctx
│ ├── sessiontxn
│ ├── statistics
│ ├── store
│ ├── table
│ ├── tablecodec
│ ├── telemetry
│ ├── testkit
│ ├── tidb-binlog
│ ├── ttl
│ ├── types
│ └── util
│ ├── ttl
| └── util
| ├── structure
| └── ...
├── tests
├── tools
│ ├── br
│ ├── check
│ └── dumpling
└── ...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.