Skip to content

Fix: Collect data from Anchore NVD overrides#1773

Closed
Dedsec0098 wants to merge 5 commits intoaboutcode-org:mainfrom
Dedsec0098:1437-Collect-data-from-Anchore-NVD-overrides
Closed

Fix: Collect data from Anchore NVD overrides#1773
Dedsec0098 wants to merge 5 commits intoaboutcode-org:mainfrom
Dedsec0098:1437-Collect-data-from-Anchore-NVD-overrides

Conversation

@Dedsec0098
Copy link

Fix #1437 - Added new pipeline called anchore_importer and also updated SOURCES.rst and init.py
Signed-off-by: Shrish Mishra shrish409@gmail.com

…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
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Run make valid.

@Dedsec0098
Copy link
Author

Sure I'll definitely do the changes in this branch

…h409@gmail.com>

Signed-off-by: Shrish0098 <shrish409@gmail.com>
@Dedsec0098
Copy link
Author

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.

@Dedsec0098
Copy link
Author

@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.

@TG1999
Copy link
Contributor

TG1999 commented Mar 20, 2025

@Dedsec0098 looks good mostly, please add tests !

@Dedsec0098
Copy link
Author

@Dedsec0098 looks good mostly, please add tests !

sure, i'll add them

Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

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

@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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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()
Copy link
Member

Choose a reason for hiding this comment

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

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
Copy link
Member

Choose a reason for hiding this comment

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

use saneyaml insted.

@keshav-space keshav-space added the vibe-code Completely AI-generated code label Mar 20, 2025
@pombredanne
Copy link
Member

@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 Are you serious? This code cannot even start to run.

@pombredanne
Copy link
Member

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.
If you are able to submit code that is minimally tested and does run and is not AI generated, come back, but only then.
I am going to close all your other PRs for the same reason

@Dedsec0098 Dedsec0098 deleted the 1437-Collect-data-from-Anchore-NVD-overrides branch March 25, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vibe-code Completely AI-generated code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collect data from Anchore NVD overrides

4 participants