Conversation
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
| # Fix Me: The test data doesn't accurately depict the | ||
| # actual debian website on which, the code under testing | ||
| # is written | ||
| from scraper import debian |
There was a problem hiding this comment.
@tdruez @pombredanne The main debian website (https://security-tracker.debian.org/tracker/), has several child datasets eg: https://security-tracker.debian.org/tracker/status/release/unstable.
The scraping code, firsts visits the main website, extracts the child links, and then visits the child links to extract data. I couldn't form a test data, that could depict this behaviour.
What do you suggest?
There was a problem hiding this comment.
firsts visits the main website, extracts the child links, and then visits the child links to extract data.
Then I suggest those 3 logics should be in 3 separate functions, this would make thing much easier to test as well.
|
|
||
|
|
||
| def debian_data(): | ||
| cve_id = [] |
There was a problem hiding this comment.
Those variables are out of their scope.
|
|
||
| for child_links in range(6): | ||
| # Extract package info from all the child datasets | ||
| child_url = urlopen("https://security-tracker.debian.org" |
There was a problem hiding this comment.
This part should be refactored into its own function.
| # Fix Me: The test data doesn't accurately depict the | ||
| # actual debian website on which, the code under testing | ||
| # is written | ||
| from scraper import debian |
There was a problem hiding this comment.
Why is the import in the function instead of on top of the module?
| # Visit https://github.com/nexB/vulnerablecode/ for support and download. | ||
|
|
||
| import bs4 as bs | ||
| from mock import Mock |
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
Signed-off-by: Kartik Sibal <kartiksibal@gmail.com>
- Add tests runner in the travis config - Cleanup Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
|
|
||
| # if package name is empty, use the previous package name | ||
| if href == '/tracker/source-package/': | ||
| package_name.append(pkg) |
There was a problem hiding this comment.
Warning: The pkg may be referenced before assignment.
IE: if the previous if condition did not check, pkg will not be available.
|
@kartiksibal the current data structure for the returned CVEs is not easily usable, instead of the current 3 lists of strings, we should return a single list of CVEs dictionaries. Instead of: Return: It will be much easier to use that data structure to then create model instances (save the data in the DB). |
Merge changes from develop to main
Add support for gems and improve RPM support
What it does:
Things remaining: