diff --git a/swh/loader/core/loader.py b/swh/loader/core/loader.py --- a/swh/loader/core/loader.py +++ b/swh/loader/core/loader.py @@ -411,23 +411,22 @@ self.save_data() if self.has_contents(): - contents = [] - skipped_contents = [] for obj in self.get_contents(): if isinstance(obj, Content): - contents.append(obj) + self.storage.content_add([obj]) elif isinstance(obj, SkippedContent): - skipped_contents.append(obj) + self.storage.skipped_content_add([obj]) else: raise TypeError(f"Unexpected content type: {obj}") - self.storage.skipped_content_add(skipped_contents) - self.storage.content_add(contents) if self.has_directories(): - self.storage.directory_add(list(self.get_directories())) + for directory in self.get_directories(): + self.storage.directory_add([directory]) if self.has_revisions(): - self.storage.revision_add(list(self.get_revisions())) + for revision in self.get_revisions(): + self.storage.revision_add([revision]) if self.has_releases(): - self.storage.release_add(list(self.get_releases())) + for release in self.get_releases(): + self.storage.release_add([release]) snapshot = self.get_snapshot() self.storage.snapshot_add([snapshot]) self.flush() diff --git a/swh/loader/package/archive/tests/test_archive.py b/swh/loader/package/archive/tests/test_archive.py --- a/swh/loader/package/archive/tests/test_archive.py +++ b/swh/loader/package/archive/tests/test_archive.py @@ -96,7 +96,6 @@ "directory": 0, "origin": 1, "origin_visit": 1, - "person": 0, "release": 0, "revision": 0, "skipped_content": 0, @@ -163,7 +162,6 @@ "directory": len(_expected_new_directories_first_visit), "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": len(_expected_new_revisions_first_visit), "skipped_content": 0, @@ -243,7 +241,6 @@ "directory": len(_expected_new_directories_first_visit), "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": len(_expected_new_revisions_first_visit), "skipped_content": 0, @@ -281,7 +278,6 @@ "directory": len(_expected_new_directories_first_visit) + 8, "origin": 1, "origin_visit": 1 + 1, - "person": 1, "release": 0, "revision": len(_expected_new_revisions_first_visit) + 1, "skipped_content": 0, diff --git a/swh/loader/package/cran/tests/test_cran.py b/swh/loader/package/cran/tests/test_cran.py --- a/swh/loader/package/cran/tests/test_cran.py +++ b/swh/loader/package/cran/tests/test_cran.py @@ -191,7 +191,6 @@ "directory": 7, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, @@ -238,7 +237,6 @@ "directory": 7, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, diff --git a/swh/loader/package/debian/tests/test_debian.py b/swh/loader/package/debian/tests/test_debian.py --- a/swh/loader/package/debian/tests/test_debian.py +++ b/swh/loader/package/debian/tests/test_debian.py @@ -122,7 +122,6 @@ "directory": 2, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, # all artifacts under 1 revision "skipped_content": 0, @@ -166,7 +165,6 @@ "directory": 2, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, # all artifacts under 1 revision "skipped_content": 0, @@ -196,7 +194,6 @@ "directory": 2 + 0, "origin": 1, "origin_visit": 1 + 1, # a new visit occurred - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, diff --git a/swh/loader/package/deposit/tests/test_deposit.py b/swh/loader/package/deposit/tests/test_deposit.py --- a/swh/loader/package/deposit/tests/test_deposit.py +++ b/swh/loader/package/deposit/tests/test_deposit.py @@ -69,7 +69,6 @@ "directory": 0, "origin": 0, "origin_visit": 0, - "person": 0, "release": 0, "revision": 0, "skipped_content": 0, @@ -105,7 +104,6 @@ "directory": 0, "origin": 1, "origin_visit": 1, - "person": 0, "release": 0, "revision": 0, "skipped_content": 0, @@ -165,7 +163,6 @@ "directory": 12, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, diff --git a/swh/loader/package/nixguix/tests/test_nixguix.py b/swh/loader/package/nixguix/tests/test_nixguix.py --- a/swh/loader/package/nixguix/tests/test_nixguix.py +++ b/swh/loader/package/nixguix/tests/test_nixguix.py @@ -253,7 +253,6 @@ "directory": 3, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, @@ -379,7 +378,6 @@ "directory": 3, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, @@ -431,7 +429,6 @@ "directory": 5, "origin": 1, "origin_visit": 2, - "person": 1, "release": 0, "revision": 2, "skipped_content": 0, diff --git a/swh/loader/package/npm/tests/test_npm.py b/swh/loader/package/npm/tests/test_npm.py --- a/swh/loader/package/npm/tests/test_npm.py +++ b/swh/loader/package/npm/tests/test_npm.py @@ -359,7 +359,6 @@ "directory": len(_expected_new_directories_first_visit), "origin": 1, "origin_visit": 1, - "person": 2, "release": 0, "revision": len(_expected_new_revisions_first_visit), "skipped_content": 0, @@ -450,7 +449,6 @@ "directory": len(_expected_new_directories_first_visit), "origin": 1, "origin_visit": 1, - "person": 2, "release": 0, "revision": len(_expected_new_revisions_first_visit), "skipped_content": 0, @@ -476,7 +474,6 @@ "directory": len(_expected_new_directories_first_visit) + 15, "origin": 1, "origin_visit": 2, - "person": 2, "release": 0, "revision": len(_expected_new_revisions_first_visit) + 3, "skipped_content": 0, @@ -514,7 +511,6 @@ "directory": 153, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 2, "skipped_content": 0, diff --git a/swh/loader/package/pypi/tests/test_pypi.py b/swh/loader/package/pypi/tests/test_pypi.py --- a/swh/loader/package/pypi/tests/test_pypi.py +++ b/swh/loader/package/pypi/tests/test_pypi.py @@ -234,7 +234,6 @@ "directory": 0, "origin": 1, "origin_visit": 1, - "person": 0, "release": 0, "revision": 0, "skipped_content": 0, @@ -266,7 +265,6 @@ "directory": 0, "origin": 1, "origin_visit": 1, - "person": 0, "release": 0, "revision": 0, "skipped_content": 0, @@ -384,7 +382,6 @@ "directory": 2, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 1, "skipped_content": 0, @@ -463,7 +460,6 @@ "directory": 4, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 2, "skipped_content": 0, @@ -554,7 +550,6 @@ "directory": 4, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 2, "skipped_content": 0, @@ -622,7 +617,6 @@ "directory": 4, "origin": 1, "origin_visit": 1, - "person": 1, "release": 0, "revision": 2, "skipped_content": 0, @@ -652,7 +646,6 @@ "directory": 4 + 2, # 2 more directories "origin": 1, "origin_visit": 1 + 1, - "person": 1, "release": 0, "revision": 2 + 1, # 1 more revision "skipped_content": 0, diff --git a/swh/loader/tests/__init__.py b/swh/loader/tests/__init__.py --- a/swh/loader/tests/__init__.py +++ b/swh/loader/tests/__init__.py @@ -252,7 +252,6 @@ "directory", "origin", "origin_visit", - "person", "release", "revision", "skipped_content",