-
Notifications
You must be signed in to change notification settings - Fork 2.2k
inso cli scripting first pass #7790
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
|
|
||
| const evalInterceptor = (script: string) => { | ||
| invariant(script && typeof script === 'string', 'eval is called with invalid or empty value'); | ||
| const result = eval(script); |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: javascript.browser.security.eval-detected.eval-detected
a5901e5 to
58219f9
Compare
58219f9 to
802109e
Compare
|
The major contention of this pass
My preference would be to use matching execution contexts so that cli task execution results would always match the UI. |
ihexxa
left a comment
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.
The first seems working and just have some minor comments.
| } | ||
| expect(result.code).toBe(0); | ||
| describe('exit codes are consistent', () => { | ||
| it.each(shouldReturnSuccessCode)('exit code should be 0: %p', async input => { |
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.
👍 Table driven test looks pretty neat.
| } | ||
| }); | ||
|
|
||
| // This function is duplicated in scriptExecutor.ts to run in nodejs |
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 would propose to consider this after the executing mechanism in the CLI side has been proved working well.
9e72cf4 to
68a2002
Compare
motivation: incrementally extend cli features to match app
aim: add the simplest possible implementation which will allow a header to be added by a pre request script, to be confirmed with a test which will rely upon on the script modifying the request
reviewer note
consider running bundle tests against build
consider refactoring opportunities
theres a high chance of future inconsistency with hidden window implementation
future work
closes INS-4144