HomeSoftware Heritage

Add snapshot models
f4ea97cb1c1eUnpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.
This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Add snapshot models

Summary:
Snapshots are the new, improved occurrences; They're the topmost object in the
Software Heritage Merkle Tree, and represent a full picture of an origin at a
given time.

Snapshots contain a list of named pointers to objects in the Software Heritage
archive, as well as an intrinsic identifier. The full specification is
supported: pointers to all types of objects, dangling pointers, as well as alias
branches.

They're implemented with a somewhat classic fully normalised model; Foreign keys
use a sha1_git, which makes more sense regarding pointing at non-existent
objects, at the expense of some economies of size.

Backwards compatibility both ways with occurrences is ensured: when adding a
snapshot linked to an origin visit, the corresponding occurrences are created in
occurrence_history; when querying the snapshot for an origin visit where we
haven't generated the snapshot yet, a virtual snapshot with id None is returned.
This lets us migrate to the new tables gently.

Close T567.

Test Plan: Integration tests are included.

Reviewers: zack, Reviewers!

Maniphest Tasks: T567

Differential Revision: https://forge.softwareheritage.org/D268

Details

Provenance
olasdAuthored on Nov 9 2017, 6:11 PM
vlorentzPushed on May 17 2019, 1:53 PM
Differential Revision
D268: Add snapshot models

Commit No Longer Exists

This commit no longer exists in the repository.