Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pingcap/tidb-operator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.0-beta.0
Choose a base ref
...
head repository: pingcap/tidb-operator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 4,513 changed files with 475,231 additions and 1,080,296 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
23 changes: 23 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
codecov:
require_ci_to_pass: no
notify:
wait_for_ci: no

comment:
layout: "diff, flags"
show_carryforward_flags: true

coverage:
range: 30..70

flags:
unittest:
carryforward: false
e2e:
carryforward: false
discovery:
carryforward: true
controller-manager:
carryforward: true
scheduler:
carryforward: true
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "\U0001F41B Bug Report"
about: Something isn't working as expected

---

## Bug Report

**What version of Kubernetes are you using?**
<!-- You can run `kubectl version` -->

**What version of TiDB Operator are you using?**
<!-- You can run `kubectl exec -n tidb-admin {tidb-controller-manager-pod-name} -- tidb-controller-manager -V` -->

**What storage classes exist in the Kubernetes cluster and what are used for PD/TiKV pods?**
<!-- You can run `kubectl get sc` and `kubectl get pvc -n {tidb-cluster-namespace}` -->

**What's the status of the TiDB cluster pods?**
<!-- You can run `kubectl get po -n {tidb-cluster-namespace} -o wide` -->

**What did you do?**
<!-- If possible, provide a recipe for reproducing the error. How you installed tidb-operator and tidb-cluster. -->

**What did you expect to see?**

**What did you see instead?**
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "\U0001F680 Feature Request"
about: I have a suggestion

---

## Feature Request

**Is your feature request related to a problem? Please describe:**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the feature you'd like:**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered:**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Teachability, Documentation, Adoption, Migration Strategy:**
<!-- If you can, explain some scenarios how users might use this, situations it would be helpful in. Any API designs, mockups, or diagrams are also helpful. -->
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: "\U0001F914 Question"
about: Usage question that isn't answered in docs or discussion

---

## Question

Before asking a question, make sure you have:

- Reviewed relevant Kubernetes information: Google your error messages and look at K8s docs.
- Searched open and closed [GitHub issues](https://github.com/pingcap/tidb-operator/issues?utf8=%E2%9C%93&q=is%3Aissue)
- Read the documentation:
- [TiDB Operator Readme](https://github.com/pingcap/tidb-operator)
- [TiDB Operator Doc](https://github.com/pingcap/tidb-operator/tree/master/docs)
60 changes: 60 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<!--
Thank you for contributing to TiDB Operator!
Please complete the following template before creating a PR.
Ref: TiDB Operator [CONTRIBUTING](https://github.com/pingcap/tidb-operator/blob/master/CONTRIBUTING.md) document
-->

### What problem does this PR solve?
<!--
Please describe the problem AS DETAILED AS POSSIBLE.
Add an ISSUE LINK WITH SUMMARY if exists.
For example:
Fix the bug that syncing `Backup` CR will crash tidb-controller-manager pod when client TLS feature is enabled.
Closes #xxx (issue number)
-->

### What is changed and how does it work?
<!--
Please describe the design that your implementation follows AS DETAILED AS POSSIBLE.
For example:
The root cause is a nil pointer dereferencing. Add a `ptr != nil` check before access members of `ptr` to prevent the crash.
-->

### Code changes

- [ ] Has Go code change
- [ ] Has CI related scripts change

### Tests
<!-- AT LEAST ONE test must be included. -->

- [ ] Unit test <!-- If you added any unit test cases, check this box -->
- [ ] E2E test <!-- If you added any e2e test cases, check this box -->
- [ ] Manual test <!-- If this PR needs manual test, check this box, and add detailed manual test scripts or steps below, so that ANYONE CAN REPRODUCE IT. Ref: https://github.com/pingcap/tidb-operator/pull/3517 -->
- [ ] No code <!-- If this PR contains no code changes, check this box -->

### Side effects

- [ ] Breaking backward compatibility <!-- If this PR breaks things deployed with previous TiDB Operator versions, check this box -->
- [ ] Other side effects: <!-- Any other side effects, such as requiring additional storage / consumes substantial memory / potential reconciliation latency -->

### Related changes

- [ ] Need to cherry-pick to the release branch <!-- If this PR should also appear in the current release branch, check this box -->
- [ ] Need to update the documentation <!-- If this PR introduces new features or changes previous usages, check this box -->

### Release Notes
<!--
If no need to add a release note, just type `NONE` in the following `release-note` block.
If the PR requires additional action from users to deploy the new release, start the release note with "ACTION REQUIRED: ".
-->
Please refer to [Release Notes Language Style Guide](https://github.com/pingcap/tidb-operator/blob/master/docs/release-note-guide.md) before writing the release note.

```release-note
```
8 changes: 8 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"baseBranches": ["master", "feature\/v2"],
"extends": [
"config:recommended"
],
"postUpdateOptions": ["gomodTidy","gomodUpdateImportPaths"]
}
66 changes: 66 additions & 0 deletions .github/workflows/chaos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: chaos

on:
pull_request:
branches:
- master
- release-*

jobs:

pull:
runs-on: ubuntu-24.04
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go/src/github.com/${{ github.repository }}/go.mod
go-version: 1.21.3
- name: Set vars
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Try to use build cache
uses: actions/cache@v4
with:
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
key: ${{ runner.os }}-go-${{ hashFiles(format('go/src/github.com/{0}/**/go.sum', github.repository)) }}
restore-keys: |
${{ runner.os }}-go-
- name: Creating kind cluster
run: |
SKIP_BUILD=y SKIP_IMAGE_BUILD=y SKIP_DOWN=y SKIP_TEST=y KUBE_WORKERS=0 ./hack/e2e.sh
echo "info: waiting for all nodes to be ready"
kubectl wait --for=condition=Ready nodes --all --timeout=120s
echo "info: waiting for all pods in kube-system namespace to be ready"
kubectl -n kube-system wait --for=condition=Ready pods --all
echo "info: print cluster information"
kubectl get nodes
kubectl get pods -n kube-system
helm version
kubectl version
echo "info: create pingcap namespace for chaos configurations"
kubectl create ns pingcap
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}

- name: Run chaos mesh
uses: chaos-mesh/chaos-mesh-actions@master
env:
CFG_BASE64: YXBpVmVyc2lvbjogY2hhb3MtbWVzaC5vcmcvdjFhbHBoYTEKa2luZDogU2NoZWR1bGUKbWV0YWRhdGE6CiAgbmFtZTogcG9kLWZhaWx1cmUKICBuYW1lc3BhY2U6IHBpbmdjYXAKc3BlYzoKICBzY2hlZHVsZTogJ0BldmVyeSA1bScKICB0eXBlOiBQb2RDaGFvcwogIGhpc3RvcnlMaW1pdDogNQogIGNvbmN1cnJlbmN5UG9saWN5OiBGb3JiaWQKICBwb2RDaGFvczoKICAgIGFjdGlvbjogcG9kLWZhaWx1cmUKICAgIG1vZGU6IG9uZQogICAgZHVyYXRpb246IDYwcwogICAgc2VsZWN0b3I6CiAgICAgIGxhYmVsU2VsZWN0b3JzOgogICAgICAgIGFwcC5rdWJlcm5ldGVzLmlvL2NvbXBvbmVudDogY29udHJvbGxlci1tYW5hZ2VyCg==
CHAOS_MESH_VERSION: v2.1.0
- name: Run e2e
run: |
SKIP_UP=y ./hack/e2e.sh -- --ginkgo.focus='Restarter'
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}

- name: Set up tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
80 changes: 80 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: ci

on:
pull_request:
branches:
- master
- release-*
push:
branches:
- master
- release-*

jobs:

pull:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
job:
- verify
- build
- test
- e2e-examples
steps:
# the GITHUB_SHA env is not the real commit hash but is the pre-merge commit ID for `pull_request` event,
# see https://github.community/t/github-sha-isnt-the-value-expected/17903/2
# so we checkout the repo with `fetch-depth: 2` and let `codecov/codecov-action` to retrieve the real commit hash.
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
path: go/src/github.com/${{ github.repository }}
fetch-depth: 2
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go/src/github.com/${{ github.repository }}/go.mod
cache-dependency-path: "**/*.sum"
- name: Set vars
run: |
echo "GOCACHE=$(go env GOCACHE)" >> $GITHUB_ENV
echo "GOMODCACHE=$(go env GOMODCACHE)" >> $GITHUB_ENV
- name: Try to use build cache
uses: actions/cache@v4
with:
path: |
${{ env.GOCACHE }}
${{ env.GOMODCACHE }}
key: ${{ runner.os }}-go-${{ hashFiles(format('go/src/github.com/{0}/**/go.sum', github.repository)) }}
restore-keys: |
${{ runner.os }}-go-
- name: ${{ matrix.job }}
run: |
# workaround for https://github.com/actions/setup-go/issues/14
export GOPATH=${GITHUB_WORKSPACE}/go
export PATH=$PATH:$GOPATH/bin
if [[ "$job" == "verify" ]]; then
make check-setup check
elif [[ "$job" == "build" ]]; then
make docker e2e-docker debug-build-docker
elif [[ "$job" == "test" ]]; then
make test GOFLAGS=-race GO_COVER=y
else
make $job
fi
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
env:
job: ${{ matrix.job }}

- name: Upload test coverage
uses: codecov/codecov-action@v4
with:
flags: unittest
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
if: ${{ matrix.job == 'test' }}

- name: Set up tmate session
if: ${{ matrix.job == 'e2e-examples' && failure() }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 60
21 changes: 21 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Close stale issues/prs"
on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days'
stale-pr-message: 'This pr is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days'
days-before-stale: 60
days-before-close: 15
stale-issue-label: 'lifecycle/stale'
stale-pr-label: 'lifecycle/stale'
exempt-issue-labels: 'lifecycle/frozen'
exempt-pr-labels: 'lifecycle/frozen'
only-labels: 'status/needs-info'
32 changes: 30 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
bin/
images/tidb-operator/bin/
images/tidb-operator-e2e/bin/
images/tidb-operator-e2e/tidb-cluster/
images/tidb-operator-e2e/tidb-operator/
tests/images/stability-test/bin/
tests/images/e2e/bin/
tests/images/fault-trigger/bin/
tests/images/e2e/tidb-drainer/
tests/images/e2e/tidb-operator/
tests/images/e2e/manifests/
*.tar
tmp/
data/
.idea
*.iml
cscope.files
tags
filenametags

# ginkgo test coverage
*.coverprofile

coverage.txt
coverage.out
coverage.html

# retool. We could check this in like a vendor
# But it is just tools that can be installed with make setup
/_tools/
vendor
tests/e2e/e2e.test
.orig
apiserver.local.config/
/.go-version
kubeconfig

# local output directory
/output/
# kubetest2 default artifacts directory
/_artifacts/

.DS_Store

# VSCode
.vscode/
Loading