- Jul 02, 2020
-
-
Antoine R. Dumont authored
-
- 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.
-
- 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.
-
- 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 17, 2020
-
-
Stefano Zacchiroli authored
and user required=True to check that, as it is the preferred way
-
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
-
- Apr 08, 2020
-
-
David Douard authored
- blackify all the python files, - enable black in pre-commit, - add a black tox environment.
-
- Apr 02, 2020
-
-
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
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
-
- Mar 31, 2020
-
-
Antoine R. Dumont authored
(pairing with @vlorentz) Related to T2310
-
- Mar 12, 2020
-
-
David Douard authored
These are expected to be bytes, not str.
-
- Mar 11, 2020
-
-
David Douard authored
this does not work in the general case since there is no (recursive) convertion of objects used as model object initialization. We can only check when using the from_dict() factory.
-
David Douard authored
for better clarity on the code author's intention.
-
- Mar 04, 2020
-
- Mar 02, 2020
-
-
Nicolas Dandrimont authored
This lets us generate Content objects directly from a bytestring, with the proper set of hashes auto-generated from the contents.
-
- Feb 27, 2020
- Feb 24, 2020
-
-
vlorentz authored
It just makes more sense that way. eg. before this change, all leafs would be equal to each other.
-
vlorentz authored
They will be used by loaders, so they can deal only with model objects, instead of having to do the same conversion themselves. This removes the `data` and `save_path` arguments of `from_file` and `from_disk`, as data loading is always deferred from now on. To access it, users are now expected to either open the data files themselves, or us `.to_model().with_data()`.
-
- Feb 21, 2020
-
-
vlorentz authored
Regular files were created, as the 'mode' argument of os.mknod was missing. However, creating devices requires root; so we can't reasonably do that in tests. Instead, we're using /dev/null instead of creating one. And while we're at it, let's also use /dev/zero (which, if not handled properly, will result in an infinite read).
-
vlorentz authored
It should be cheap enough to do it, and it makes tests easier.
-
vlorentz authored
-
vlorentz authored
It will be useful to loaders, as they currently load the entire content in memory before deciding to skip it.
-
- Feb 14, 2020
-
-
vlorentz authored
Can be useful to deduplicate code in swh-storage.
-
- Feb 05, 2020
-
- Jan 30, 2020
-
-
Antoine R. Dumont authored
-
Antoine R. Dumont authored
Related to P589
-
- Jan 29, 2020
-
-
David Douard authored
This allows for example to type: curl -s https://archive.softwareheritage.org/browse/content/sha1_git:64582b78792cd6c2d67d35da5a11bb80886a6409/raw/ | swh identify swh:1:cnt:64582b78792cd6c2d67d35da5a11bb80886a6409 -
-
- Nov 29, 2019
-
-
Antoine Lambert authored
Add support to automatically compute identifier in the following object models: Directory, Release, Revision, Snapshot. If the identifier is not provided as parameter, it will be computed when the model is initialized.
-
Antoine Lambert authored
-