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

Use dependency injection in PypiCoordinatesMapper #1072

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

qtomlinson
Copy link
Collaborator

This is to fix the CodeQL scanning failure and make stubbing network call easier in unit tests.

This is to fix the CodeQL scanning failure and make stubbing network call easier in unit tests.
@qtomlinson qtomlinson marked this pull request as ready for review March 11, 2024 21:51
@qtomlinson qtomlinson requested a review from lumaxis March 11, 2024 21:51
@@ -21,19 +22,16 @@ class PypiCoordinatesMapper {
}

async _resolve(coordinates) {
if (coordinates.name === '..') return null
Copy link
Contributor

Choose a reason for hiding this comment

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

I was wondering if we want a more generalized function to sanitize coordinates? But also fine as is 👍🏼

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought about this as well: using URL object and the check /../ in the final url can be refactored into a function. I will do the refactoring as a separate PR. The check for / in coordinates.name is specific to coordinates, which maybe harder to refactor.

@qtomlinson qtomlinson merged commit fe8343f into clearlydefined:master Mar 13, 2024
3 checks passed
@qtomlinson qtomlinson deleted the qt/fix-pypi branch March 13, 2024 17:02
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