-
Notifications
You must be signed in to change notification settings - Fork 14
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
Ability to use project name from project.assets.json file #50
Conversation
…e. If you have a big solution where, for example, unit tests for all project are under unit tests folder, snyk will only check the last project it had scanned. Since, we don't want to broke any setups, use "--assets-project-name" switch like: snyk monitor --file=./JobHandlers/VC12.0/JobHandlers.sln --org=coveo-connectors --assets-project-name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think there should be a flag for this behaviour in the future? Would it be more correct to always take the project name from the assets file?
Disclaimer: we wont release this without the flag as it may break existing projects.
Hum, I'm confused. I added the argument "--assets-project-name" to not break the existing projects. |
@orsagie Will you have some time to check the PR this week? |
It looks good now. Approved!
The question about the flag was to gauge if this is a common enough problem that we might not want it behind a flag in the future. Currently the flag is necessary. |
@orsagie Cool thank you! Can you merge it since I don't have write access in this repo? Thanks! |
Merged :) I will see it make it's way to a new version of the CLI |
🎉 This PR is included in version 1.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What does this PR do?
I'm not a JavaScript programmer, please be cool :)
When using "PackageReference" as NuGet package format (project.assets.json), we should use the project name in project.assets.json. This value represents the name of the csproj file, that is, the name we see in Visual Studio.
For example, if you have a project named MyProject:
"project": { "version": "1.0.0", "restore": { "projectUniqueName": "path to csproj", "projectName": "MyProject", "projectPath": "path to csproj", "packagesPath": "path to nuget package cache", "outputPath": "obj folder path",
By default, we use the folder name where the csproj resides. The problem is that if you have a solution containing a lot of projects where multiple projects are under the same folder name, we only get results for the last scanned project.
Example:
projectpath1\Project1\Tests\project1.test.csproj
projectpath2\Project2\Tests\project2.test.csproj
This will be 1 project in Snyk -> Tests
The same behavior could probably happen with csproj using packages.config
Since we don't want to break any existing setups (even if they can be actually broken), I decided to add a command line parameter named "--assets-project-name". I'm open using something else.
For example:
snyk monitor --file=pathtosln --org=snykorg --assets-project-name