k6-docs
k6-docs copied to clipboard
Specifying the k6 version when building an extension
Based on some confusion a user had on slack https://k6io.slack.com/archives/C3E688J8Z/p1704295361833839?thread_ts=1704148129.763029&channel=C3E688J8Z&message_ts=1704295361.833839, it might be good to review how we document building k6 with extensions. Not sure if future enhancements will reduce the pain (e.g. https://github.com/szkiba/k6x).
In this case, xk6 build --with http://github.com/szkiba/xk6-faker@latest uses v0.45.1, and it caused a script using browser to behave differently when adding the extension, as k6 it was no longer in v0.48.0.
The user did not know the root cause, they expecting it to be the same latest k6 version, the same with and without extensions. Users should probably always default to use xk6 build latest --with http://github.com/szkiba/xk6-faker@latest, unless the extension does not support the latest.
We cannot fix all the community repos that might cause this confusions https://github.com/szkiba/xk6-faker#build, but probably our docs can explain this.
E.g. latest is included in https://grafana.com/docs/k6/latest/extensions/build-k6-binary-using-go/#building-your-first-extension, but in https://grafana.com/docs/k6/latest/extensions/explore/ the latest is missing, as in many other pages. I understand it's probably best if some extensions might not even work with the latest, though it can be confusing for many users that don't know this detail.
I opened this issue to discuss if we can improve this.