Skip to content

Commit 655bb03

Browse files
authored
doc(pdms): add pdms design doc and rfc template (#6169)
1 parent d58cb44 commit 655bb03

File tree

7 files changed

+399
-1
lines changed

7 files changed

+399
-1
lines changed

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ overlaygen: bin/overlay-gen
8282
yamlgen: crd
8383
$(ROOT)/hack/yaml.sh
8484

85+
.PHONY: doc
86+
doc: bin/mdtoc
87+
find docs -name "*.md" | xargs $(MDTOC) --inplace --max-depth 5
88+
8589
.PHONY: crd
8690
crd: bin/controller-gen build/crd-modifier
8791
$(CONTROLLER_GEN) crd:generateEmbeddedObjectMeta=true output:crd:artifacts:config=$(ROOT)/manifests/crd paths=$(API_PATH)/...
@@ -102,7 +106,7 @@ gengo: bin/mockgen
102106
license: bin/license-eye
103107
$(LICENSE_EYE) -c .github/licenserc.yaml header fix
104108

105-
ALL_GEN = tidy codegen crd gengo overlaygen yamlgen
109+
ALL_GEN = tidy codegen crd gengo overlaygen yamlgen doc
106110
.PHONY: generate
107111
generate: $(ALL_GEN) license
108112

@@ -207,3 +211,8 @@ bin/license-eye:
207211
GINKGO = $(BIN_DIR)/ginkgo
208212
bin/ginkgo:
209213
$(ROOT)/hack/download.sh go_install $(GINKGO) github.com/onsi/ginkgo/v2/ginkgo
214+
215+
.PHONY: bin/mdtoc
216+
MDTOC = $(BIN_DIR)/mdtoc
217+
bin/mdtoc:
218+
$(ROOT)/hack/download.sh go_install $(MDTOC) sigs.k8s.io/mdtoc v1.1.0

docs/CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# TiDB Operator(v2) Development Guide
22

3+
<!-- toc -->
4+
- [Prerequisites](#prerequisites)
5+
- [Workflow](#workflow)
6+
- [Step 1: Fork TiDB Operator on GitHub](#step-1-fork-tidb-operator-on-github)
7+
- [Step 2: Clone fork to local machine](#step-2-clone-fork-to-local-machine)
8+
- [Step 3: Branch](#step-3-branch)
9+
- [Step 4: Develop](#step-4-develop)
10+
- [Edit the code](#edit-the-code)
11+
- [Genearate and check](#genearate-and-check)
12+
- [Start TiDB Operator locally and do manual tests](#start-tidb-operator-locally-and-do-manual-tests)
13+
- [Step 5: Keep your branch in sync](#step-5-keep-your-branch-in-sync)
14+
- [Step 6: Commit](#step-6-commit)
15+
- [Step 7: Push](#step-7-push)
16+
- [Step 8: Create a pull request](#step-8-create-a-pull-request)
17+
- [Step 9: Get a code review](#step-9-get-a-code-review)
18+
- [Developer Docs](#developer-docs)
19+
<!-- /toc -->
20+
321
## Prerequisites
422

523
Please install [Go 1.23.x](https://go.dev/doc/install). If you want to run TiDB Operator locally, please also install the latest version of [Docker](https://www.docker.com/get-started/).

docs/arch/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Architecture of the TiDB Operator(v2)
22

3+
<!-- toc -->
4+
- [Overview](#overview)
5+
- [Goals](#goals)
6+
- [Key changes](#key-changes)
7+
- [Arch](#arch)
8+
- [CRD](#crd)
9+
- [Cluster](#cluster)
10+
- [Component Group](#component-group)
11+
- [Instance](#instance)
12+
<!-- /toc -->
13+
314
## Overview
415

516
TiDB Operator is a software to manage multiple TiDB clusters in the Kubernetes platform. It's designed based on the [operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/).

docs/convention.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Conventions of TiDB Operator
22

3+
<!-- toc -->
4+
- [Code conventions](#code-conventions)
5+
- [Directory and file conventions](#directory-and-file-conventions)
6+
<!-- /toc -->
7+
38
Conventions are copied from [Kubernetes Conventions](https://www.kubernetes.dev/docs/guide/coding-convention), with some unused items removed.
49

510
## Code conventions

docs/rfcs/000000-template.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<!--
2+
This template is adapted from Kubernetes Enhancements KEP template https://github.com/kubernetes/enhancements/blob/master/keps/NNNN-kep-template/README.md
3+
-->
4+
5+
# CHANGEME: Title
6+
7+
<!-- toc -->
8+
- [Release Signoff Checklist](#release-signoff-checklist)
9+
- [Summary](#summary)
10+
- [Motivation](#motivation)
11+
- [Goals](#goals)
12+
- [Non-Goals](#non-goals)
13+
- [Proposal](#proposal)
14+
- [User Stories (Optional)](#user-stories-optional)
15+
- [Story 1](#story-1)
16+
- [Story 2](#story-2)
17+
- [Risks and Mitigations](#risks-and-mitigations)
18+
- [Design Details](#design-details)
19+
- [Test Plan](#test-plan)
20+
- [Feature Gate](#feature-gate)
21+
- [Drawbacks](#drawbacks)
22+
- [Alternatives](#alternatives)
23+
<!-- /toc -->
24+
25+
## Release Signoff Checklist
26+
27+
Items marked with (R) are required *prior to targeting to a release*.
28+
29+
- [ ] (R) This design doc has been discussed and approved
30+
- [ ] (R) Test plan is in place
31+
- [ ] (R) e2e tests in kind
32+
- [ ] (R) Graduation criteria is in place if required
33+
- [ ] (R) User-facing documentation has been created in [pingcap/docs-tidb-operator]
34+
35+
## Summary
36+
37+
<!--
38+
Summary of the design.
39+
40+
[kubernetes documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md
41+
-->
42+
43+
## Motivation
44+
45+
<!--
46+
This section is for explicitly listing the motivation, goals, and non-goals of
47+
this design.
48+
-->
49+
50+
### Goals
51+
52+
<!--
53+
List the specific goals of the design. What is it trying to achieve? How will we
54+
know that this has succeeded?
55+
-->
56+
57+
### Non-Goals
58+
59+
<!--
60+
What is out of scope for this design? Listing non-goals helps to focus discussion
61+
and make progress.
62+
-->
63+
64+
## Proposal
65+
66+
<!--
67+
This is where we get down to the specifics of what the proposal actually is.
68+
This should have enough detail that reviewers can understand exactly what
69+
you're proposing, but should not include things like API designs or
70+
implementation. What is the desired outcome and how do we measure success?.
71+
The "Design Details" section below is for the real
72+
nitty-gritty.
73+
-->
74+
75+
### User Stories (Optional)
76+
77+
<!--
78+
Detail the things that people will be able to do if this design is implemented.
79+
Include as much detail as possible so that people can understand the "how" of
80+
the system. The goal here is to make this feel real for users without getting
81+
bogged down.
82+
-->
83+
84+
#### Story 1
85+
86+
#### Story 2
87+
88+
### Risks and Mitigations
89+
90+
<!--
91+
What are the risks of this proposal, and how do we mitigate? Think broadly.
92+
-->
93+
94+
## Design Details
95+
96+
<!--
97+
This section should contain enough information that the specifics of your
98+
change are understandable. This may include API specs (though not always
99+
required) or even code snippets. If there's any ambiguity about HOW your
100+
proposal will be implemented, this is the place to discuss them.
101+
-->
102+
103+
### Test Plan
104+
105+
<!---
106+
Describe how the new functionality will be tested (unit tests, integration tests (if applicable), e2e tests)
107+
-->
108+
109+
### Feature Gate
110+
111+
<!---
112+
Name of feature gate
113+
-->
114+
115+
## Drawbacks
116+
117+
<!--
118+
Why should this design _not_ be implemented?
119+
-->
120+
121+
## Alternatives
122+
123+
<!--
124+
What other approaches did you consider, and why did you rule them out? These do
125+
not need to be as detailed as the proposal, but should include enough
126+
information to express the idea and why it was not acceptable.
127+
-->

0 commit comments

Comments
 (0)