diff --git a/swh/model/hypothesis_strategies.py b/swh/model/hypothesis_strategies.py --- a/swh/model/hypothesis_strategies.py +++ b/swh/model/hypothesis_strategies.py @@ -174,6 +174,7 @@ dict, visit=integers(1, 1000), origin=urls(), + type=optional(sampled_from(["git", "svn", "pypi", "debian"])), status=sampled_from(["created", "ongoing", "full", "partial"]), date=aware_datetimes(), snapshot=optional(sha1_git()), diff --git a/swh/model/model.py b/swh/model/model.py --- a/swh/model/model.py +++ b/swh/model/model.py @@ -323,6 +323,8 @@ validator=attr.validators.in_(["created", "ongoing", "full", "partial"]), ) snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator()) + # Type is optional be to able to use it before adding it to the database model + type = attr.ib(type=Optional[str], validator=type_validator(), default=None) metadata = attr.ib( type=Optional[ImmutableDict[str, object]], validator=type_validator(),