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

fix snyk wizard run error on last step in npm apps or yarn apps. #87

Closed

Conversation

TaopaiC
Copy link

@TaopaiC TaopaiC commented Jun 5, 2017

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

When running snyk wizard, it fails and shows an error: Cannot read property 'name' of undefined at last step.

It is caused by sending incorrect information into snyk.monitor.

How should this be manually tested?

for yarn apps, we can test it in the test folder:

cd test/acceptance/workspaces/yarn-app
node ../../../../cli/index.js wizard

for npm app:

cd test/acceptance/workspaces/npm-package
node ../../../../cli/index.js wizard

@CLAassistant
Copy link

CLAassistant commented Jun 5, 2017

CLA assistant check
All committers have signed the CLA.

@adrukh
Copy link
Contributor

adrukh commented Jun 5, 2017

@TaopaiC thanks a lot for this!
Can you provide an example that reproduces this type of failure?

@TaopaiC
Copy link
Author

TaopaiC commented Jun 5, 2017

Hi @adrukh ,

I used the npm app in test/acceptance/workspaces/npm-package and yarn app in test/acceptance/workspaces/yarn-app.

  • node -v: v7.10.0
  • npm -v: 4.2.0
  • yarn --version: 0.24.6
# pctao @ Taos-MBP in ~/code/snyk on git:master o [3:55:51]
$ cd test/acceptance/workspaces/npm-package

# pctao @ Taos-MBP in ~/code/snyk/test/acceptance/workspaces/npm-package on git:master o [3:55:56]
$ npm i
npm WARN [email protected] No repository field.

# pctao @ Taos-MBP in ~/code/snyk/test/acceptance/workspaces/npm-package on git:master o [3:56:00]
$ node ../../../../cli/index.js wizard

Snyk's wizard will:

  * Enumerate your local dependencies and query Snyk's servers for vulnerabilities
  * Guide you through fixing found vulnerabilities
  * Create a .snyk policy file to guide snyk commands such as `test` and `protect`
  * Remember your dependencies to alert you when new vulnerabilities are disclosed

Querying vulnerabilities database...

License issues are not supported by the wizard, use `snyk ignore`

✓ Tested 0 dependencies for known vulnerabilities, no vulnerable paths found.
? Add `snyk test` to package.json file to fail test on newly disclosed vulnerabilities?
This will require authentication via `snyk auth` when running tests. No
Saving .snyk policy file...
Remembering current dependencies for future notifications...
Cannot read property 'name' of undefined

@adrukh
Copy link
Contributor

adrukh commented Jun 5, 2017

Understood, thanks!

adrukh pushed a commit that referenced this pull request Jun 7, 2017
@adrukh
Copy link
Contributor

adrukh commented Jun 7, 2017

@TaopaiC thanks again for this, it is now merged and will be released as 1.34.2 shortly.

Sorry I couldn't merge this PR as is, we have a somewhat convoluted release process for our cli. Mentioned you on the commit message d102a60

@adrukh adrukh closed this Jun 7, 2017
@TaopaiC
Copy link
Author

TaopaiC commented Jun 7, 2017

Thank you :)

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