chore(k6): build xk6-kafka v2 against k6 v2.2.0 - #393
Conversation
Switch the extension and CI smoke builds to k6 v2.0.0 and update imports to the new go.k6.io/k6/v2 module path required by k6 v2.
Add a compatibility policy section clarifying that the first xk6-kafka release requiring k6 v2 should be published as v3.0.0, while v2.x remains the maintenance line for k6 v1 users.
Move the Go module path and xk6 build/install references from /v2 to /v3 so k6 v2-compatible releases are published on the v3 major line.
|
Hi @mostafa 👋 Hope you're doing well! FYI, we recently encountered this issue with Docker image: $ docker run --entrypoint sh mostafamoradian/xk6-kafka:2.0.0 -c "ls -l && k6 version"
total 0
sh: k6: not found
$ docker run --entrypoint sh mostafamoradian/xk6-kafka:1.3.0 -c "ls -l && k6 version"
total 0
k6 v1.6.1 (go1.26.1, linux/amd64)
Extensions:
github.com/mostafa/xk6-kafka (devel), k6/x/kafka [js]So Docker image v2 of the extension is basically unusable, at least by grafana/k6-operator, and there were issues with custom builds similar to what is described here. Do you think this problem would be solved by this PR? |
|
Hey @yorugac, 👋 I am good and hope you are as well. I believe this PR fixes it: #396 I haven't released a new version yet, since I released v2.0.0 (because of migration to confluent-kafka-go) that builds against k6 v1.x.x. Moving to k6 v2.x.x breaks the contract, hence I should move to v3. 😢 (which I am sure you already know.) All in all, do you think it'd be a good idea to cut a new release of xk6-kafka (namely v2.1.0) before migration to k6 v2 or just merging this and releasing xk6-kafka v3.0.0? I am honestly not sure anymore, as I wasn't expecting a k6 v2 right after xk6-kafka v2. However, if I do that, it'll leave xk6-kafka v2 in a broken state regarding the Docker image. So, I'll release a new version before migration to k6 v2. |
|
|
Oh I see. Good to hear that issue is probably solved by the Dockerfile fix in #396. And it's indeed a case of a bad timing with all the major releases happening simultaneously 😂
Yes, I think it totally makes sense to have both 2.1.0 and then 3.0.0 👍 As you said, leaving v2 in a broken state is not a good idea. With 2.1.0, people can still run k6 v1 + xk6-kafka with confluent lib if, for example, they need more time to switch to k6 v2. (Though k6 v2 is not actually breaking that much, from user perspective; but nevertheless.) FYI, k6 has a schedule of major releases once a year, it's in the official docs too. Given that v1 happened in May 2025, it's now reasonable to expect a major release in spring approx. Just in case it's helpful for future planning. LMK if you need any other info or help! And looking forward for the new releases 🙂 |
|
@mostafa, Btw, I don't think there's a requirement to have a major release for the extension during k6 v2 switch, unless there are additional factors specific for this extension. For example, here: |
|
@yorugac Well, that's an example of release planning strategy and major version bump usually means backward incompatibility, hence the xk6-kafka major version upgrade. However, I read the changelog and I don't see major breaking changes that might heavily affect xk6-kafka. So, I am with you on no major version bump in xk6-kafka. |
|
This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
|
@mostafa fix the coverage and resolve conflicts. |
|
Hey @mostafa 👋 Hope you're doing well! Just wanted to check in on this one - are you still planning to take the k6 v2.0.0 migration across the finish line? Looks like it's mostly there (checks are green apart from the small coverage dip, and merge conflicts to resolve), so I'd love to know if it's still on your roadmap. Happy to help if there's anything I can do! |
Keep the xk6-kafka v2 module path and build against k6 v2.2.0 instead of introducing a v3 major line.
golangci-lint v2.13 replaced exhaustruct, so default: all started failing on incomplete struct literals that were already ignored.
CI was installing latest v2.13.2 while mise.lock stays on v2.12.2, so gofmt disagreed on a hanging multi-value return.



Summary
go.k6.io/k6/v2/...and pingo.k6.io/k6/v2 v2.2.0(latest k6 release)github.com/mostafa/xk6-kafka/v2— no v3 major bumpxk6builds to k6v2.2.0xk6-kafkav2.x now targets k6 v2.xTest plan
go test ./... -run=^$CGO_ENABLED=1 xk6 build v2.2.0 --with github.com/mostafa/xk6-kafka/v2=.