-
Notifications
You must be signed in to change notification settings - Fork 146
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
API changes to support SPDX 3.0 #924
base: main
Are you sure you want to change the base?
Conversation
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
…s other breaking changes
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
|
||
namespace Microsoft.Sbom.Api.Workflows.Helpers; | ||
|
||
public interface IJsonSerializationStrategy |
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.
I'm not seeing this interface in any test classes. Is that a gap we should address?
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.
This is tested in the workflow tests where there are UTs to switch to different serialization strategies based on the manifest version. So I don't think that there's necessarily a gap here.
src/Microsoft.Sbom.Api/Executors/JsonSerializationStrategyFactory.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Sbom.Api/Workflows/Helpers/ExternalDocumentReferenceGenerator.cs
Show resolved
Hide resolved
src/Microsoft.Sbom.Api/Workflows/Helpers/ExternalDocumentReferenceGenerator.cs
Outdated
Show resolved
Hide resolved
@@ -100,4 +102,25 @@ public async Task When_GenerateSbomAsync_WithNoRecordedErrors_Then_EmptyEntityEr | |||
mockRecorder.Verify(); | |||
mockWorkflow.Verify(); | |||
} | |||
|
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.
Code coverage for the generator hits most of the happy paths, but leaves a lot of error cases untouched. Should we try to cover more of the error paths?
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.
I cover most of the SPDX 30 generation cases in \source\repos\sbom-tool\test\Microsoft.Sbom.Parsers.Spdx30SbomParser.Tests\Parser\GeneratorTests.cs
. This file is specifically for api generator tests, which didn't change much because I didn't have to add any api params to the generator (compared to the parser which had an actual api param change).
If there's a code coverage report or something that's not covered specifically, I can take a look, feel free to lmk what you think
test/Microsoft.Sbom.Api.Tests/Workflows/ManifestGenerationWorkflowTests.cs
Outdated
Show resolved
Hide resolved
test/Microsoft.Sbom.Api.Tests/Workflows/SbomParserBasedValidationWorkflowTests.cs
Outdated
Show resolved
Hide resolved
@@ -379,4 +464,143 @@ public async Task SbomParserBasedValidationWorkflowTests_ReturnsSuccessAndValida | |||
fileSystemMock.VerifyAll(); | |||
osUtilsMock.VerifyAll(); | |||
} | |||
|
|||
[TestMethod] | |||
public async Task SbomParserBasedValidationWorkflowTests_SetsComplianceStandard_Succeeds() |
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.
Code smell: If we need to have > 100 lines of code to run a 2 line test, we probably have some fundamental problems with our interface story
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.
Since I am setting the compliance standard in the workflow (when the parser gets created), all of these mocks are created in order to run the workflow which will set the compliance standard that I am asserting for.
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.
Maybe I can create a work item to take this issue up in a separate PR? I think it would involve some extensive rewriting of interfaces
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
this.recorder = recorder; | ||
this.generationData = this.SbomConfig.Recorder.GetGenerationData(); |
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.
At construction, SbomConfig
is null, so this is throwing a NullReferenceException
. If the intent is to call SbomConfig.Recorder.GetGenerationData
only once, you need to defer the call until after SbomConfig
has been set. You could initialize it in the setter for SbomConfig
, or you can defer reading it from SbomConfig
until generationData
is actually read. Happy to discuss this directly, if you wish.
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.
I had initially moved it to the constructor since we didn't want to have this.
outside of the constructor, but I don't think there's a way around that here since sbomConfig needs to be set before calling GetGenerationData()
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
This PR changes files in the API project. Does it change any of the API interfaces in any way? Please note that this includes the following types of changes:
Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: Option 1 - Publish this as a breaking change
Option 2 - Refactor the changes to be non-breaking
|
/azp run |
parse SbomFileExample.txt -complianceStandard NTIA