Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Show warning on coder-cli / Coder API version mismatch #158

Merged
merged 2 commits into from
Oct 27, 2020
Merged

Conversation

cmoog
Copy link
Contributor

@cmoog cmoog commented Oct 24, 2020

Show a warning to the user if the <major>.<minor> versions do not match between the CLI and Coder API.

Screen Shot 2020-10-24 at 6 30 10 PM

Testing

Trying running a build generated from ./ci/steps/build.sh and see that the version is injected and the warning hidden.

@cmoog cmoog changed the title Show warning on coder-cli / Coder API error mismatch Show warning on coder-cli / Coder API version mismatch Oct 24, 2020
@cmoog cmoog marked this pull request as ready for review October 26, 2020 15:57
@cmoog cmoog requested a review from coadler October 27, 2020 15:32
Copy link
Contributor

@coadler coadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New logging makes this look amazing

Comment on lines +57 to +61
clog.Log(clog.Warn(
"version mismatch detected",
fmt.Sprintf("coder-cli version: %s", version.Version),
fmt.Sprintf("Coder API version: %s", apiVersion), clog.BlankLine,
clog.Tipf("download the appropriate version here: https://github.com/cdr/coder-cli/releases"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure, this is thrown to stderr correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, all log levels are thrown in stderr.

@cmoog cmoog merged commit 7a4312f into master Oct 27, 2020
@cmoog cmoog deleted the version-warning branch October 27, 2020 15:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants