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

feat: Add function to find product identification helpers inspecting the tree #505

Merged
merged 8 commits into from
Dec 1, 2023

Conversation

juan131
Copy link
Contributor

@juan131 juan131 commented Nov 10, 2023

Description of the change

This PR adds a new exported method to ProductTree type in the csaf package: FindProductIdentificationHelpers. This method iterates over the product tree and find the product identification helpers associated to a given product id.

Benefits

Easier to obtain product identification helpers given a product id.

Possible drawbacks

None

Applicable issues

Additional information

N/A

…the tree

Signed-off-by: juan131 <jariza@vmware.com>
@juan131
Copy link
Contributor Author

juan131 commented Nov 10, 2023

cc @tschmidtb51 @mpermar

Signed-off-by: juan131 <jariza@vmware.com>
Copy link
Collaborator

@tschmidtb51 tschmidtb51 left a comment

Choose a reason for hiding this comment

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

@juan131 Thank you for your contribution.

The implementation is currently missing the evaluation of the items in relationships (which can also define product_identification_helper). See https://github.com/csaf-poc/csaf_distribution/blob/v3.0.0-rc.1/examples/purls_searcher/main.go as example.

Signed-off-by: juan131 <jariza@vmware.com>
@juan131
Copy link
Contributor Author

juan131 commented Nov 14, 2023

Thanks for the advice @tschmidtb51 ! Implemented at 4338f45

@tschmidtb51
Copy link
Collaborator

I'm currently on a business trip - so it might take a while for me to review it.

@juan131
Copy link
Contributor Author

juan131 commented Nov 20, 2023

Friendly reminder to review this PR when you find the slot for it @tschmidtb51
Thanks in advance

@tschmidtb51
Copy link
Collaborator

Thank you for your contribution. We discussed it today.

As it basically puts the implementation of the example in a more generic case, please also adopt the example to use the new library function.

Also @s-l-teichmann had an idea about callbacks that might be helpful in the library. @s-l-teichmann please explain

@bernhardreiter bernhardreiter added this to the Release 3.0.0-rc.2 milestone Nov 24, 2023
@juan131
Copy link
Contributor Author

juan131 commented Nov 24, 2023

Example adapted at 2e9d4ad @tschmidtb51

@juan131
Copy link
Contributor Author

juan131 commented Nov 30, 2023

@s-l-teichmann @tschmidtb51 friendly reminder

@tschmidtb51
Copy link
Collaborator

@s-l-teichmann Please have a look

@s-l-teichmann
Copy link
Contributor

I will have a look at this.

@s-l-teichmann
Copy link
Contributor

Looks fine to me. The only thing I don't like is the direct creation on the helpers slice.
@juan131 I send juan131#1 to your repo.
But this is minor.

Copy link
Contributor

@s-l-teichmann s-l-teichmann left a comment

Choose a reason for hiding this comment

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

See juan131#1

Separate collecting and visiting of the product id helpers.
@juan131
Copy link
Contributor Author

juan131 commented Dec 1, 2023

Thanks for the feedback @s-l-teichmann ! I applied your suggestions in the PR

Copy link
Contributor

@s-l-teichmann s-l-teichmann left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@JanHoefelmeyer JanHoefelmeyer left a comment

Choose a reason for hiding this comment

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

LGTM

@s-l-teichmann s-l-teichmann dismissed tschmidtb51’s stale review December 1, 2023 14:31

This is implemented by now.

@s-l-teichmann s-l-teichmann merged commit 9073a8a into gocsaf:main Dec 1, 2023
2 checks passed
@juan131 juan131 deleted the feat/find-product-id-helpers branch December 1, 2023 14:49
@juan131
Copy link
Contributor Author

juan131 commented Dec 1, 2023

Thanks everyone for you help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an utility method on the advisory framework to fetch product identifiers
5 participants