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

fix: fix project name override with sub projects #4837

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

xzhou-snyk
Copy link
Contributor

@xzhou-snyk xzhou-snyk commented Sep 5, 2023

What does this PR do?

When we scan a mono repo where in the root dir there's no project config but only sub dirs containing sub projects, e.g. like following

my-mono-repo
- project-a
  - settings.gradle
  - build.gradle 
- project-b
  - settings.gradle
  - build.gradle

We noticed that when doing snyk monitor instead of creating two projects, it creates one my-mono-repo project and the vulnerabilities found in the sub projects are overriding, and the Explore this snapshot at message printed out locally points to exactly the same remote URL.

We found that this issue is caused by that the project-name is missing as part of the meta data.

This PR supplies that missing project-name. The fixing has been tested locally and works well.

Screenshots

Before:
Screenshot 2023-09-05 at 17 29 28

After:
Screenshot 2023-09-05 at 17 29 34

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

Warnings
⚠️

Since the CLI is unifying on a standard and improved tooling, we're starting to migrate old-style imports and exports to ES6 ones.
A file you've modified is using either module.exports or require(). If you can, please update them to ES6 import syntax and export syntax.
Files found:

  • src/cli/commands/monitor/index.ts
⚠️

You've modified files in src/ directory, but haven't updated anything in test folder. Is there something that could be tested?

Generated by 🚫 dangerJS against 0a3d355

@xzhou-snyk xzhou-snyk force-pushed the fix/fix-sub-projects-name-override branch 3 times, most recently from 29b3686 to 64cc866 Compare September 6, 2023 08:04
@xzhou-snyk xzhou-snyk marked this pull request as ready for review September 6, 2023 08:10
@xzhou-snyk xzhou-snyk requested a review from a team as a code owner September 6, 2023 08:10
@xzhou-snyk xzhou-snyk force-pushed the fix/fix-sub-projects-name-override branch 6 times, most recently from c9731dd to 0f70c3a Compare September 8, 2023 07:50
@xzhou-snyk xzhou-snyk force-pushed the fix/fix-sub-projects-name-override branch from 0f70c3a to 0a3d355 Compare September 8, 2023 11:14
@xzhou-snyk xzhou-snyk enabled auto-merge (squash) September 8, 2023 11:14
@xzhou-snyk xzhou-snyk merged commit b123ea8 into master Sep 8, 2023
11 checks passed
@xzhou-snyk xzhou-snyk deleted the fix/fix-sub-projects-name-override branch September 8, 2023 16:32
@Greg-Smulko
Copy link

Greg-Smulko commented Sep 15, 2023

Hey, is it possible that this change resulted in my list of projects looking like this:

image

as opposed to this:

image

?

(btw, reported the problem as https://support.snyk.io/hc/en-us/requests/59960)

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.

3 participants