Conversation
|
Make changes for this as well thanks! https://github.com/aboutcode-org/vulnerablecode/blob/main/vulnerabilities/pipelines/v2_importers/gitlab_importer.py |
|
@TG1999 I modified the V2 importer as well |
a33f85b to
c56e940
Compare
| from vulnerabilities.utils import build_description | ||
| from vulnerabilities.utils import get_advisory_url | ||
| from vulnerabilities.utils import get_cwe_id | ||
| from vulntotal.datasources.gitlab import get_casesensitive_slug |
There was a problem hiding this comment.
@keshav-space what do you think is it a good idea to import vulntotal functions in vcio ? Or shall we create separate functions here ?
There was a problem hiding this comment.
@michaelehab , also spdx license is missing in Gitlab vulntotal datasource. We need to have that before using it in our VCIO importers. https://github.com/aboutcode-org/vulnerablecode/blob/main/vulntotal/datasources/gitlab.py#L30
There was a problem hiding this comment.
what do you think is it a good idea to import vulntotal functions in vcio ?
We can import it from VulnTotal for now. Later on we can extract these out in common utility.
There was a problem hiding this comment.
@michaelehab , also spdx license is missing in Gitlab vulntotal datasource. We need to have that before using it in our VCIO importers. https://github.com/aboutcode-org/vulnerablecode/blob/main/vulntotal/datasources/gitlab.py#L30
I believe we discussed this in an earlier meeting where we said that the package-first API endpoint won't be enabled by default and users have to enable it locally which is like using vulntotal when it comes to license, that's even why I reused the vulntotal functions in VCIO's package-first mode.
* Add Gitlab Live V2 Importer * Add tests for the Gitlab Live V2 Importer * Tested functionally using the Live Evaluation API in #1969 Signed-off-by: Michael Ehab Mikhail <michael.ehab@hotmail.com>
bc7d2ea to
79429df
Compare
keshav-space
left a comment
There was a problem hiding this comment.
Thanks @michaelehab, pipeline steps are looking good. few nits for your consideration.
There was a problem hiding this comment.
IMHO this should be inside vulnerabilities/pipelines/v2_importers/gitlab_importer.py
There was a problem hiding this comment.
I guess it will be better if we merge #1969 first, it adds the live evaluation API which directly utilizes the LIVE_IMPORTERS_REGISTRY.
| def advisory_dict_to_advisory_data( | ||
| advisory: dict, | ||
| purl_type_by_gitlab_scheme, | ||
| gitlab_scheme_by_purl_type, | ||
| logger, | ||
| purl=None, | ||
| advisory_url=None, | ||
| ): | ||
| """ | ||
| Convert a GitLab advisory dict to AdvisoryDataV2. | ||
| """ |
There was a problem hiding this comment.
This has lots of duplicate with
vulnerablecode/vulnerabilities/pipelines/v2_importers/gitlab_importer.py
Lines 176 to 304 in dcb0511
parse_gitlab_advisory smaller function.
There was a problem hiding this comment.
I've adressed this in my latest commit by extracting the shared logic into a common file so we can avoid duplicate code, thanks for pointing out.
…icate code #1903 Signed-off-by: Michael Ehab Mikhail <michael.ehab@hotmail.com>


Solves #1903