Skip to content
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

TODO: Change Formulation and ModelCard schemas to use pointers #79

Open
mrutkows opened this issue Apr 1, 2024 · 2 comments
Open

TODO: Change Formulation and ModelCard schemas to use pointers #79

mrutkows opened this issue Apr 1, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mrutkows
Copy link
Contributor

mrutkows commented Apr 1, 2024

The CycloneDX schema file:

/Users/Matt_1/Projects/CycloneDX/sbom-utility/schema/cyclonedx_formulation.go

defines all the structures used for "formulation" which was added in v1.5; however, these structs should be updated to use pointers to structs in all cases to improve performance during JSON Marshal (decoding).

The same should be done for the added ModelCard data (as part of the Component type):

/Users/Matt_1/Projects/CycloneDX/sbom-utility/schema/cyclonedx_modelcard.go

@mrutkows mrutkows added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 1, 2024
@mrutkows mrutkows changed the title TODO: Change Formulation schema to use pointers TODO: Change Formulation and ModelCard schemas to use pointers Apr 1, 2024
@mohitsethia
Copy link

Hi, I would like to contribute to this issue. Just to confirm that we need to move to using pointer to struct in all the places in cyclonedx_formulation.go, right?
And in cyclonedx_modelcard.go there is only 1 place where pointer to struct is not used, otherwise all the places uses pointer, should I change CDXComponentData to *CDXComponentData?

type CDXDataset struct {
	CDXComponentData
	Ref *CDXRefLinkType `json:"ref,omitempty" cdx:"+1.5"` // v1.5
}

@mrutkows
Copy link
Contributor Author

mrutkows commented Aug 6, 2024

@mohitsethia Hi! Sorry that it took me so long to respond, but July was a very busy month inside my company with a shift in my job role to support AI GPU software stack which has a steep learning curve as well as being on vacation. Would very much like to replace all structure (bindings) to use pointers as the utility now supports "write" (output) for some new commands. I tried very hard to do so for the latest release, but you found a struct member I missed under the model card structs):

Please do submit a PR with the fix (and believe it should pass existing functional tests as we do not have any specific to testing "update"/change of that field)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants