Skip to content

fix: update PURL version when COMPONENT_VERSION is set#108

Merged
vpetersson merged 2 commits intomasterfrom
fix-purl
Jan 15, 2026
Merged

fix: update PURL version when COMPONENT_VERSION is set#108
vpetersson merged 2 commits intomasterfrom
fix-purl

Conversation

@vpetersson
Copy link
Contributor

When COMPONENT_VERSION is used to override the root component version, the PURL was not being updated, leaving an inconsistency between component.version and component.purl.

Changes:

  • Add _update_component_purl_version() helper for CycloneDX components
  • Add _update_spdx_package_purl_version() helper for SPDX packages
  • Update augment_cyclonedx_sbom() and augment_spdx_sbom() to sync PURL
  • Fix broken SPDX version override in _apply_sbom_version_override() that was incorrectly trying to set metadata.component.version (SPDX uses packages[0].versionInfo instead)

The SPDX fix addresses a bug where the version override path was manipulating a non-existent JSON structure, causing version overrides to silently fail for SPDX SBOMs.

When COMPONENT_VERSION is used to override the root component version,
the PURL was not being updated, leaving an inconsistency between
component.version and component.purl.

Changes:
- Add _update_component_purl_version() helper for CycloneDX components
- Add _update_spdx_package_purl_version() helper for SPDX packages
- Update augment_cyclonedx_sbom() and augment_spdx_sbom() to sync PURL
- Fix broken SPDX version override in _apply_sbom_version_override()
  that was incorrectly trying to set metadata.component.version
  (SPDX uses packages[0].versionInfo instead)

The SPDX fix addresses a bug where the version override path was
manipulating a non-existent JSON structure, causing version overrides
to silently fail for SPDX SBOMs.
Copilot AI review requested due to automatic review settings January 15, 2026 16:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an inconsistency where the PURL version was not being updated when COMPONENT_VERSION overrides the root component version, and fixes a broken SPDX version override that was manipulating non-existent JSON structure.

Changes:

  • Added helper functions to update PURL versions in both CycloneDX and SPDX formats
  • Fixed broken SPDX version override to use correct JSON path (packages[0].versionInfo instead of metadata.component.version)
  • Updated augmentation functions to synchronize PURL versions when component version is overridden

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_augmentation_module.py Adds comprehensive test coverage for PURL version updates in both CycloneDX and SPDX formats
sbomify_action/cli/main.py Adds PURL update logic and fixes SPDX version override to use correct JSON structure
sbomify_action/augmentation.py Adds helper functions for updating component PURL versions and integrates them into augmentation flow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson vpetersson requested a review from Copilot January 15, 2026 16:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson vpetersson requested a review from Copilot January 15, 2026 16:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vpetersson vpetersson merged commit 2cc8bdc into master Jan 15, 2026
17 of 20 checks passed
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.

1 participant