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

Draft: Support multiple purl identifiers in product_identification_helper #781

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mprpic
Copy link
Contributor

@mprpic mprpic commented Aug 30, 2024

This allows a vendor to specify multiple purl identifiers for a single component (present as a product version branch in the product tree). Multiple purls may identify the same component but point to different locations from where that component may be available. Thus, it is mandatory that if multiple purls are present in a single
product_identification_helper object, they must only differ in their qualifiers. Otherwise they should be set up as different product tree branches.

Resolves #774

@mprpic mprpic changed the title Support multiple purl identifiers in product_identification_helper Draft: Support multiple purl identifiers in product_identification_helper Aug 30, 2024
@mprpic
Copy link
Contributor Author

mprpic commented Aug 30, 2024

I'm unsure how to modify the examples to get the final text to build. When I run the make command, I get:

$ make build
bin/volatile.py
detected local reference for acknowledgments-type-example-eg-1 in (The example [eg](#acknowledgments-type-example-eg-1) above SHOULD lead to the following outcome in a human-readable advisory:)
The example \[[1](#acknowledgments-type-example-eg-1)\] above SHOULD lead to the following outcome in a human-readable advisory:
Traceback (most recent call last):
  File "/[...]/csaf/csaf_2.1/prose/edit/bin/volatile.py", line 575, in <module>
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
  File "/[...]/csaf/csaf_2.1/prose/edit/bin/volatile.py", line 461, in main
    global_example_num = eg_global_from[magic_label]
                         ~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'purl-eg-2'
make: *** [Makefile:4: build] Error 1

This allows a vendor to specify multiple purl identifiers for a single
component (present as a product version branch in the product tree).
Multiple purls may identify the same component but point to different
locations from where that component may be available. Thus, it is mandatory
that if multiple purls are present in a single
product_identification_helper object, they must only differ in their
qualifiers. Otherwise they should be set up as different product
tree branches.
Comment on lines -54 to -74
"hashes": {
"hashes": [
// ...
},
"model_numbers": {
],
"model_numbers": [
// ...
},
"purl": {
],
"purls": [
// ...
},
"sbom_urls": {
],
"sbom_urls": [
// ...
},
"serial_numbers": {
],
"serial_numbers": [
// ...
},
"skus": {
],
"skus": [
// ...
},
"x_generic_uris": {
],
"x_generic_uris": [
// ...
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should do that in a separate commit to keep the feature changes separate from the editorial ones.

@tschmidtb51
Copy link
Contributor

@mprpic Thank you for the Draft. I didn't had time yet to do a complete review but here are some quick comments:

  • The qualifier test should be a separate one. Also, we need to add
    • valid examples
    • invalid examples
  • The guidance on size needs to be adapted.
  • The editorial change should be separate from the feature change (thanks for catching it).
  • Rebase after Editor revision for TC meeting 2024-08-28 #784 is merged.

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.

Support multiple purl identifiers in product_identification_helper
2 participants