From b348c716df5232c2ea307bc6649661ea95e3998c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 05:12:03 +0000 Subject: [PATCH 1/3] update latest version (#244) Update latest-version file and version in install.sh Co-authored-by: zhangyangyu <3690895+zhangyangyu@users.noreply.github.com> --- install.sh | 2 +- latest-version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 295c5912..9c6628ca 100644 --- a/install.sh +++ b/install.sh @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -version="1.0.0-beta.1" +version="1.0.0-beta.2" repo='https://github.com/tidbcloud/tidbcloud-cli/releases/download' if [ -n "$TICLOUD_MIRRORS" ]; then diff --git a/latest-version b/latest-version index ada98c6f..40d474ce 100644 --- a/latest-version +++ b/latest-version @@ -1 +1 @@ -v1.0.0-beta.1 \ No newline at end of file +v1.0.0-beta.2 \ No newline at end of file From 948d0101d19ed74b6447ffc09af6dcca105ff9db Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Tue, 24 Sep 2024 14:54:02 +0800 Subject: [PATCH 2/3] change update to upgrade (#245) --- internal/cli/upgrade/upgrade.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/cli/upgrade/upgrade.go b/internal/cli/upgrade/upgrade.go index 293f84f4..3caf29de 100644 --- a/internal/cli/upgrade/upgrade.go +++ b/internal/cli/upgrade/upgrade.go @@ -42,16 +42,16 @@ func Cmd(h *internal.Helper) *cobra.Command { Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - // If is managed by TiUP, we should disable the update command since binpath is different. + // If is managed by TiUP, we should disable the upgrade command since binpath is different. if config.IsUnderTiUP { - return errors.New("the CLI is managed by TiUP, please update it by `tiup update cloud`") + return errors.New("the CLI is managed by TiUP, please upgrade it by `tiup update cloud`") } - // When update CLI, we don't need to check the version again after command executes. + // When upgrade CLI, we don't need to check the version again after command executes. newRelease, err := github.CheckForUpdate(ctx, false) - // If we can't get the latest version, we should update the CLI assuming it's not the latest version. + // If we can't get the latest version, we should upgrade the CLI assuming it's not the latest version. if err != nil { - log.Debug("Failed to check for update, update the CLI assuming it's not the latest version", zap.Error(err)) + log.Debug("Failed to check for upgrade, upgrade the CLI assuming it's not the latest version", zap.Error(err)) newRelease = &github.ReleaseInfo{ Version: "latest", } @@ -74,7 +74,7 @@ func Cmd(h *internal.Helper) *cobra.Command { } func updateAndWaitReady(ctx context.Context, h *internal.Helper, newRelease *github.ReleaseInfo) error { - fmt.Fprintf(h.IOStreams.Out, "... Updating the CLI to version %s\n", newRelease.Version) + fmt.Fprintf(h.IOStreams.Out, "... Upgrading the CLI to version %s\n", newRelease.Version) ctx, cancel := context.WithTimeout(ctx, 1*time.Minute) defer cancel() @@ -160,7 +160,7 @@ func updateAndSpinnerWait(ctx context.Context, h *internal.Helper, newRelease *g if err != nil { return err } else { - return ui.Result("Update successfully!") + return ui.Result("Upgrade successfully!") } case <-ctx.Done(): return util.InterruptError @@ -170,7 +170,7 @@ func updateAndSpinnerWait(ctx context.Context, h *internal.Helper, newRelease *g } } - p := tea.NewProgram(ui.InitialSpinnerModel(task, fmt.Sprintf("Updating the CLI to version %s", newRelease.Version))) + p := tea.NewProgram(ui.InitialSpinnerModel(task, fmt.Sprintf("Upgrading the CLI to version %s", newRelease.Version))) model, err := p.Run() if err != nil { return errors.Trace(err) From a9769fb072be0e6db5c31f34ac9ad6be8f035352 Mon Sep 17 00:00:00 2001 From: Xiang Zhang Date: Tue, 24 Sep 2024 15:05:00 +0800 Subject: [PATCH 3/3] branch create timeout should be an error (#246) --- internal/cli/serverless/branch/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cli/serverless/branch/create.go b/internal/cli/serverless/branch/create.go index a584e4dc..9ce61332 100644 --- a/internal/cli/serverless/branch/create.go +++ b/internal/cli/serverless/branch/create.go @@ -253,7 +253,7 @@ func CreateAndSpinnerWait(ctx context.Context, h *internal.Helper, d cloud.TiDBC for { select { case <-timer: - return ui.Result(fmt.Sprintf("Timeout waiting for branch %s to be ready, please check status on dashboard.", newBranchID)) + return errors.New(fmt.Sprintf("Timeout waiting for branch %s to be ready, please check status on dashboard.", newBranchID)) case <-ticker.C: b, err := d.GetBranch(ctx, clusterId, newBranchID) if err != nil {