Open
Description
After #44, xk6 will not always try to use the latest k6 version to build the binary, it will instead use the one specified in the extensions' go.mod file(s). However, as this forum thread has shown, this can cause problems for unmaintained extensions, when users expect to be able to access newer k6 built-in APIs.
So, it would be nice if xk6 emits a warning when we are going to use an older version of k6. It seems like we can do it by running go list -m -json -u -mod=readonly go.k6.io/k6
for the repo, it will produce something like this:
{
"Path": "go.k6.io/k6",
"Version": "v0.33.1-0.20210825161650-c932a28ff940",
"Time": "2021-08-25T16:16:50Z",
"Update": {
"Path": "go.k6.io/k6",
"Version": "v0.40.0",
"Time": "2022-09-08T07:54:34Z"
},
"Dir": "/go/pkg/mod/go.k6.io/[email protected]",
"GoMod": "/go/pkg/mod/cache/download/go.k6.io/k6/@v/v0.33.1-0.20210825161650-c932a28ff940.mod",
"GoVersion": "1.16"
}
I guess we can compare the Time
or semver-compare the Version
attributed between the main object and Update
🤔 Or we can figure out some other way to detect newer k6 versions.