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

CLI should indicate that a newer version is available #141

Open
bmarkons opened this issue Jan 29, 2019 · 3 comments
Open

CLI should indicate that a newer version is available #141

bmarkons opened this issue Jan 29, 2019 · 3 comments

Comments

@bmarkons
Copy link
Contributor

This is based on one customer question how to verify if latest version is being used.

We could print some warning message if there is new version available.

@markoa markoa changed the title CLI doesn't indicate if old version is being used CLI should indicate that a newer version is available Feb 6, 2019
@markoa
Copy link

markoa commented Feb 6, 2019

Changed the title slightly.

Support team received a number of tickets about orphan SSH sessions and had to refund credits for these cause users are not aware of the latest CLI.

What's good enough IMO:

  • Implement sem upgrade.
  • Once a day check availability of new version (on any command user runs).
  • If a newer version is available, add a colorful message at the end of every command's output advising to run sem upgrade.

@shiroyasha
Copy link
Contributor

shiroyasha commented Feb 6, 2019

We have to keep in mind that this has some negative implications as well, especially this part:

* If a newer version is available, add a colorful message at the end of every command's output advising to run `sem upgrade`.

This behavior is present in gcloud, and every time you want to automate something, you need to keep in mind that sometimes the output of the command has undesired side-effect output.


I'm not against the idea, but I would keep an open eye for these edge cases, and made sure that the semaphore CLI offers a pleasant experience for automation (scripting) as well.

@shiroyasha
Copy link
Contributor

shiroyasha commented Feb 6, 2019

From the perspective of scriptability, I would maybe even prefer this flow:

If you have an old CLI:

$ sem get projects
[error] Unsupported client version.

Upgrade your client to the latest version with `sem upgrade`

(exit status 1)

The reason for this is when I am scripting it is easier to foresee that the command flat-out fails than for it to return something unexpected silently without breaking.

Consider the following example, where I want to extract only projects names with a simple awk

$ sem get projects | awk '{ print $1 }' 

It is easier to handle exit 1, then to handle a Notice: your CLI is outdated message at the end of the projects table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants