fix: Parse .whl files without file existence check#6689
fix: Parse .whl files without file existence check#6689james-snyk wants to merge 1 commit intomainfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
8372fd3 to
34f4bd9
Compare
| const baseApi = '/api/v1'; | ||
| env = { | ||
| ...process.env, | ||
| SNYK_API: 'http://localhost:' + port + baseApi, |
There was a problem hiding this comment.
Suggestion: please use getFirstIPv4Address() instead of localhost, using localhost causes the tests to not cover the full stack
There was a problem hiding this comment.
suggestion: this is still using localhost. @james-snyk here's an example usage of getFirstIPv4Address().
There was a problem hiding this comment.
@james-snyk I think this is the last open comment here. Do you want to adapt it? Or is there a reason why not?
There was a problem hiding this comment.
I made this change but at some point accidentally reverted it. Have added it back now
34f4bd9 to
2f658f2
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Exit code should be 0 (success) or 2 (missing packages) | ||
| // Missing packages is acceptable if pip install failed on the CI system | ||
| expect([0, 2]).toContain(code); |
There was a problem hiding this comment.
Question: why is 0 or 2 okay? shouldn't this behaviour reproducible?
There was a problem hiding this comment.
Yeah was being too lenient with the ci but have updated this now as the catch i have for the install should make sure it gets installed correctly
6f05953 to
96b7e73
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
f42f1d0 to
81edaa6
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
81edaa6 to
0b3df5e
Compare
This comment has been minimized.
This comment has been minimized.
0b3df5e to
8fe0d70
Compare
This comment has been minimized.
This comment has been minimized.
cb60432 to
6990742
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
7816dee to
a6b8cec
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
87686cb to
d781eeb
Compare
This comment has been minimized.
This comment has been minimized.
|
|
||
| // Individual scanning should work correctly with .whl files | ||
| // No parse errors should occur | ||
| expect(stderr).not.toContain('Unparsable requirement line'); |
There was a problem hiding this comment.
Suggestion: asserting against stderr and stdout (human readable) ,are quite brittle assertions. Better would be to use json output or some other machine readable contract.
| ); | ||
|
|
||
| // Should successfully test both projects | ||
| expect(stdout).toContain('project-a'); |
There was a problem hiding this comment.
d781eeb to
f1e1a0b
Compare
This comment has been minimized.
This comment has been minimized.
f1e1a0b to
80435a4
Compare
This comment has been minimized.
This comment has been minimized.
80435a4 to
f6bfd93
Compare
This comment has been minimized.
This comment has been minimized.
f6bfd93 to
fa19e45
Compare
This comment has been minimized.
This comment has been minimized.
28c5106 to
3a4444b
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
3a4444b to
bd94554
Compare
This comment has been minimized.
This comment has been minimized.
0db36e7 to
8e5a54a
Compare
This comment has been minimized.
This comment has been minimized.
8e5a54a to
aa6215e
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
aa6215e to
6695ebe
Compare
PR Reviewer Guide 🔍
|
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
Fix issue scanning python projects that ref .whl files when scanning with --all-projects
Where should the reviewer start?
snyk/snyk-python-plugin#291
How should this be manually tested?
Run cli against new test fixture
What's the product update that needs to be communicated to CLI users?
Successful scan python projects when using --all-projects and multiple files ref to .whl packages.