Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support products pump drainer #31

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tibuild/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ const docTemplate = `{
"dm",
"tidb-binlog",
"tidb-tools",
"ng-monitoring",
"tidb-dashboard",
"drainer",
"pump",
""
],
"x-enum-varnames": [
Expand All @@ -568,6 +572,10 @@ const docTemplate = `{
"ProductDm",
"ProductTidbBinlog",
"ProductTidbTools",
"ProductNgMonitoring",
"ProductTidbDashboard",
"ProductDrainer",
"ProductPump",
"ProductUnknown"
]
},
Expand Down
8 changes: 8 additions & 0 deletions tibuild/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@
"dm",
"tidb-binlog",
"tidb-tools",
"ng-monitoring",
"tidb-dashboard",
"drainer",
"pump",
""
],
"x-enum-varnames": [
Expand All @@ -556,6 +560,10 @@
"ProductDm",
"ProductTidbBinlog",
"ProductTidbTools",
"ProductNgMonitoring",
"ProductTidbDashboard",
"ProductDrainer",
"ProductPump",
"ProductUnknown"
]
},
Expand Down
8 changes: 8 additions & 0 deletions tibuild/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ definitions:
- dm
- tidb-binlog
- tidb-tools
- ng-monitoring
- tidb-dashboard
- drainer
- pump
- ""
type: string
x-enum-varnames:
Expand All @@ -173,6 +177,10 @@ definitions:
- ProductDm
- ProductTidbBinlog
- ProductTidbTools
- ProductNgMonitoring
- ProductTidbDashboard
- ProductDrainer
- ProductPump
- ProductUnknown
service.ProductEdition:
enum:
Expand Down
8 changes: 3 additions & 5 deletions tibuild/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ require (
github.com/gin-gonic/gin v1.8.2
github.com/jinzhu/configor v1.2.1
github.com/stretchr/testify v1.8.1
github.com/swaggo/files v1.0.0
github.com/swaggo/gin-swagger v1.5.3
github.com/swaggo/swag v1.8.9
golang.org/x/net v0.5.0
gorm.io/driver/mysql v1.4.5
gorm.io/gorm v1.24.3
Expand All @@ -17,8 +20,6 @@ require (
require (
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.2.0 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
Expand All @@ -43,9 +44,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/swaggo/files v1.0.0 // indirect
github.com/swaggo/gin-swagger v1.5.3 // indirect
github.com/swaggo/swag v1.8.9 // indirect
github.com/ugorji/go/codec v1.2.8 // indirect
golang.org/x/crypto v0.5.0 // indirect
golang.org/x/sys v0.4.0 // indirect
Expand Down
9 changes: 5 additions & 4 deletions tibuild/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.2.0 h1:/Jdm5QfyM8zdlqT6WVZU4cfP23sot6CEHA4CS49Ezig=
github.com/PuerkitoBio/purell v1.2.0/go.mod h1:OhLRTaaIzhvIyofkJfB24gokC7tM42Px5UhoT32THBk=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
github.com/agiledragon/gomonkey/v2 v2.3.1/go.mod h1:ap1AmDzcVOAz1YpeJ3TCzIgstoaWLA6jbbgxfB4w2iY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
Expand All @@ -17,6 +14,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/gzip v0.0.6 h1:NjcunTcGAj5CO1gn4N8jHOSIeRFHIbn51z6K+xaN4d4=
github.com/gin-contrib/gzip v0.0.6/go.mod h1:QOJlmV2xmayAjkNS2Y8NQsMneuRShOU/kjovCXNuzzk=
github.com/gin-contrib/requestid v0.0.6 h1:mGcxTnHQ45F6QU5HQRgQUDsAfHprD3P7g2uZ4cSZo9o=
github.com/gin-contrib/requestid v0.0.6/go.mod h1:9i4vKATX/CdggbkY252dPVasgVucy/ggBeELXuQztm4=
Expand Down Expand Up @@ -46,7 +44,6 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
Expand Down Expand Up @@ -169,6 +166,8 @@ golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE=
golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0 h1:LapD9S96VoQRhi/GrNTqeBJFrUjs5UHCAtTlgwA5oZA=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand All @@ -185,6 +184,7 @@ golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -213,6 +213,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
Expand Down
2 changes: 1 addition & 1 deletion tibuild/gojenkins/cli/jenkinsctl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dougsland/gojenkins/cli/jenkinsctl
go 1.16

require (
github.com/dougsland/jenkinsctl v0.0.1
github.com/dougsland/jenkinsctl v0.0.0-20210621005337-52c1961b55c4
github.com/dougsland/jenkinsctl/jenkins v0.0.0-20210621005337-52c1961b55c4
github.com/spf13/cobra v1.1.3
)
4 changes: 2 additions & 2 deletions tibuild/gojenkins/cli/jenkinsctl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
github.com/dougsland/jenkinsctl v0.0.1 h1:7aHo4j5269NrRTRd19I8zNXZNskWBkVEAs+f4ckAX3A=
github.com/dougsland/jenkinsctl v0.0.1/go.mod h1:Ze+aYWRh2E4WrlO7U9xJ+tFUO2sJWTuKBpOUnqA7ZkE=
github.com/dougsland/jenkinsctl v0.0.0-20210621005337-52c1961b55c4 h1:/+ZUdmbWx9kPxCeu81iZAfC7UOFDOqLsoHcvThFpZEo=
github.com/dougsland/jenkinsctl v0.0.0-20210621005337-52c1961b55c4/go.mod h1:Ze+aYWRh2E4WrlO7U9xJ+tFUO2sJWTuKBpOUnqA7ZkE=
github.com/dougsland/jenkinsctl/jenkins v0.0.0-20210621004651-0e2c28d94c9c/go.mod h1:2tpsGdQH3Imo1j+yHF1e+TX4nutt9PavWxnx7R0hhls=
github.com/dougsland/jenkinsctl/jenkins v0.0.0-20210621005337-52c1961b55c4 h1:SHWI0sXU9WbNkQOCI4UK00FFUhbcdk4oHiNTMWBmjcQ=
github.com/dougsland/jenkinsctl/jenkins v0.0.0-20210621005337-52c1961b55c4/go.mod h1:2tpsGdQH3Imo1j+yHF1e+TX4nutt9PavWxnx7R0hhls=
Expand Down
2 changes: 1 addition & 1 deletion tibuild/pkg/rest/service/dev_build_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,6 @@ var githubRepoValidator *regexp.Regexp
func init() {
versionValidator = regexp.MustCompile(`^v(\d+\.\d+)\.\d+.*$`)
hotfixVersionValidator = regexp.MustCompile(`^v(\d+\.\d+)\.\d+-\d{8,}.*$`)
gitRefValidator = regexp.MustCompile(`^((v\d.*)|(pull/\d+)|([0-9a-fA-F]{40})|(release-.*)|master|(tag/[\w-_]+)|(branch/[\w-_\.]+))$`)
gitRefValidator = regexp.MustCompile(`^((v\d.*)|(pull/\d+)|([0-9a-fA-F]{40})|(release-.*)|master|main|(tag/[\w-_]+)|(branch/[\w-_\.]+))$`)
githubRepoValidator = regexp.MustCompile(`^([\w_-]+/[\w_-]+)$`)
}
29 changes: 21 additions & 8 deletions tibuild/pkg/rest/service/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ const (
ProductDm Product = "dm"
ProductTidbBinlog Product = "tidb-binlog"
ProductTidbTools Product = "tidb-tools"
ProductNgMonitoring Product = "ng-monitoring"
ProductTidbDashboard Product = "tidb-dashboard"
ProductDrainer Product = "drainer"
ProductPump Product = "pump"

ProductUnknown Product = ""
)
Expand Down Expand Up @@ -70,18 +74,21 @@ func (r GithubRepo) URL() string {
}

var (
RepoTidb = GithubRepo{Owner: "pingcap", Repo: "tidb"}
RepoTikv = GithubRepo{Owner: "tikv", Repo: "tikv"}
RepoPd = GithubRepo{Owner: "tikv", Repo: "pd"}
RepoTiflash = GithubRepo{Owner: "pingcap", Repo: "tiflash"}
RepoTiflow = GithubRepo{Owner: "pingcap", Repo: "tiflow"}
RepoTidbBinlog = GithubRepo{Owner: "pingcap", Repo: "tidb-binlog"}
RepoTidbTools = GithubRepo{Owner: "pingcap", Repo: "tidb-tools"}
RepoTidb = GithubRepo{Owner: "pingcap", Repo: "tidb"}
RepoTikv = GithubRepo{Owner: "tikv", Repo: "tikv"}
RepoPd = GithubRepo{Owner: "tikv", Repo: "pd"}
RepoTiflash = GithubRepo{Owner: "pingcap", Repo: "tiflash"}
RepoTiflow = GithubRepo{Owner: "pingcap", Repo: "tiflow"}
RepoTidbBinlog = GithubRepo{Owner: "pingcap", Repo: "tidb-binlog"}
RepoTidbTools = GithubRepo{Owner: "pingcap", Repo: "tidb-tools"}
RepoNgMonitoring = GithubRepo{Owner: "pingcap", Repo: "ng-monitoring"}
RepoTidbDashboard = GithubRepo{Owner: "pingcap", Repo: "tidb-dashboard"}
)

var allProducts = [...]Product{ProductTidb, ProductTikv, ProductPd,
ProductTiflash, ProductBr, ProductTidbLightning, ProductDumpling,
ProductTicdc, ProductTidbBinlog, ProductDm, ProductTidbTools}
ProductTicdc, ProductTidbBinlog, ProductDm, ProductTidbTools,
ProductNgMonitoring, ProductTidbDashboard, ProductDrainer, ProductPump}

func StringToProduct(s string) Product {
for _, i := range allProducts {
Expand All @@ -106,10 +113,16 @@ func ProdToRepo(prod Product) *GithubRepo {
return &RepoTiflash
case ProductTicdc, ProductDm:
return &RepoTiflow
case ProductDrainer, ProductPump:
fallthrough
case ProductTidbBinlog:
return &RepoTidbBinlog
case ProductTidbTools:
return &RepoTidbTools
case ProductNgMonitoring:
return &RepoNgMonitoring
case ProductTidbDashboard:
return &RepoTidbDashboard
default:
return nil
}
Expand Down