Skip to content

Fix options parsing error printing the most of the options #4629

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

Merged
merged 5 commits into from
Mar 13, 2025

Conversation

mstoykov
Copy link
Contributor

What?

Make the error message not print practically the whole options on error.

Why?

The original idea of #4602 was to report at least the key with potentially the option in question. Due to the lack of support from the error - it can't parse it. The commit was trying to get everything between the previous and next new line.

But in practice was getting anything until the end, both because of error in the coed to get the index, but also because there were no newlines due to how we marshal the data before that.

This should fix both and make it less likely we just get everything until the end.

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 k6-documentation: grafana/k6-docs#PR-NUMBER
  • I have updated the TypeScript definitions: grafana/k6-DefinitelyTyped#PR-NUMBER
  • I have updated the release notes: link

Related PR(s)/Issue(s)

The original idea of #4602 was to report at least the key with
potentially the option in question. Due to the lack of support from the
error - it can't parse it. The commit was trying to get everything
between the previous and next new line.

But in practice was getting anything until the end, both because of
error in the coed to get the index, but also because there were no
newlines due to how we marshal the data before that.

This should fix both and make it less likely we just get everything
until the end.
@mstoykov mstoykov added this to the v1.0.0-rc1 milestone Mar 13, 2025
@mstoykov mstoykov requested a review from a team as a code owner March 13, 2025 09:44
@mstoykov mstoykov requested review from codebien and olegbespalov and removed request for a team March 13, 2025 09:44
Co-authored-by: Oleg Bespalov <oleg.bespalov@grafana.com>
olegbespalov
olegbespalov previously approved these changes Mar 13, 2025
Co-authored-by: Ivan <2103732+codebien@users.noreply.github.com>
@mstoykov
Copy link
Contributor Author

I will squash this at the end

@mstoykov mstoykov merged commit 420a012 into master Mar 13, 2025
28 checks passed
@mstoykov mstoykov deleted the uxOptionsErrorFixes branch March 13, 2025 13:53
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.

3 participants