Page MenuHomeSoftware Heritage

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

Authored by anlambert on Nov 27 2018, 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

Needs docstring updates.

This revision is now accepted and ready to land.Nov 27 2018, 5:11 PM
This revision was automatically updated to reflect the committed changes.