Skip to content

storage*: Rename and type content_get_data(Sha1) -> Optional[bytes]

Rename the confusing endpoint content_get to content_get_data. This also now works on one content as it is how it is used today.

Impacts:

grep -r "content_get(" $SWH_ENVIRONMENT_HOME/**/swh/* | grep -v swh-storage
/home/tony/work/inria/repo/swh/swh-environment/swh-indexer/swh/indexer/tests/utils.py:    def test_generate_content_get(self):
/home/tony/work/inria/repo/swh/swh-environment/swh-loader-core/swh/loader/package/npm/tests/test_npm.py:        list(loader.storage.content_get(_expected_new_contents_first_visit))
/home/tony/work/inria/repo/swh/swh-environment/swh-vault/swh/vault/to_disk.py:    contents_fetched = storage.content_get(contents_to_fetch)
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/common/service.py:            c = _first_element(storage.content_get([content.sha1]))
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/common/service.py:    content = _first_element(storage.content_get([content_sha1_bytes]))
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/browse/views/test_content.py:    content_data = archive_data.content_get(content["sha1"])["data"]
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/browse/views/test_content.py:    content_data = archive_data.content_get(content["sha1"])["data"]
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/browse/views/test_content.py:    content_data = archive_data.content_get(content["sha1"])
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/api/views/test_content.py:    expected_data = archive_data.content_get(content["sha1"])
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/api/views/test_content.py:    expected_data = archive_data.content_get(content["sha1"])
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/data.py:        cnt = next(storage.content_get([sha1]))
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/common/test_service.py:    expected_data = archive_data.content_get(expected_dir_entry["checksums"]["sha1"])
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/common/test_service.py:    expected_content = archive_data.content_get(content["sha1"])
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/conftest.py:    def content_get(self, cnt_id):
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/conftest.py:        cnt = next(self.storage.content_get([cnt_id_bytes]))
/home/tony/work/inria/repo/swh/swh-environment/swh-web/swh/web/tests/strategies.py:            get_tests_data()["storage"].content_get([hash_to_bytes(c["sha1"])])

Test Plan

tox


Migrated from D3728 (view on Phabricator)

Merge request reports