Page MenuHomeSoftware Heritage

D4848.diff
No OneTemporary

D4848.diff

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(),

File Metadata

Mime Type
text/plain
Expires
Dec 20 2024, 12:45 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225295

Event Timeline