Page MenuHomeSoftware Heritage

Storage.release_get: Yield None for non-existent release
ClosedPublic

Authored by anlambert on Tue, Nov 27, 3:53 PM.

Details

Summary

I noticed that when trying to query or browse a non-existent release id, for instance
https://archive.softwareheritage.org/browse/release/c66646b7256b9417738cd4b8d4f0d0ac271df93e/
https://archive.softwareheritage.org/api/1/release/c66646b7256b9417738cd4b8d4f0d0ac271df93e/,
no exception were raised and thus errors appear.

The issue comes from the storage layer who does not yield None when trying
to retrieve a non-existent release.

That diff implements the same behaviour as in Storage.revision_get, ensuring None
is returned when querying a non-existent release.

Test Plan

Tests have been updated to reflect the change.

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

anlambert created this revision.Tue, Nov 27, 3:53 PM
vlorentz accepted this revision.Tue, Nov 27, 5:11 PM

Needs docstring updates.

This revision is now accepted and ready to land.Tue, Nov 27, 5:11 PM
anlambert updated this revision to Diff 2264.Tue, Nov 27, 5:20 PM

Update docstrings

This revision was automatically updated to reflect the committed changes.