-
Notifications
You must be signed in to change notification settings - Fork 113
Allow opt-in go cli scanning #12
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
Conversation
|
👋 Hi! It looks like you modified some files in the
If none of the above scenarios apply, feel free to ignore this comment 🙂 |
| "preLaunchTask": "build", | ||
| // If you have changed target frameworks, make sure to update the program path. | ||
| "program": "${workspaceFolder}/src/Microsoft.ComponentDetection/bin/Debug/net6.0/Microsoft.ComponentDetection.dll", | ||
| "program": "${workspaceFolder}/src/Microsoft.ComponentDetection/bin/Debug/netcoreapp3.1/Microsoft.ComponentDetection.dll", |
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.
Tiny thing we missed moving back to netcore 3.1
| catch | ||
| { | ||
| Logger.LogInfo("Failed to detect components using go cli."); | ||
| } |
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.
Can you log the exception here
|
|
||
| private bool IsGoCliManuallyEnabled() | ||
| { | ||
| return EnvVarService.DoesEnvironmentVariableExist("EnableGoCliScan"); |
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.
Can you create a constants class for environment variables? If we're going to create a lot of these, it'll be easier to keep track of.
JamieMagee
left a comment
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.
Couple of small things, but nothing blocking.
Using go cli to scan is more accurate than parsing go.sum files, but go projects aren't always restored in a workflow. This results in go restoring packages in a workflow where it's not required. By allowing an opt-in we give users the power to make the right choice for their specific situations.
We still fall back to manual parsing if go cli fails.