- Jul 03, 2020
-
-
Antoine Lambert authored
When Software Heritage persistent identifiers were introduced, they were not yet abbreviated as SWHIDs. Now that abbreviation is growing adoption, rename some functions and types in swh.model.identifiers for consistency: - PersistentId -> SWHID - persistent_identifier -> swhid - parse_persistent_identifier -> parse_swhid Backward compatibility with previous naming is maintained but deprecation warnings are introduced to encourage the use of the new names. Numerous variables in swh.model codebase have also been renamed accordingly. Also rework and improve documentation.
-
- Jul 02, 2020
-
-
Antoine R. Dumont authored
-
Antoine R. Dumont authored
-
- Jun 29, 2020
-
-
Antoine R. Dumont authored
Related to T2310
-
- Jun 24, 2020
-
-
David Douard authored
this aims at preventing constant usage of isinstance() based dispatch code when writing generic code handling model entities. For example, the "object_type" argument of JournalWriter.write_addition() has become superflous now we only pass model entities, etc. This idea comes olasd's reading of mypy doc: https://mypy.readthedocs.io/en/latest/literal_types.html#tagged-unions This comes with a refactoring of from_dict.DiskBackedContent to make it *not* inherit from model.Content: object_type being Final, it cannot be overloaded.
-
Antoine R. Dumont authored
Related to T2310
-
- Jun 23, 2020
-
-
Antoine R. Dumont authored
Related to T2310
-
- Jun 22, 2020
-
-
Antoine R. Dumont authored
-
- Jun 16, 2020
-
-
Antoine R. Dumont authored
This is not used. This is broken storage wise (origin-visit-add does not deal correctly with it and it so happens there is no test around it). And finally, this will soon go away with T2310.
-
David Douard authored
And adapt the revisions_d() strategy accordingly.
-
David Douard authored
This can be None, according to the model.
-
David Douard authored
for the sake of consistency.
-
- Jun 15, 2020
-
-
David Douard authored
thus in TimestampWithTimezone.from_dict(). This is needed to help consuming existing (invalid) messages from kafka. Warning: tests added in this revision do not cover the whole normalize_timestamp() function.
-
- Jun 03, 2020
-
-
David Douard authored
This is a step forward having model objects, declared as frozen, immutable. This requires attrs_strict >= 0.0.7.
-
David Douard authored
the visit attribute is expected to be strictly positive.
-
- May 29, 2020
-
-
David Douard authored
this attribute is not an intrinsic property of a content object, so it should not be used when comparing or hashing.
-
- May 20, 2020
-
-
David Douard authored
Simply add a BaseModel.anonymize() method. Default implementation returns None, meaning the object is not anonymizable. For Person, the method returns a Person whith hashed fullname (and unset name and email). For Revision and Release, the method returns an anonymized version of the object, i.e. with instance of Person replaced by anonymized ones.
-
- May 05, 2020
-
- Apr 29, 2020
-
-
vlorentz authored
Production should only use aware datetimes.
-
- Apr 21, 2020
-
-
David Douard authored
Make it possible to generate Content and SkippedContent under different object types (namely "content" and "skipped_content"). Default to False to keep backward compat.
-
David Douard authored
so one can choose not to generate some of the object types. Blacklist "origin_visit_status" by default to prevent breaking dependent packages' tests.
-
- Apr 20, 2020
-
-
Antoine R. Dumont authored
-
- Apr 17, 2020
-
-
Stefano Zacchiroli authored
and user required=True to check that, as it is the preferred way
-
Stefano Zacchiroli authored
-
Stefano Zacchiroli authored
-
Stefano Zacchiroli authored
-
- Apr 10, 2020
-
-
Antoine R. Dumont authored
This also adapts the hypothesis strategies, using the plural form origin_visit_statuses. That plural form is acceptable because in our context, the statuses are countable. Related to T2310
-
Antoine R. Dumont authored
-
- Apr 08, 2020
-
-
David Douard authored
- blackify all the python files, - enable black in pre-commit, - add a black tox environment.
-
Daniele Serafini authored
-
- Apr 02, 2020
-
-
Antoine Lambert authored
A release may have an empty message, for instance those derived from a Mercurial repository. So make that field optional to avoid type validation errors.
-
Antoine Lambert authored
Fix keyword parameters transmission to snapshots_d strategy. Ensure max_size constraint is respected when fixing snapshot aliases.
-
- Apr 01, 2020
-
-
David Douard authored
With support for str representation of date. Mostly for testing purpose.
-
David Douard authored
-
David Douard authored
instead of a reference to an Origin entity.
-
David Douard authored
for each entity model `Model`, provide a `models_d` strategy that produces dicts suitable for using as argument for the `Model.from_dict` factory method, and reimplement the `models` generator using this former hypothesis generator. This is needed to help writing low level tests for model entities.
-
David Douard authored
- add a validator for negative_utc (can be True iff offset is 0), - update the timestamps_with_timezone hypothesis strategy, - add low-level tests for it.
-
David Douard authored
-
David Douard authored
This ensures all instanciated model entities have valid types for attributes. Related to T2308.
-
- Mar 31, 2020
-
-
Antoine R. Dumont authored
(pairing with @vlorentz) Related to T2310
-