Skip to content

fix: ensure name is not empty for NuGet projects run from root#6560

Merged
thomasschafer merged 1 commit intomainfrom
fix/ensure-name-is-not-empty-nuget
Feb 23, 2026
Merged

fix: ensure name is not empty for NuGet projects run from root#6560
thomasschafer merged 1 commit intomainfrom
fix/ensure-name-is-not-empty-nuget

Conversation

@thomasschafer
Copy link
Copy Markdown
Contributor

@thomasschafer thomasschafer commented Feb 19, 2026

Pull Request Submission Checklist

  • Follows CONTRIBUTING guidelines
  • Commit messages
    are release-note ready, emphasizing
    what was changed, not how.
  • Includes detailed description of changes
  • Contains risk assessment (Low | Medium | High) - Low
  • Highlights breaking API changes (if applicable) - n/a
  • Links to automated tests covering new functionality
  • Includes manual testing instructions (if necessary)
  • Updates relevant GitBook documentation (PR link: ___) - n/a
  • Includes product update to be announced in the next stable release notes - n/a

What does this PR do?

We've had a support ticket from a customer who is running snyk sbom --all-projects ... from G:\ which results in empty project names, leading the entire SBOM generation to fail. This was due to a bug in the Nuget plugin (fixed here) where an empty string was returned for the name when the CLI was run from root directories such as G:\ or /. This PR fixes that issue by adding a fallback case derived from the project path.

How should this be manually tested?

Run the following with a local build of the CLI, replacing <path/to/project.assets.json> with a valid path to a NuGet manifest file:

cd /
<path/to/cli> sbom --format=cyclonedx1.6+json --file=<path/to/project.assets.json>

On main you should see an error like

 ERROR   Bad request (SNYK-0003)
         The server cannot process the request due to a client error, such as malformed
         request syntax, size too large, invalid request message framing, or deceptive
         request routing. Review the request and try again.

           The request body is invalid.

Status:  400 Bad Request
Docs:    https://docs.snyk.io/scan-with-snyk/error-catalog#snyk-0003

but pointing to this branch you should see a valid SBOM.

What's the product update that needs to be communicated to CLI users?

None

@thomasschafer thomasschafer force-pushed the fix/ensure-name-is-not-empty-nuget branch 2 times, most recently from fdd95c0 to 71f5127 Compare February 19, 2026 15:22
@thomasschafer thomasschafer marked this pull request as ready for review February 19, 2026 17:27
@thomasschafer thomasschafer requested review from a team as code owners February 19, 2026 17:27
@thomasschafer thomasschafer changed the title fix: ensure name is not empty for Nuget projects run from root fix: ensure name is not empty for NuGet projects run from root Feb 19, 2026
@snyk-pr-review-bot

This comment has been minimized.

@thomasschafer thomasschafer force-pushed the fix/ensure-name-is-not-empty-nuget branch from 71f5127 to d0bbb50 Compare February 20, 2026 14:20
@snyk-pr-review-bot

This comment has been minimized.

@thomasschafer thomasschafer force-pushed the fix/ensure-name-is-not-empty-nuget branch from d0bbb50 to c043553 Compare February 23, 2026 12:20
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Feb 23, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected
📚 Repository Context Analyzed

This review considered 3 relevant code sections from 2 files (average relevance: 1.00)

@thomasschafer thomasschafer merged commit 07733cc into main Feb 23, 2026
9 checks passed
@thomasschafer thomasschafer deleted the fix/ensure-name-is-not-empty-nuget branch February 23, 2026 14:51
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.

2 participants