Page MenuHomeSoftware Heritage

storage: Open content_get_range storage endpoint
ClosedPublic

Authored by ardumont on Nov 12 2018, 11:41 AM.

Details

Summary

This allows to retrieve contents from within a range.
The endpoint is paginated.

Tests are using the hypothesis module and reuse the initial work on
D646.

Depends on D646

Test Plan

tox

Diff Detail

Repository
rDSTO Storage manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.

Use the right origin commit.

Fix:

  • spurious print statements
  • wrong docstring conventions

Again use the right original commit!

Build has FAILED

stacked diff, you cannot build it successfully.

vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/storage/storage.py
261

Why +1?

swh/storage/tests/test_storage.py
1909

Nitpick: get_sha1s = sorted(c['sha1'] for c in contents)

1925

I don't think this properly tests contents. What if contents[0] is an empty dict?

1958

Same comment as above

This revision now requires changes to proceed.Nov 14 2018, 2:29 PM
ardumont added inline comments.
swh/storage/storage.py
261

To retrieve the next content_id when checking for the boundary limit.

swh/storage/tests/test_storage.py
1925

As explained in prior diff D646#inline-3344, cannot happen here.

ardumont added inline comments.
swh/storage/tests/test_storage.py
1909

right.

Adapt according to review

  • storage: Open content_get_range endpoint
  • tests: Use sorted

(and rebase interactively)

Add missing commits from the prior rebase instructions (T.T)

  • tests: Move property_based marker to toplevel test class
  • tests: Add docstring to test to detail what's tested
This revision is now accepted and ready to land.Nov 14 2018, 3:22 PM
This revision was automatically updated to reflect the committed changes.