Refactor Gitimporter using fetchcode#817
Conversation
ec88205 to
7ca35b3
Compare
|
@ziadhany , please add logs for gitlab importer. |
|
vulnerabilities/importers/gitlab.py
Outdated
|
|
||
|
|
||
| class GitLabAPIImporter(Importer): | ||
| class GitLabGitImporter(GitImporter): |
There was a problem hiding this comment.
@ziadhany this will change the qualified name for importer and the databases will still have the old qualified name stored in them, which will now not be recogonised by improver, either write a migration to support this change or do not change the name of importer.
|
Please rebase with the latest main |
pombredanne
left a comment
There was a problem hiding this comment.
Thanks!
I posted a few comments inline to ensure we do drop tests. Beside these, this looks good.
| TEST_DATA = os.path.join(BASE_DIR, "test_data/") | ||
|
|
||
|
|
||
| def load_oval_data(): |
There was a problem hiding this comment.
IMHO this would be best moved to a new test_oval.py
| assert os.path.join(self.repodir, "crates/hyper/RUSTSEC-2020-0008.toml") in updated_files | ||
|
|
||
|
|
||
| class TestOvalImporter(TestCase): |
There was a problem hiding this comment.
IMHO this would be best moved to a new test_oval.py and not just deleted
There was a problem hiding this comment.
I cannot approve this if we just delete all these tests above.
There was a problem hiding this comment.
I have secured oval importer tests in the file itself https://github.com/nexB/vulnerablecode/pull/817/files#diff-eb1cffdadef3eacc470900468af6cce0bdd6ae476bc9ae94ce512863c060f850R40, and just deleted the GitImporter tests that are not related with the latest importers.
| def test_clone_valid(self): | ||
| with patch.object(GitImporter, "__init__", return_value=None): | ||
| c = GitImporter(None) | ||
| c.repo_url = "git+https://github.com/nexB/fetchcode" |
There was a problem hiding this comment.
Does this do a live clone over the network?
There was a problem hiding this comment.
yes, it clones the repository
( I just mock a constructor and then make the Git importer run, so I can test the result )
e4ad48a to
b8c4b6f
Compare
Co-authored-by: Tushar Goel <tushar.goel.dav@gmail.com> Signed-off-by: ziadhany <ziadhany2016@gmail.com>
Reference: #806
Signed-off-by: ziad ziadhany2016@gmail.com