Closed dwertent closed 3 months ago
PR Description updated to latest commit (https://github.com/kubescape/storage/commit/1a921cf0da421c17eb6732eb86cb9bda559a62c9)
⏱️ Estimated effort to review [1-5] | 2, because the changes are straightforward and localized to specific functions, but require understanding of the existing data structures and their usage in the system. The addition of tests helps in validating the changes made. |
🧪 Relevant tests | Yes |
🔍 Possible issues | Possible Bug: Ensure that the `MetadataType` assignment does not override any existing data unintentionally. It seems like `MetadataType` is now being explicitly set, which is good, but there should be checks to ensure this does not lead to data integrity issues if `MetadataType` was already set by some other means. |
🔒 Security concerns | No |
Category | Suggestions |
Best practice |
Ensure
___
**Consider checking if |
Ensure
___
**Similar to the suggestion made for | |
Enhancement |
Add test cases for edge cases in
___
**It's recommended to add a test case where |
User description
Sorry, we do not accept changes directly against this repository. Please see CONTRIBUTING.md for information on where and how to contribute instead.
Type
bug_fix, tests
Description
MetadataType
was not being set during the unpacking ofSyftPackage
.SyftPackage
unmarshalling correctly setsID
andMetadataType
.Changes walkthrough
syfttypes.go
Set MetadataType in SyftPackage Unpacking
pkg/apis/softwarecomposition/syfttypes.go - Explicitly set `MetadataType` based on the determined type.
syfttypes.go
Set MetadataType in SyftPackage Unpacking for v1beta1
pkg/apis/softwarecomposition/v1beta1/syfttypes.go - Explicitly set `MetadataType` based on the determined type.
syfttypes_test.go
Add Tests for SyftPackage JSON Unmarshalling
pkg/apis/softwarecomposition/syfttypes_test.go
SyftPackage
JSON unmarshalling.MetadataType
andID
fields after unmarshalling.