Automated upgrading
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 :)
PSSourcegraph is in brew, chocolatey, and apt?
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.
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.
Got it. I think what we should do is:
src update check-> checks for updates, doesn't apply them.src update-> checks for updates, self-applies them. Will prompt for root/admin privileges.
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.
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.
@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.
Yep, agreed, can you create a tracking issue on sourcegraph-extension-api repository for this in our beta milestone?
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.
Hmm seems as though this is already covered by #441
@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.
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 ? 🙂
Sounds good to me!
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!