Skip to content

Conversation

@AgnesToulet
Copy link
Contributor

What?

This PR introduces a new cloudapi/v6 package (internal for now) that calls the k6 Cloud API v6 instead of v1. It only supports validating token as it's the first step we need to retrieve the stack ID (see #5420). Then, I'll iterate on it to introduce more features.

The main differences with the existing cloudapi package are:

  • Use the generated go client (https://github.com/grafana/k6-cloud-openapi-client-go)
  • Handle the new v6 response type (the CheckResponse has minor updates and the ResponseError type now contains and parses the k6cloud.ErrorApiModel type)
  • I started to clean up the config by removing all references and usage of the LegacyCloudConfigKey (loadimpact). I believe there are many more improvements to be made in this file but it will be easier to review if I keep them in a separate PR - especially as the changes will be visible in the same file instead of having to compare the old and new files side by side).

Why?

We want to migrate to the k6 Cloud API v6 for k6 cloud commands. This is a preliminary work that should help adding support to configure the default stack used by Cloud commands. Then, we'll iterate on it to add more features and use them in the Cloud commands.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

Part of #4008 and #5009

@AgnesToulet AgnesToulet requested a review from a team as a code owner November 28, 2025 15:49
@AgnesToulet AgnesToulet requested review from inancgumus and oleiade and removed request for a team November 28, 2025 15:49
@AgnesToulet AgnesToulet added this to the v1.5.0 milestone Nov 28, 2025
@AgnesToulet AgnesToulet requested a review from dgzlopes November 28, 2025 15:49
@AgnesToulet AgnesToulet temporarily deployed to azure-trusted-signing November 28, 2025 15:55 — with GitHub Actions Inactive
@AgnesToulet AgnesToulet temporarily deployed to azure-trusted-signing November 28, 2025 15:57 — with GitHub Actions Inactive
Copy link
Contributor

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Do you think it makes sense to add some context to returned error messages to see what went wrong when something fails, such as, "validating token: %w", err?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants