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

Fix pysec importer #739

Merged
merged 2 commits into from
May 20, 2022
Merged

Fix pysec importer #739

merged 2 commits into from
May 20, 2022

Conversation

TG1999
Copy link
Contributor

@TG1999 TG1999 commented May 19, 2022

Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com

@@ -73,14 +74,22 @@ def parse_advisory_data(raw_data: dict) -> Optional[AdvisoryData]:
raw_id = raw_data["id"]
summary = raw_data.get("summary") or ""
aliases = get_aliases(raw_data)
aliases.append(raw_id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there is no need for (append and dedupe) raw_id (id field) is unique in osv .
https://ossf.github.io/osv-schema/#id-modified-fields
and aliases field is a list of IDs of the same vulnerability in other databases
https://ossf.github.io/osv-schema/#aliases-field
and we append raw_id in aliases using get_aliases .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright! But I don't think we need get_aliases here, it can be handled inline

Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Copy link
Collaborator

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Rename helpers.py to utils.py

Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
@TG1999 TG1999 merged commit b585b16 into aboutcode-org:main May 20, 2022
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.

Error while running default improver on PYSEC importer data
3 participants