snyk / snyk-gradle-plugin

Basic Snyk CLI plugin for Gradle support
Other
25 stars 19 forks source link

feat: get correct project name #95

Closed sfat closed 5 years ago

sfat commented 5 years ago

What does this PR do? Fixes #93 . Problem was the project name was not being picked correctly.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

lili2311 commented 5 years ago

@sfat before you merge or release new CLI, please could you verify the project works as expected by doing:

sfat commented 5 years ago

@lili2311 I was wondering how to do that. I'll do that, thank you!

sfat commented 5 years ago

I've extended DepTree from snyk-cli-interface to include a new field called newName and made it an optional field. DepTree seems a good place as it used both for single project, but also for multi project like projects. Let me know if I'm going in the right direction.

sfat commented 5 years ago

I've extended DepTree from snyk-cli-interface to include a new field called newName and made it an optional field. DepTree seems a good place as it used both for single project, but also for multi project like projects. Let me know if I'm going in the right direction.

I've talked yesterday with @miiila regarding the DepTree and he suggested to add the new name field in the ScannedProject.meta.

This will contain an array (maybe needed for multi level projects where you would have multiple names) of type map, where the key of the map is the old name and the value is the new name.

[
   ["multi-project-parallel","root-proj"],
   ["multi-project-parallel/subproj0","root-proj/subproj0"],
   ["multi-project-parallel/subproj1","root-proj/subproj1"],
   ["multi-project-parallel/subproj2","root-proj/subproj2"],
   ["multi-project-parallel/subproj3","root-proj/subproj3"],
   ["multi-project-parallel/subproj4","root-proj/subproj4"],
]

The reason for this change is that @miiila was saying that DepTree isn't an appropriate data structure for the old/new name convention and is more of a meta information that will be used elsewhere.

Again, let me know if this is okay or you have other ideas.

sfat commented 5 years ago

related this this one: https://github.com/snyk/snyk-cli-interface/pull/20

snyksec commented 5 years ago

:tada: This PR is included in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: