-
Couldn't load subscription status.
- Fork 21
feat: add validation for k6 extensions and version pragmas #1253
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
Conversation
Script size changes
Totals
|
2ec0e80 to
a08a28c
Compare
a08a28c to
6f92b4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a comment but it's quite small so I'm going to approve and leave it to you to decide if you want to address it or not 🙂
|
I've addressed your comments @ckbedwell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel that this change actually checks for JavaScript directives, rather it uses a regular expression to find a match.
monaco is way too advanced for not allowing to check specifically for directives, rather than matches, anywhere.
Also, I'd expect the example directives in k6deps to trigger the error.
Screen.Recording.2025-09-24.105312.mp4 |
962c560 to
fa93bb4
Compare
|
Thanks for the review @w1kman, I've refactored the implementation to use Screen.Recording.2025-09-24.at.17.01.43.mov |
* feat: add custom validation to monaco * fix: improve regex and minor changes * fix: tests * fix: lint --------- Co-authored-by: Virginia Cepeda <[email protected]>
3678373 to
bcf519d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great job! 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ these tests ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LFTM 🥳





Closes #1243
As we're implementing Version Management, check versions will be selected by choosing the corresponding channel from the k6 channel selector (see design doc and slack conversation)
This means setting the version restriction in the script is not encouraged, in fact it's not valid (at least for now) as the backend won't honor it. k6 extensions are also not allowed. For this reason I'm adding the respective UI validation both to the form schema and Monaco editor: