Skip to content

Commit

Permalink
Merge branch 'main' into add-branch-reset
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangyu authored Sep 25, 2024
2 parents 636a602 + a9769fb commit 5dcd4bf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/serverless/branch/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions internal/cli/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion latest-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.0.0-beta.1
v1.0.0-beta.2

0 comments on commit 5dcd4bf

Please sign in to comment.