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: scan gradle projects behind --all-projects #1310

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

lili2311
Copy link
Contributor

@lili2311 lili2311 commented Aug 5, 2020

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

TODO

[x] Add monitor test
[x] Update the test --all-projects to assert allSubProjects is passed

What does this PR do?

  • Scan build.gradle files behind --all-projects flag with an implied --all-sub-projects to scan everything at once.
  • Update the find() function to only detect root level build.gradle files for projects and not scan any nested files unnecessarily

Where should the reviewer start?

https://github.com/snyk/snyk/compare/feat/enable-gradle-all-projects?expand=1#diff-46067fcff3540c568100c842d5c0f6a4R190

How should this be manually tested?

snyk test --all-projects in the test/acceptance/workspaces should now also return gradle results.

Screenshots

Screen Shot 2020-08-06 at 16 41 44

Screen Shot 2020-08-06 at 14 45 36

@lili2311 lili2311 self-assigned this Aug 5, 2020
@lili2311 lili2311 force-pushed the feat/enable-gradle-all-projects branch 18 times, most recently from ab9c63e to aa6f1d6 Compare August 6, 2020 14:40
maybePrintDepGraph(options, projectDeps.depGraph);
projectName = projectDeps.depGraph.rootPkg.name;
projectName =
projectDeps.meta.gradleProjectName ||
Copy link
Contributor Author

Choose a reason for hiding this comment

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

display the correct gradle project name if present

@@ -547,34 +547,6 @@ export const AllProjectsTests: AcceptanceTests = {
);
},

'`test large-mono-repo with --all-projects and --detection-depth=2`': (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the test below covers this one too, seems unnessesary

@lili2311 lili2311 force-pushed the feat/enable-gradle-all-projects branch 4 times, most recently from 457f8f4 to ffea250 Compare August 6, 2020 15:34
@@ -129,23 +129,28 @@ function filterForDefaultManifests(files: string[]) {
...pathLib.parse(p),
packageManager: detectProjectTypeFromFile(p),
}))
.sortBy('dir')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

important so we find the folders higher up first

@lili2311 lili2311 force-pushed the feat/enable-gradle-all-projects branch from ffea250 to 3b227a2 Compare August 6, 2020 15:42
@lili2311 lili2311 marked this pull request as ready for review August 6, 2020 15:44
@lili2311 lili2311 requested a review from a team as a code owner August 6, 2020 15:44
@lili2311 lili2311 requested a review from a team as a code owner August 6, 2020 15:44
@ghost ghost requested review from aviadhahami and gitphill August 6, 2020 15:44
@lili2311 lili2311 force-pushed the feat/enable-gradle-all-projects branch from 3b227a2 to 7c2a2af Compare August 6, 2020 15:58
@lili2311 lili2311 force-pushed the feat/enable-gradle-all-projects branch from 7c2a2af to a2bfc89 Compare August 6, 2020 18:08
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2020

Expected release notes (by @lili2311)

features:
scan gradle projects behind --all-projects (a2bfc89)

others (will not be included in Semantic-Release notes):
e02e527 chore:updated gitignore with vscode folder

  • 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

@lili2311 lili2311 merged commit b79f0cf into master Aug 10, 2020
@lili2311 lili2311 deleted the feat/enable-gradle-all-projects branch August 10, 2020 14:50
@snyksec
Copy link

snyksec commented Aug 10, 2020

🎉 This PR is included in version 1.372.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants