src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

Automated upgrading

Open felixfbecker opened this issue 7 years ago • 14 comments

Now that the CLI is more important and used to publish extension we should make updating it easier. It should be possible to install with package managers like Homebrew, Chocolatey or apt. It should be as easy as it is to update PSSourcegraph :)

felixfbecker avatar Sep 29 '18 10:09 felixfbecker

PSSourcegraph is in brew, chocolatey, and apt?

emidoots avatar Sep 29 '18 10:09 emidoots

No PSSourcegraph can be installed from the PowerShell gallery with Install-Module, which is PowerShell specific. I'm just saying it should be the same experience.

felixfbecker avatar Sep 29 '18 10:09 felixfbecker

What would also help is an in-app update check that checks against the GitHub releases API for the latest release and notifies if an update is available, and prints an update command to run. I'm just worried users will miss out of features and bugfixes, especially related to extension publishing.

felixfbecker avatar Sep 29 '18 10:09 felixfbecker

Got it. I think what we should do is:

  1. src update check -> checks for updates, doesn't apply them.
  2. src update -> checks for updates, self-applies them. Will prompt for root/admin privileges.

emidoots avatar Sep 29 '18 10:09 emidoots

I think we should avoid building a self-update mechanism in a dedicated command, in my experience these always fail in some way. The long-term solution should be supporting package managers. I was thinking more of a simple hint on every command run like https://www.npmjs.com/package/update-notifier does it.

felixfbecker avatar Sep 29 '18 11:09 felixfbecker

Supporting package managers is fine and is good, but supporting all of them will take a lot of time and dedication (brew, chocolatey, apt, yum, alpine, etc) and as such is less realistic than building in self-updating. I've done the latter and feel it can reasonably be done in a day, not so with the alternatives.

We can provide a simple update hint on every command for select commands like src extensions publish etc. but doing it on every command means that the tool would phone home on every command which is not ideal esp. if running the tool e.g. as part of a script.

emidoots avatar Sep 29 '18 21:09 emidoots

@slimsag I propose we include this in the extensions beta milestone

This suggestion from Felix I think is the most essential work to be done.

What would also help is an in-app update check that checks against the GitHub releases API for the latest release and notifies if an update is available, and prints an update command to run. I'm just worried users will miss out of features and bugfixes, especially related to extension publishing.

ryan-blunden avatar Oct 19 '18 19:10 ryan-blunden

Yep, agreed, can you create a tracking issue on sourcegraph-extension-api repository for this in our beta milestone?

emidoots avatar Oct 19 '18 20:10 emidoots

I would love to take a crack at this if y'all are still open to it. https://github.com/rhysd/go-github-selfupdate seems perfect for this.

gleich avatar Mar 02 '21 01:03 gleich

Hmm seems as though this is already covered by #441

gleich avatar Mar 02 '21 01:03 gleich

@Matt-Gleich I think that depends on @joshuabezaleel and whether he wants to finish #441 or not. I left some comments, some of which are blockers.

mrnugget avatar Mar 02 '21 09:03 mrnugget

Hi @Matt-Gleich and @mrnugget , I am truly sorry for a really late response to the discussion and the review since various personal things happened recently. If it would still be okay I would love to still continue working on the issue and PR. Will try to check it in the following days.

Would that be okay with you @Matt-Gleich ? 🙂

joshuabezaleel avatar Mar 05 '21 12:03 joshuabezaleel

Sounds good to me!

gleich avatar Mar 05 '21 16:03 gleich

Just a little update: we've closd https://github.com/sourcegraph/src-cli/pull/441 just now. We've been meaning to pick it up and carry it over the finish line for a while now, but it never had the right priority. If someone wants to either finish #441 (see review comments I left there) or open another PR that's in line with what was discussed in #441: please do!

mrnugget avatar Jul 21 '21 08:07 mrnugget