Fix: Collect data from Anchore NVD overrides#1773
Fix: Collect data from Anchore NVD overrides#1773Dedsec0098 wants to merge 5 commits intoaboutcode-org:mainfrom
Conversation
…ES.rst and __init__.py Signed-off-by: Shrish Mishra <shrish409@gmail.com> Signed-off-by: Shrish0098 <shrish409@gmail.com>
| from vulnerabilities.pipelines import nvd_importer | ||
| from vulnerabilities.pipelines import pypa_importer | ||
| from vulnerabilities.pipelines import pysec_importer | ||
| from vulnerabilities.pipelines.anchore_importer import AnchoreImporterPipeline |
There was a problem hiding this comment.
Please follow the import style, take example from above. Thanks!
| affected_packages=[affected_package], | ||
| references=references, | ||
| date_published=date_published, | ||
| ) No newline at end of file |
|
Sure I'll definitely do the changes in this branch |
…h409@gmail.com> Signed-off-by: Shrish0098 <shrish409@gmail.com>
|
Hey @TG1999 I have fixed the issues that you told me, can you please review it and let me know if any further changes are required. |
Signed-off-by: Shrish0098 <shrish409@gmail.com>
|
@TG1999 I have made the changes and it is passing all the tests on my local machine. Pease review it and let me know if any changes are to be made. |
|
@Dedsec0098 looks good mostly, please add tests ! |
sure, i'll add them |
keshav-space
left a comment
There was a problem hiding this comment.
@Dedsec0098, your code is entirely AI generated code. In fetch_data you're fetching data from https://raw.githubusercontent.com/anchore/nvd-data-overrides/main/overrides.yaml, but there is no overrides.yaml file at https://github.com/anchore/nvd-data-overrides. Your parse_advisory_data function is completely crap, there is no package_name or affected_versions field in the NVD overrides data. In fact NVD overrides data are available in JSON format, not YAML.
It seems you never bothered to look at the actual NVD override data at https://github.com/anchore/nvd-data-overrides/tree/main/data and you never ran your pipeline locally. You just entered the prompt and pasted your code here, without putting in an iota of intellectual effort. We maintainers may be busy but we are not fools who will fall for entirely generated code that clearly doesn't work. Simply flooding the project with bunch of generated code will get you nowhere.
This is sad and grave injustice to genuine contributors who put time and intellectual effort into their contributions. A PR like this is a waste of time that could have otherwise been spent reviewing genuine contributions.
| pipeline_id = "anchore_importer" | ||
| root_url = "https://github.com/anchore/nvd-data-overrides" | ||
| license_url = "https://github.com/anchore/nvd-data-overrides/blob/main/LICENSE" | ||
| spdx_license_expression = "CC0-1.0" # License of Anchore's data |
There was a problem hiding this comment.
| spdx_license_expression = "CC0-1.0" # License of Anchore's data | |
| spdx_license_expression = "cc0-1.0" |
| return len(raw_data) | ||
|
|
||
| def collect_advisories(self) -> Iterable[AdvisoryData]: | ||
| raw_data = self.fetch_data() |
There was a problem hiding this comment.
Why fetch the same thing twice both in advisories_count and collect_advisories?
| url = "https://raw.githubusercontent.com/anchore/nvd-data-overrides/main/overrides.yaml" | ||
| response = requests.get(url) | ||
| response.raise_for_status() | ||
| return yaml.safe_load(response.text) # Correct YAML parsing |
@Dedsec0098 Are you serious? This code cannot even start to run. |
|
This is not actionable. Please take the time to test your code and stop submitting code that does not run and is AI-generated, wasting precious review time from the maintainers. |
Fix #1437 - Added new pipeline called anchore_importer and also updated SOURCES.rst and init.py
Signed-off-by: Shrish Mishra shrish409@gmail.com