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: multi level auto detect #932

Merged
merged 1 commit into from
Jan 7, 2020
Merged

Conversation

orsagie
Copy link
Contributor

@orsagie orsagie commented Dec 29, 2019

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

What does this PR do?

Add support to CLI to auto detect projects in multiple level deep folders.
Added --detection-depth CLI argument to support user supplied folder depth to search.

How should this be manually tested?

snyk test --all-projects --detection-depth=2

To detect all projects in current directory and one subfolder.

What are the relevant tickets?

BST-1118

Screenshots

snyk test test/acceptance/workspaces/large-mono-repo --all-projects --detection-depth=2
Screenshot 2020-01-06 at 16 13 37

@orsagie orsagie requested a review from a team as a code owner December 29, 2019 14:00
@orsagie orsagie changed the title Feat/multi level auto detect feat: multi level auto detect Dec 29, 2019
@ghost ghost requested review from dkontorovskyy and lili2311 December 29, 2019 14:00
@dkontorovskyy dkontorovskyy force-pushed the feat/multi-level-auto-detect branch 3 times, most recently from f8ea93e to e8061fa Compare December 29, 2019 15:52
src/cli/args.ts Outdated Show resolved Hide resolved
@gitphill gitphill self-assigned this Jan 6, 2020
@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch from 60f62e3 to 1730f83 Compare January 6, 2020 10:05
@lili2311 lili2311 force-pushed the feat/multi-level-auto-detect branch from 1730f83 to 9927aa5 Compare January 6, 2020 14:46
@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch 2 times, most recently from 69ef728 to 2b971a6 Compare January 6, 2020 15:04
@lili2311 lili2311 force-pushed the feat/multi-level-auto-detect branch from 56ec020 to 79d06b9 Compare January 6, 2020 15:29
@@ -26,9 +26,12 @@ export async function getMultiPluginResult(
const allResults: ScannedProjectCustom[] = [];
for (const targetFile of targetFiles) {
const optionsClone = _.cloneDeep(options);
optionsClone.file = path.basename(targetFile);
optionsClone.file = path.relative(
Copy link
Contributor

Choose a reason for hiding this comment

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

make targetFile relative to the root where the command was run

@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch 4 times, most recently from 1ef861f to 0d181b9 Compare January 6, 2020 16:53
@lili2311 lili2311 force-pushed the feat/multi-level-auto-detect branch 3 times, most recently from 0189f2d to 755d3d0 Compare January 6, 2020 18:18
@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch from 755d3d0 to 8b5ae16 Compare January 6, 2020 18:51
@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch from 4c7f48e to e302a5c Compare January 6, 2020 19:14
Add --detection-depth arg.
Add tests for detection-depth arg to test and monitor.
Ensure targetFile is not sent when plugin does not require it (retains
project name on existing projects).
@gitphill gitphill force-pushed the feat/multi-level-auto-detect branch from b47e644 to 5eccd37 Compare January 7, 2020 09:30
Copy link
Contributor

@lili2311 lili2311 left a comment

Choose a reason for hiding this comment

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

🚀

@gitphill gitphill merged commit 1d2e226 into master Jan 7, 2020
@gitphill gitphill deleted the feat/multi-level-auto-detect branch January 7, 2020 11:19
@snyksec
Copy link

snyksec commented Jan 7, 2020

🎉 This PR is included in version 1.275.0 🎉

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
5 participants