-
-
Notifications
You must be signed in to change notification settings - Fork 88
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
CycloneDX.NET finishes successfully when package restore fails #888
Comments
That is the intended behavior. |
Yes, sorry, forgot to add it:
|
First of all, as you set github-username and token you probably want to use --enable-github-licenses. Since 3.0.0 it's disabled by default. |
I cannot reproduce the error. Here is my try: PS E:\src\repos\cyclonedx-dotnet> $LastExitCode
0
PS E:\src\repos\cyclonedx-dotnet> dotnet cyclonedx ..\cdx-enrich\src\CdxEnrich.sln -j -sn "name" -sv 1.0.0
Found the following local nuget package cache locations:
C:\Users\user\.nuget\packages\
Scanning at E:\src\repos\cdx-enrich\src\CdxEnrich.sln
» Solution: E:\src\repos\cdx-enrich\src\CdxEnrich.sln
Getting projects
» Analyzing: E:\src\repos\cdx-enrich\src\CdxEnrich\CdxEnrich.csproj
Getting project references
No project references found
» Analyzing: E:\src\repos\cdx-enrich\src\CdxEnrich.Tests\CdxEnrich.Tests.csproj
Getting project references
» Analyzing: E:\src\repos\cdx-enrich\src\CdxEnrich\CdxEnrich.csproj
Getting project references
No project references found
2 project(s) found
» Analyzing: E:\src\repos\cdx-enrich\src\CdxEnrich\CdxEnrich.csproj
Attempting to restore packages
Packages restored
» Analyzing: E:\src\repos\cdx-enrich\src\CdxEnrich.Tests\CdxEnrich.Tests.csproj
Attempting to restore packages
Dotnet restore failed:
Determining projects to restore...
E:\src\repos\cdx-enrich\src\CdxEnrich.Tests\CdxEnrich.Tests.csproj : error NU1101: Unable to find package Verify. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Package source
Failed to restore E:\src\repos\cdx-enrich\src\CdxEnrich.Tests\CdxEnrich.Tests.csproj (in 217 ms).
1 of 2 projects are up-to-date for restore.
PS E:\src\repos\cyclonedx-dotnet> $LastExitCode
5 Also, I cannot see any way in the flow of the program that it could leave the program without writing the output file, but still returning 0. See here: https://github.com/CycloneDX/cyclonedx-dotnet/blob/master/CycloneDX/Runner.cs#L423-L426 Can you reproduce the problem outside your pipeline? |
This issue is stale because it has been open for 3 months with no activity. |
Hi,
I'm using version
3.0.5
and recently noticed that in case solution package restore fails CycloneDX.NET does not generate BOM file and finishes successfully. This makes our BOM builds to continue and fail at a later point because BOM file is not found.Wouldn't it be better that CycloneDX.NET exits with a code that indicates failure?
Here is an example of shortened build output with key points in bold:
The text was updated successfully, but these errors were encountered: