Skip to content

Warn when old k6 version is used #52

Open
@na--

Description

@na--

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions