Skip to content

Commit f47da2e

Browse files
breezewishbaurine
authored andcommitted
Refactor: Change util module to util package (pingcap#1052)
1 parent 6d63f33 commit f47da2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3551
-212
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Create PD PR Manually
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: "Release version, e.g. v2021.07.09.1"
8+
required: true
9+
10+
jobs:
11+
pd_pr:
12+
name: Create PD PR
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
branch: [master, release-4.0, release-5.0, release-5.1]
17+
steps:
18+
- name: Check out PD code base
19+
uses: actions/checkout@master
20+
with:
21+
repository: tikv/pd
22+
ref: ${{ matrix.branch }}
23+
- uses: actions/setup-go@v2
24+
with:
25+
go-version: "1.13.5"
26+
- name: Update TiDB Dashboard in PD code base
27+
run: |
28+
go get -d "github.com/pingcap/tidb-dashboard@${{ github.event.inputs.release_version }}"
29+
go mod tidy
30+
make pd-server
31+
go mod tidy
32+
- name: Commit PD code base change
33+
id: git_commit
34+
run: |
35+
git config user.name "tidb-dashboard-bot"
36+
git config user.email "[email protected]"
37+
git add go.mod go.sum
38+
if git status | grep -q "Changes to be committed"
39+
then
40+
git commit --signoff --message "Update TiDB Dashboard to ${{ github.event.inputs.release_version }}"
41+
echo "::set-output name=committed::1"
42+
else
43+
echo "No changes detected, skipped"
44+
fi
45+
- name: Set build ID
46+
id: build_id
47+
run: echo "::set-output name=id::$(date +%s)"
48+
- name: Create PR based on PD code base
49+
uses: peter-evans/create-pull-request@v3
50+
if: steps.git_commit.outputs.committed == 1
51+
with:
52+
token: ${{ secrets.BOT_PAT }}
53+
branch: update-tidb-dashboard/${{ matrix.branch }}-${{ github.event.inputs.release_version }}-${{ steps.build_id.outputs.id }}
54+
title: Update TiDB Dashboard to ${{ github.event.inputs.release_version }} [${{ matrix.branch }}]
55+
body: |
56+
### What problem does this PR solve?
57+
58+
Update TiDB Dashboard to ${{ github.event.inputs.release_version }}.
59+
60+
Upstream commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} .
61+
62+
### Release note
63+
64+
```release-note
65+
None
66+
```
67+
push-to-fork: tidb-dashboard-bot/pd

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.env
22
/bin
3-
/vendor
43

54
# Binaries for programs and plugins
65
*.exe
@@ -15,9 +14,6 @@
1514
# Output of the go coverage tool, specifically when used with LiteIDE
1615
*.out
1716

18-
# Dependency directories (remove the comment below to include it)
19-
# vendor/
20-
2117
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
2218
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
2319

.golangci.yml

Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,51 @@ run:
44
- pkg/uiserver
55
timeout: 2m
66

7-
linters-settings:
8-
goimports:
9-
local-prefixes: github.com/pingcap/tidb-dashboard
10-
golint:
11-
min-confidence: 0
12-
137
issues:
148
include:
9+
# Bring back all gosec checks
1510
- EXC0006
1611
- EXC0007
1712
- EXC0008
1813
- EXC0009
1914
- EXC0010
15+
exclude-rules:
16+
# TODO: Current code base does not work well for these linters. We should bring back one by one.
17+
- path: ^pkg/|^cmd/
18+
linters:
19+
- nestif
20+
- exhaustive
21+
- wastedassign
22+
- errorlint
2023

2124
linters:
22-
disable-all: true
2325
enable:
24-
- govet
25-
- errcheck
26-
- staticcheck
27-
- unused
28-
- gosimple
29-
- structcheck
30-
- varcheck
31-
- ineffassign
32-
- deadcode
33-
- typecheck
34-
- revive
35-
- gosec
36-
- unconvert
37-
- goimports
26+
# Additionally enable some checkers
27+
- asciicheck
3828
- depguard
39-
- prealloc
29+
- dogsled
30+
- durationcheck
31+
- errorlint
32+
- exhaustive
4033
- exportloopref
34+
- godot
35+
- gofmt
36+
- goimports
37+
- gosec
38+
- importas
39+
- nestif
40+
- prealloc
41+
- predeclared
42+
- revive
43+
- rowserrcheck
44+
- sqlclosecheck
45+
- unconvert
46+
- wastedassign
4147
- whitespace
48+
49+
linters-settings:
50+
goimports:
51+
local-prefixes: github.com/pingcap/tidb-dashboard
52+
exhaustive:
53+
# only cover the case when default is not given
54+
default-signifies-exhaustive: true

go.mod

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,35 @@ module github.com/pingcap/tidb-dashboard
33
go 1.13
44

55
require (
6+
github.com/DATA-DOG/go-sqlmock v1.5.0
67
github.com/Masterminds/semver v1.5.0
78
github.com/ReneKroon/ttlcache/v2 v2.3.0
8-
github.com/VividCortex/mysqlerr v0.0.0-20200629151747-c28746d985dd
9+
github.com/VividCortex/mysqlerr v1.0.0
910
github.com/Xeoncross/go-aesctr-with-hmac v0.0.0-20200623134604-12b17a7ff502
1011
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
12+
github.com/antonmedv/expr v1.9.0
1113
github.com/appleboy/gin-jwt/v2 v2.6.3
1214
github.com/cenkalti/backoff/v4 v4.0.2
13-
github.com/dgrijalva/jwt-go v3.2.0+incompatible
15+
github.com/fatih/structtag v1.2.0
1416
github.com/gin-contrib/gzip v0.0.1
15-
github.com/gin-gonic/gin v1.5.0
17+
github.com/gin-gonic/gin v1.7.4
1618
github.com/go-resty/resty/v2 v2.6.0
1719
github.com/go-sql-driver/mysql v1.6.0
1820
github.com/goccy/go-graphviz v0.0.5
21+
github.com/golang-jwt/jwt v3.2.1+incompatible
1922
github.com/google/pprof v0.0.0-20200407044318-7d83b28da2e9
2023
github.com/google/uuid v1.0.0
2124
github.com/gtank/cryptopasta v0.0.0-20170601214702-1f550f6f2f69
25+
github.com/henrylee2cn/ameda v1.4.10
2226
github.com/joho/godotenv v1.3.0
2327
github.com/joomcode/errorx v1.0.1
2428
github.com/minio/sio v0.3.0
2529
github.com/oleiade/reflections v1.0.1
2630
github.com/pingcap/check v0.0.0-20191216031241-8a5a85928f12
2731
github.com/pingcap/errors v0.11.5-0.20200917111840-a15ef68f753d
2832
github.com/pingcap/kvproto v0.0.0-20200411081810-b85805c9476c
29-
github.com/pingcap/log v0.0.0-20210317133921-96f4fcab92a4
30-
github.com/pingcap/sysutil v0.0.0-20210315073920-cc0985d983a3
33+
github.com/pingcap/log v0.0.0-20210906054005-afc726e70354
34+
github.com/pingcap/sysutil v0.0.0-20211108113841-e5c5906ed1e7
3135
github.com/rs/cors v1.7.0
3236
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
3337
github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0
@@ -37,11 +41,12 @@ require (
3741
github.com/swaggo/http-swagger v0.0.0-20200308142732-58ac5e232fba
3842
github.com/swaggo/swag v1.6.6-0.20200529100950-7c765ddd0476
3943
github.com/thoas/go-funk v0.8.0
40-
github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1
44+
github.com/vmihailenco/msgpack/v5 v5.3.5
4145
go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738
42-
go.uber.org/atomic v1.6.0
46+
go.uber.org/atomic v1.9.0
4347
go.uber.org/fx v1.10.0
44-
go.uber.org/zap v1.16.0
48+
go.uber.org/goleak v1.1.10
49+
go.uber.org/zap v1.19.0
4550
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
4651
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
4752
google.golang.org/grpc v1.25.1

0 commit comments

Comments
 (0)