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

chore(local): clear ambiguity in between sg version|live#64122

Merged
jhchabran merged 1 commit into
mainfrom
jh/sg-version-clear-ambiguity
Aug 7, 2024
Merged

chore(local): clear ambiguity in between sg version|live#64122
jhchabran merged 1 commit into
mainfrom
jh/sg-version-clear-ambiguity

Conversation

@jhchabran

@jhchabran jhchabran commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

Context: As I was catching up with my Slack notifications, I spotted this conversation and this PR is a 5m fix to avoid the problem to happen again.

What: If you haven't used sg in a while, it's easy to think that sg version refers to the currently deployed Sourcegraph instance and not the CLI. This commit adds a little preamble on stderr to not mess with script usage while still reminding the user that it's the CLI version that gets printed out.

Before: we printed the version without any context
After: we also print the following on stderr: 👉 Showing the current version of the sg CLI, if you're looking for deployed Sourcegraph instances version, please use sg live instead.. Stderr so we don't break things like $(sg version).

Note: at a broader level, we should generalize this pattern, we don't use too much sg raw output in scripts, but for the few places where it's the case, it's a footgun.

Test plan

Locally tested + CI.

Changelog

  • sg version explicitly mentions that it's the CLI version that's printed out, not any instance version.

If you haven't used `sg` in a while, it's easy to think that
`sg version` refers to the currently deployed Sourcegraph instance and
not the CLI. This commit adds a little preamble on stderr to not mess
with script usage while still reminding the user that it's the CLI
version that gets printed out.
@cla-bot cla-bot Bot added the cla-signed label Jul 29, 2024
@jhchabran jhchabran requested review from a team and olafurpg July 29, 2024 08:44

@Strum355 Strum355 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder is it possible to error when passing arguments to this command like how olaf did sg version s2

@olafurpg olafurpg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you! ❤️

@jhchabran jhchabran merged commit 4591d98 into main Aug 7, 2024
@jhchabran jhchabran deleted the jh/sg-version-clear-ambiguity branch August 7, 2024 16:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants