Skip to content

Conversation

mstoykov
Copy link
Contributor

What?

Update to k6provider v0.2.0.

Why?

Apart from updating the dependancy this, also now makes it not dependant on k6deps, which allows the future PR to drop it from k6.

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)

@mstoykov mstoykov added this to the v1.4.0 milestone Oct 15, 2025
@mstoykov mstoykov requested a review from pablochacin October 15, 2025 09:29
@mstoykov mstoykov requested a review from a team as a code owner October 15, 2025 09:29
@mstoykov mstoykov requested review from AgnesToulet and inancgumus and removed request for a team October 15, 2025 09:29
@mstoykov mstoykov temporarily deployed to azure-trusted-signing October 15, 2025 09:35 — with GitHub Actions Inactive
@mstoykov mstoykov temporarily deployed to azure-trusted-signing October 15, 2025 09:37 — with GitHub Actions Inactive
inancgumus
inancgumus previously approved these changes Oct 15, 2025
return err
}

deps := make(map[string]string, len(oldDeps))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it is cleaner to make this transformation in analyze

return true
}

// If dependency's constrain is null, assume it is "*" and consider it satisfied.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment should be moved to the place where this if fixed


contraintsSemver, err := semver.NewConstraint(constraints)
if err != nil {
// Let it fail from the k6provider
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment. Why "fail from the k6provider"? If the constraint is not valid, why not fail here?

@mstoykov
Copy link
Contributor Author

@pablochacin I started doing changes and realized we likely want to keep the smever constraints that are already parsed.

Couldn't really figure out if I can have a constraint that is always true (aka the "*") so I dropped it for now.

The future not k6deps code can likely figure more of this out and potentially fix the underlying problem.

@mstoykov mstoykov temporarily deployed to azure-trusted-signing October 16, 2025 08:56 — with GitHub Actions Inactive
@mstoykov mstoykov temporarily deployed to azure-trusted-signing October 16, 2025 08:58 — with GitHub Actions Inactive
Copy link
Contributor

@AgnesToulet AgnesToulet left a comment

Choose a reason for hiding this comment

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

LGTM! Just left a small spelling suggestion.

" it's required to provision a custom binary.")

customBinary, err := l.provisioner.provision(deps)
customBinary, err := l.provisioner.provision(constraintsMapToProvisionDependancy(deps))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
customBinary, err := l.provisioner.provision(constraintsMapToProvisionDependancy(deps))
customBinary, err := l.provisioner.provision(constraintsMapToProvisionDependency(deps))

Nit: TIL that both were correct but for consistency, it would be best to use the same spelling everywhere.

return nil
}

func constraintsMapToProvisionDependancy(deps map[string]*semver.Constraints) k6provider.Dependencies {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
func constraintsMapToProvisionDependancy(deps map[string]*semver.Constraints) k6provider.Dependencies {
func constraintsMapToProvisionDependency(deps map[string]*semver.Constraints) k6provider.Dependencies {

Comment on lines 484 to 485
for name, constrain := range tc.deps {
dep, err := k6deps.NewDependency(name, constrain)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for name, constrain := range tc.deps {
dep, err := k6deps.NewDependency(name, constrain)
for name, constraint := range tc.deps {
dep, err := k6deps.NewDependency(name, constraint)

Not from your PR so feel free to ignore it or update it in a future PR but in case you apply my other comments, you can apply this one as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, for my own understanding, if the goal is to get rid of k6deps in the future, what do we plan for this function?

@mstoykov
Copy link
Contributor Author

I will do this changes in a separate PR so I can rebase my other work on this post merge faster.

Thanks for the comments Agnes 🙇

@mstoykov mstoykov merged commit 6fb55ad into master Oct 17, 2025
43 of 47 checks passed
@mstoykov mstoykov deleted the updateK6Provider branch October 17, 2025 15:35
@mstoykov mstoykov mentioned this pull request Oct 17, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants