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

[New CLI] branch #124

Merged
merged 9 commits into from
Dec 14, 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
15 changes: 6 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ generate-pingchat-client: ## Generate PingChat client
addcopy: ## Add copyright to all files
@scripts/add-copy.sh

.PHONY: generate-branch-client
generate-branch-client:
@echo "==> Generating branch client"
.PHONY: generate-v1beta1-client
generate-v1beta1-client:
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
swagger generate client -f pkg/tidbcloud/branch/branch.swagger.json -A tidbcloud-branch -t pkg/tidbcloud/branch

.PHONY: generate-serverless-client
generate-serverless-client:
@echo "==> Generating branch client"
swagger generate client -f pkg/tidbcloud/v1beta1/branch/branch.swagger.json -A tidbcloud-serverless -t pkg/tidbcloud/v1beta1/branch
@echo "==> Generating serverless client"
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
swagger generate client -f pkg/tidbcloud/serverless/serverless.swagger.json -A tidbcloud-serverless -t pkg/tidbcloud/serverless
swagger generate client -f pkg/tidbcloud/v1beta1/serverless/serverless.swagger.json -A tidbcloud-serverless -t pkg/tidbcloud/v1beta1/serverless


.PHONY: fmt
fmt: ## Format changed go
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/config/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If not, the config in the active profile will be set`, prop.ProfileProperties())
return fmt.Errorf("no profile is configured, please use `config create` to create a profile")
}

if propertyName == prop.ApiUrl {
if propertyName == prop.ApiUrl || propertyName == prop.ServerlessEndpoint {
_, err := prop.ValidateApiUrl(value)
if err != nil {
return err
Expand Down
343 changes: 0 additions & 343 deletions internal/cli/connect/connect.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/cli/dataimport/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func ListCmd(h *internal.Helper) *cobra.Command {

listCmd.Flags().StringP(flag.ProjectID, flag.ProjectIDShort, "", "Project ID")
listCmd.Flags().StringP(flag.ClusterID, flag.ClusterIDShort, "", "Cluster ID")
listCmd.Flags().StringP(flag.Output, flag.OutputShort, output.HumanFormat, "Output format. One of [\"human\" \"json\"]. For the complete result, please use json format.")
listCmd.Flags().StringP(flag.Output, flag.OutputShort, output.HumanFormat, "Output format, one of [\"human\" \"json\"]. For the complete result, please use json format.")
return listCmd
}

Expand Down
4 changes: 1 addition & 3 deletions internal/cli/dataimport/start/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ import (
"tidbcloud-cli/internal/telemetry"
"tidbcloud-cli/internal/ui"
"tidbcloud-cli/internal/util"

serverlessApi "tidbcloud-cli/pkg/tidbcloud/serverless/client/serverless_service"
serverlessApi "tidbcloud-cli/pkg/tidbcloud/v1beta1/serverless/client/serverless_service"

"github.com/AlecAivazis/survey/v2"
"github.com/AlecAivazis/survey/v2/terminal"

"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/fatih/color"
Expand Down
Loading
Loading