Refactor GenerationResult to restore the original behavior of writing JSON arrays for SPDX 2.2 by pragnya17 · Pull Request #975 · microsoft/sbom-tool (original) (raw)

Conversation

@pragnya17

The previous SBOM tool (version 3.1) created SPDX 2.2 SBOMs by ending JSON arrays if it was started. A JSON array is started if the sbomConfig supports it. Then, we iterated through all the supporting sbomConfigs to end the JSON array.

However, during the refactoring of code to support SPDX 3.0, this logic was changed and we instead started relying on if the array was empty or not in order to end JSON array. This PR reverts that behavior change by refactoring the GenerationResult class to include if the JSON array was started or not. This condition is then used to end the JSON array.

ppandrate and others added 10 commits

March 13, 2025 14:51

…andrate_spdx3.0ExternalDocRefsBug

@pragnya17

…cRef GenerationResult. Add documentation.

@github-actions

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

  1. Update the documentation to show the new functionality
  2. Bump the major version in the next release
  3. Be sure to highlight the breaking changes in the release notes

Option 2 - Refactor the changes to be non-breaking

  1. Review this commit, which adds a new interface in a backward-compatible way
  2. Refactor the change to follow this pattern so that existing interfaces are left completely intact
  3. Bump the minor version in the next release

@pragnya17

@pragnya17 pragnya17 changed the titleRefactor generation result Refactor GenerationResult to restore the original behavior of writing JSON arrays for SPDX 2.2

Mar 15, 2025

DaveTryon

@pragnya17

@github-actions

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

  1. Update the documentation to show the new functionality
  2. Bump the major version in the next release
  3. Be sure to highlight the breaking changes in the release notes

Option 2 - Refactor the changes to be non-breaking

  1. Review this commit, which adds a new interface in a backward-compatible way
  2. Refactor the change to follow this pattern so that existing interfaces are left completely intact
  3. Bump the minor version in the next release

@pragnya17

DaveTryon

ppandrate and others added 2 commits

March 18, 2025 12:57

@pragnya17

@github-actions

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

  1. Update the documentation to show the new functionality
  2. Bump the major version in the next release
  3. Be sure to highlight the breaking changes in the release notes

Option 2 - Refactor the changes to be non-breaking

  1. Review this commit, which adds a new interface in a backward-compatible way
  2. Refactor the change to follow this pattern so that existing interfaces are left completely intact
  3. Bump the minor version in the next release

@pragnya17

@github-actions

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

  1. Update the documentation to show the new functionality
  2. Bump the major version in the next release
  3. Be sure to highlight the breaking changes in the release notes

Option 2 - Refactor the changes to be non-breaking

  1. Review this commit, which adds a new interface in a backward-compatible way
  2. Refactor the change to follow this pattern so that existing interfaces are left completely intact
  3. Bump the minor version in the next release

DaveTryon

@pragnya17

@github-actions

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

  1. Update the documentation to show the new functionality
  2. Bump the major version in the next release
  3. Be sure to highlight the breaking changes in the release notes

Option 2 - Refactor the changes to be non-breaking

  1. Review this commit, which adds a new interface in a backward-compatible way
  2. Refactor the change to follow this pattern so that existing interfaces are left completely intact
  3. Bump the minor version in the next release

@pragnya17

@pragnya17 pragnya17 deleted the ppandrate_refactorGenerationResult branch

March 18, 2025 21:31

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

2 participants

@pragnya17 @DaveTryon