Page MenuHomeSoftware Heritage

storage: Add endpoint to get missing content (by sha1_git) and missing snapshot
ClosedPublic

Authored by DanSeraf on Wed, Jan 22, 1:29 PM.

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

DanSeraf created this revision.Wed, Jan 22, 1:29 PM

Looks good, but this diff is missing tests and matching changes in in_memory.py

vlorentz requested changes to this revision.Wed, Jan 22, 1:50 PM
This revision now requires changes to proceed.Wed, Jan 22, 1:50 PM
DanSeraf updated this revision to Diff 9173.Wed, Jan 22, 2:30 PM
  • in memory changes
  • test endpoint: content_missing (sha1_git), snapshot_missing
vlorentz requested changes to this revision.Wed, Jan 22, 2:39 PM

Two more comments, and it should be good to merge

swh/storage/tests/test_storage.py
381 ↗(On Diff #9173)

Could you use equality instead, to check content_missing_per_sha1_git doesn't return too many results?

2598 ↗(On Diff #9173)

same

This revision now requires changes to proceed.Wed, Jan 22, 2:39 PM
DanSeraf added inline comments.Wed, Jan 22, 2:53 PM
swh/storage/tests/test_storage.py
381 ↗(On Diff #9173)

It returns only the missing content sha1_git, one in that case.

vlorentz added inline comments.Wed, Jan 22, 2:55 PM
swh/storage/tests/test_storage.py
381 ↗(On Diff #9173)

What I mean is that we want the test to check that missing_contents can't be something like [None, None missing_cont['sha1_git'], None]

DanSeraf added inline comments.Wed, Jan 22, 3:01 PM
swh/storage/tests/test_storage.py
381 ↗(On Diff #9173)

Ok, i get it.

DanSeraf updated this revision to Diff 9178.Wed, Jan 22, 3:04 PM
  • assert list doesn't have too many values
vlorentz accepted this revision.Wed, Jan 22, 3:12 PM
This revision is now accepted and ready to land.Wed, Jan 22, 3:12 PM
DanSeraf updated this revision to Diff 9186.Wed, Jan 22, 3:55 PM
  • storage: Add endpoint to get missing content (by sha1_git) and missing snapshot
  • in memory changes
  • test endpoint: content_missing (sha1_git), snapshot_missing
  • assert list doesn't have too many values