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: protect will not fail when there are not vulns to patch #1297

Merged

Conversation

jasiskis
Copy link
Contributor

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

What does this PR do?

Prevents snyk protect from failing if no vulnerabilities were found.

Without this fix, if the project didn't have vulns it would fail with

 'error-message': 'Code is already patched',
    error: 'CustomError: Code is already patched\n' +
      '    at patch (/Users/andrejasiskis/workspace/snyk/snyk-cli/src/cli/commands/protect/index.ts:92:17)\n' +
      '    at processTicksAndRejections (internal/process/task_queues.js:94:5)\n' +
      '    at runCommand (/Users/andrejasiskis/workspace/snyk/snyk-cli/src/cli/index.ts:49:25)\n' +
      '    at main (/Users/andrejasiskis/workspace/snyk/snyk-cli/src/cli/index.ts:288:11)',

@jasiskis jasiskis requested review from a team as code owners July 28, 2020 13:03
@ghost ghost requested review from ekbsnyk and MegaBean July 28, 2020 13:03
@jasiskis jasiskis force-pushed the fix/protect-shouldnt-fail-when-theres-nothing-to-do branch from 677d1c0 to bf4fd8d Compare July 28, 2020 15:29
@jasiskis jasiskis force-pushed the fix/protect-shouldnt-fail-when-theres-nothing-to-do branch from bf4fd8d to 7e31f59 Compare July 28, 2020 16:20
@github-actions
Copy link
Contributor

github-actions bot commented Jul 28, 2020

Expected release notes (by @andremidea)

features:
docker bundle (a745b64)

fixes:
protect will not fail when there are not vulns to patch (7e31f59)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

Copy link
Contributor

@orsagie orsagie left a comment

Choose a reason for hiding this comment

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

LGTM

@jasiskis jasiskis merged commit 3fc09e1 into master Jul 29, 2020
@jasiskis jasiskis deleted the fix/protect-shouldnt-fail-when-theres-nothing-to-do branch July 29, 2020 11:52
@snyksec
Copy link

snyksec commented Jul 29, 2020

🎉 This PR is included in version 1.369.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants