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

npm importer - improver migration #805

Closed
wants to merge 9 commits into from
Closed

Conversation

ziadhany
Copy link
Collaborator

Signed-off-by: ziad [email protected]

ziadhany and others added 8 commits August 1, 2022 15:48
Signed-off-by: ziad <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: ziad <[email protected]>
# Conflicts:
#	vulnerabilities/importer.py
#	vulnerabilities/importers/__init__.py
Copy link
Contributor

@TG1999 TG1999 left a comment

Choose a reason for hiding this comment

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

Thanks! please see my feedback for your consideration

glob = "vuln/npm/**/*.json" # subdir="vuln/npm"
files = (p for p in path.glob(glob) if p.is_file())
for file in files:
print(file)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove print statement

publish_date = parse(record["updated_at"])
publish_date = publish_date.replace(tzinfo=pytz.UTC)

pkg_manager_api = NpmVersionAPI()
Copy link
Contributor

Choose a reason for hiding this comment

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

VersionAPI is needed to be handled at improver side, check github and gitlab importer for same


return aff_ver, fix_ver
def get_fixed_version(
Copy link
Contributor

Choose a reason for hiding this comment

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

Add tests

Example:
>>> z = normalize_ranges(">=6.1.3 < 7.0.0 || >=7.0.3")
>>> assert z == [">=6.1.3,<7.0.0", ">=7.0.3"]
def map_all_versions(all_versions) -> List[SemverVersion]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add tests

@ziadhany ziadhany mentioned this pull request Sep 22, 2022
9 tasks
@TG1999
Copy link
Contributor

TG1999 commented Nov 21, 2022

Been worked in #960

@TG1999 TG1999 closed this Nov 21, 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.

2 participants