Skip to content

Fix pysec importer - #739

Merged
TG1999 merged 2 commits into
aboutcode-org:mainfrom
TG1999:fix/pysec
May 20, 2022
Merged

Fix pysec importer#739
TG1999 merged 2 commits into
aboutcode-org:mainfrom
TG1999:fix/pysec

Conversation

@TG1999

@TG1999 TG1999 commented May 19, 2022

Copy link
Copy Markdown
Contributor

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

@TG1999 TG1999 linked an issue May 19, 2022 that may be closed by this pull request
Comment thread vulnerabilities/importers/pysec.py Outdated
raw_id = raw_data["id"]
summary = raw_data.get("summary") or ""
aliases = get_aliases(raw_data)
aliases.append(raw_id)

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

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

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