Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7124083
D4848.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D4848.diff
View Options
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
Details
Attached
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
Attached To
D4848: Add an optional type field on OriginVisitStatus object
Event Timeline
Log In to Comment