Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report usages of the deprecated 'ext.loadimpact' option #4084

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

joanlopez
Copy link
Contributor

What?

It adds a new deprecated_options field into the usage reports, and accounts if ext.loadimpact is still being used, and how often.

Why?

Because we likely will remove that option parameter before v1, so we need to make some plans.

Checklist

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

Related PR(s)/Issue(s)

Related with https://github.com/grafana/k6-cloud/issues/2210

@joanlopez joanlopez self-assigned this Dec 2, 2024
@joanlopez joanlopez requested a review from a team as a code owner December 2, 2024 13:02
@joanlopez joanlopez requested review from mstoykov and removed request for a team December 2, 2024 13:02
if err := lct.initRunner.SetOptions(configToReinject); err != nil {
return nil, err
}

// Here, where we get the consolidated options, is where we check if any
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it here because it looks like a considerably safe place among all the places configuration is read/written and manipulated in general, but any suggestion will be more than welcome.

Copy link
Contributor Author

@joanlopez joanlopez Dec 2, 2024

Choose a reason for hiding this comment

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

Also, note that this will be reported despite it's a local (k6 run) or a remote execution (k6 cloud), but I guess it's fine because a script that holds ext.loadimpact is still a candidate of experiencing issues if we remove such support.

In any case, if we want to get more accurate metrics (only cloud executions), we can always account reports with this and a test run id.

@joanlopez joanlopez added this to the v0.56.0 milestone Dec 2, 2024
olegbespalov
olegbespalov previously approved these changes Dec 6, 2024
cmd/test_load.go Outdated
// Here, where we get the consolidated options, is where we check if any
// of the deprecated options is being used, and we report it.
if _, isPresent := configToReinject.External["loadimpact"]; isPresent {
if err := lct.preInitState.Usage.Strings("deprecated_options", "ext.loadimpact"); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

In https://github.com/grafana/k6/pull/4030/files the key is deprecations/<what is deprecated>. I would prefer if we keep the keys more generic and deprecated_options is very specific to options by the looks of it and I do not know of any other option that will make it relevant to have a separate key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, is your suggestion: deprecations/ext.loadimpact?
I'm happy with that one as well, sure!

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess that looks okay - yes. Don't know if we want options somewhere in there, but as a one of case this seems good enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've applied the feedback to get it mergable

mstoykov
mstoykov previously approved these changes Dec 9, 2024
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM, but would prefer if we change the key to be consistent

@olegbespalov olegbespalov dismissed stale reviews from mstoykov and themself via 0c6a6a5 December 16, 2024 10:34
@olegbespalov olegbespalov merged commit 053f3a2 into master Dec 16, 2024
28 checks passed
@olegbespalov olegbespalov deleted the report-loadimpact branch December 16, 2024 16:18
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