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

Feat:exit code 3 when no projects detected #1386

Merged
merged 4 commits into from
Sep 4, 2020

Conversation

lili2311
Copy link
Contributor

@lili2311 lili2311 commented Sep 3, 2020

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

What does this PR do?

Add a new Exit Code when non supported manifests were detected so we could not conduct a test.
https://github.com/snyk/snyk/issues/1135

Where should the reviewer start?

https://github.com/snyk/snyk/compare/feat/exit-code-for-no-projects#diff-ebd6539fe4cc61b013d83b586f268b8aR93

How should this be manually tested?

snyk test run an empty folder for example

Screen Shot 2020-09-04 at 9 57 09

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2020

Messages
📖 You are modifying something in test/smoke directory, yet you are not on the branch feat/smoke-test. You can rename your branch to feat/smoke-test and Smoke tests will trigger for this PR.

Generated by 🚫 dangerJS against 7c76be1

@lili2311 lili2311 force-pushed the feat/exit-code-for-no-projects branch 4 times, most recently from ae28322 to 255a8e3 Compare September 3, 2020 13:15
@lili2311 lili2311 marked this pull request as ready for review September 3, 2020 13:42
@lili2311 lili2311 requested review from a team as code owners September 3, 2020 13:42
@ghost ghost requested review from dkontorovskyy and orsagie September 3, 2020 13:42
@@ -51,7 +51,9 @@ function executeTest(root, options) {
return results;
});
} catch (error) {
return Promise.reject(chalk.red.bold(error));
return Promise.reject(
chalk.red.bold(error.message ? error.message : error),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix to drop Custom Error from displayed errors.

@lili2311
Copy link
Contributor Author

lili2311 commented Sep 3, 2020

#1387

@@ -10,9 +10,23 @@ Describe "Snyk test command"
snyk test
}

It "throws error when file does not exist"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test passing locally:
Screen Shot 2020-09-04 at 9 49 06

@lili2311 lili2311 force-pushed the feat/exit-code-for-no-projects branch from 255a8e3 to 809a73f Compare September 4, 2020 09:16
@@ -43,6 +43,7 @@ const debug = Debug('snyk');
const EXIT_CODES = {
VULNS_FOUND: 1,
ERROR: 2,
NO_SUPPORTED_MANIFESTS_FOUND: 3,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please also document this somewhere? Readme or help.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2020

Expected release notes (by @lili2311)

features:
exiut code 3 for no detected projects (9151ff0)

others (will not be included in Semantic-Release notes):
update helptext with new exit code (7c76be1)
mount empty fixture for Alpine smoke test (ed2aab1)
refactor & test exit codes (809a73f)

  • I hereby acknowledge these release notes are 🥙 AWESOME 🥙

@lili2311 lili2311 merged commit 4d30f5f into master Sep 4, 2020
@lili2311 lili2311 deleted the feat/exit-code-for-no-projects branch September 4, 2020 11:33
@snyksec
Copy link

snyksec commented Sep 4, 2020

🎉 This PR is included in version 1.389.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lili2311 lili2311 changed the title Feat/exit code for no projects Feat:exit code 3 when no projects detected Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants