grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
25.59k stars 1.26k forks source link

Add `k6 upgrade` command #3975

Open yorugac opened 1 week ago

yorugac commented 1 week ago

Feature Description

Modern CLI tools sometimes support the option of upgrading the tool to the newest version in-place, with upgrade CLI command. This would allow to simplify keeping k6 up-to-date. Potentially, it might also be of use in tools like k6-studio.

Suggested Solution (optional)

Running k6 upgrade should result in something like the following:

  1. fetch the latest available k6 version from GitHub
  2. compare it to the current version
  3. if the latest version is newer, download the package and replace the k6 binary

Already existing or connected issues / PRs (optional)

No response

AkshayAwate commented 1 week ago

@mstoykov would you assign this issue to me ?

mstoykov commented 1 week ago

@AkshayAwate thanks for the offer, but triage and evaluation needed issues are not ready to be worked on. You can look at other issues that do not have those two labels :)

On the topic of the issue itself:

I am not certain how useful that will be to be honest and all of the tools I can think of that do this (which is a small amoutn to be honest) are very different from k6.

From downloads count some years ago, it seemed like most user either:

  1. use rpm/deb packages
  2. use docker
  3. use one of the unofficial release like https://community.chocolatey.org/packages/k6

In all of those cases this will not be usable.

I will expect this will also be major problem on MacOS and we will need to do something like running brew update k6 (or whatever it is) underneed.

I will actually expect that we might need to do similar stuff on windows as well, although to be honest I am not very concerned with that.

So from a first look this looks like functionality that will not be very used and will require platform specific solutions ... potentially multiple per platform.

Potentially, it might also be of use in tools like k6-studio.

cc @Llandy3d

AFAIK k6-studio got autoupdate through "electron means" and actually embeds k6 inside of it. Not certain to what extend using a different k6 binary is a problem or not. Is it planned? Is it desired 🤷

From going over this I am more of the opinion that something like g (which I use, although maybe it is not needed anymore). That lets you go between versions of a given "cli app".

Given that k6 still gets some breaking changes it might be better if there is a tool that does this outside of k6 and lets you use it to swap between versions.

This might also be a lot less relevant with k6build and k6exec. As those likely will just build k6 versions either way.

I will move this to evaluation needed so we can further discuss it

Llandy3d commented 1 week ago

Regarding the studio, I would say it wouldn't be much useful at this stage. Like mstoykov mentioned, we embed k6 inside of it so we control which version of the studio bundles which version of k6, picking the version of k6 is not currently on the roadmap