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

Include property to indicate Snyk is scanning #222

Closed
wants to merge 1 commit into from

Conversation

pergardebrink
Copy link

@pergardebrink pergardebrink commented Sep 19, 2024

With a property for the publish process, we can detect this in our csproj files and use msbuild conditionals for targets or others that breaks or slows down Snyk scanning.

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

What does this PR do?

This will add a property that can be used to detect that the build process is initiated by a Snyk test. This can be helpful in cases there are targets in the csproj files that should not run during this process because it would break, or because it is time consuming.

The name of the property is absolutely up for discussion as this is more to initiate the discussion on the property itself

Where should the reviewer start?

How should this be manually tested?

Add a conditional on a target or property in a csproj that is not running when the property is set to true: https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-conditions?view=vs-2022

Any background context you want to provide?

We are seeing this issue with the .NET improved scanning running in the Snyk infrastructure where some pieces are missing there and that prevents us from importing some projects. So we would like both the Snyk CLI and the SCM native integration to both provide a property we can use to detect when Snyk is running and avoid those targets that breaks the build (as they are not relevant to find the dependencies).

What are the relevant tickets?

https://support.snyk.io/hc/en-us/requests/91175

Screenshots

Additional questions

With a property for the publish process, we can detect this in our csproj files and use msbuild conditionals for targets or others that breaks or slows down Snyk scanning.
@pergardebrink pergardebrink requested a review from a team as a code owner September 19, 2024 08:39
@CLAassistant
Copy link

CLAassistant commented Sep 19, 2024

CLA assistant check
All committers have signed the CLA.

@dotkas
Copy link
Contributor

dotkas commented Sep 27, 2024

LGTM, I understand the problem, but maybe hold off merging it until you have green light in the support ticket.

@37IulianPopovici
Copy link
Contributor

Hey @pergardebrink, thanks for raising this, the change was released for SCM few days ago, and now it's also released for the latest preview version of the CLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants