-
Notifications
You must be signed in to change notification settings - Fork 500
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 direct endpoint instead of search to find repository URL from npm database #4118
Conversation
Signed-off-by: aklevans <[email protected]>
…om npm Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Still getting linter issues, try For |
… to only include necessary data Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
convert windows line breaks to linux
I don't think fix-linter is working correctly on my machine. It just adds line breaks between every single line. Any reason this may happen? |
Hm, that's strange that |
Signed-off-by: aklevans <[email protected]>
Signed-off-by: aklevans <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4118 +/- ##
==========================================
- Coverage 66.06% 60.12% -5.95%
==========================================
Files 226 214 -12
Lines 16291 15621 -670
==========================================
- Hits 10763 9392 -1371
- Misses 4854 5537 +683
- Partials 674 692 +18 |
Can you share a little bit about your environment? You're running the linter with |
Signed-off-by: aklevans <[email protected]>
I think the issue was stemming from the fact I was working with windows. I have switched to Linux and I believe it is working now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, thanks!
Signed-off-by: aklevans <[email protected]>
Thanks. I'll update the branch later and get this merged in. The DCO bot is seemingly not running, so can't at the moment. |
…pm database (ossf#4118) * Update endpoint used when getting repo from npm to solve ossf#3166 Signed-off-by: aklevans <[email protected]> * Update test files to account for endpoint change when getting repo from npm Signed-off-by: aklevans <[email protected]> * Fix linter issues Signed-off-by: aklevans <[email protected]> * Added unit tests for ossf#3166 and ossf#2441 Signed-off-by: aklevans <[email protected]> * fix linter issues and reduce mock json output in package_manager_test to only include necessary data Signed-off-by: aklevans <[email protected]> * fix linter issues in package_managers.go Signed-off-by: aklevans <[email protected]> * convert windows line breaks to linux Signed-off-by: aklevans <[email protected]> * reduce test case size, still has windows line breaks Signed-off-by: aklevans <[email protected]> * Fix unit tests Signed-off-by: aklevans <[email protected]> * attempt linter fix Signed-off-by: aklevans <[email protected]> * Fix linter issues stemming from windows line breaks Signed-off-by: aklevans <[email protected]> * Remove magic number and rename variable to be more accurate Signed-off-by: aklevans <[email protected]> --------- Signed-off-by: aklevans <[email protected]> Signed-off-by: aklevans <[email protected]> Signed-off-by: balteraivshay <[email protected]>
What kind of change does this PR introduce?
This PR is a bug fix. When finding the github repository URL for an npm package, the application uses the
GET·/{package}/latest
endpoint instead of theGET·/{package}
What is the current behavior?
The application finds the github URL of an npm package by using the search functionality. If a user incorrectly enters a github URL instead of an npm package name, the user will not receive feedback about their mistake and the application will run the checks on the first package that the search finds.
What is the new behavior (if this is a feature change)?**
When a user enters a github URL instead of an npm package name, an error message is displayed saying that the npm package could not be found.
Which issue(s) this PR fixes
Fixes #3166.
Special notes for your reviewer
Does this PR introduce a user-facing change?
NO