- Jan 20, 2021
-
-
Antoine R. Dumont authored
Related to T2961
-
- Jan 13, 2021
-
-
Vincent Sellier authored
The optional nature of the type will allow to avoid migrating the (db) data model right now then we can have this type field in kafka messages in the origin-visit-status topic Related to T2443
-
- Jan 04, 2021
-
-
vlorentz authored
-
- Dec 15, 2020
-
-
vlorentz authored
Unfortunately, sphinx (actually, autodoc) only picks up attributes if they fall in any of these cases: 1. are enum variants 2. are in slots 3. are in __dict__ 4. have an annotation 5. are found using its custom parser (see get_object_members in sphinx/ext/autodoc/importer.py) In theory, option 5 should work for us; unfortunately, autodoc only asks the parser the list of members with a comment. And it's not easy to adapt it to ask the parser for all members, because said parser (sphinx/pycode/parser.py) does not return the class qualname (aka. namespace) for members without comments. So, as I don't want to change the interface of sphinx.pycode.parser, this commit switches to relying on option 3, by adding __slots__ for all attr classes. Additionally, this might have some performance/memory improvement (though I did not check) and will further avoid mutation of these objects.
-
- Nov 16, 2020
-
-
Nicolas Dandrimont authored
All reverse dependencies have been updated to avoid using it now, so it can now be removed, paving the way to recycle it into an intrinsic identifier.
-
- Oct 27, 2020
-
-
Nicolas Dandrimont authored
This avoids throwing the deprecation warning when id and target are present and have the same value, which makes a from_dict / to_dict round-trip throw no deprecation warnings.
-
- Oct 26, 2020
-
-
Nicolas Dandrimont authored
This backwards-compatible change prepares the transition to give RawExtrinsicMetadata an `id` field that is computed intrinsically from its contents (using the HashableObject mixin).
-
- Oct 23, 2020
-
-
Nicolas Dandrimont authored
This will enable a gradual enhancement of the functions in identifiers.py to take model objects directly, and return the bytes of the hash instead of an hex representation.
-
- Oct 08, 2020
-
-
vlorentz authored
that returns a value suitable for unicity constraints. Motivation: * this is somewhat more of a model concern than a journal/kafka concern IMO * this is one step toward adding support for non-model objects in KafkaJournalWriter Implementation of the unique_key methods comes from `swh.journal.serializers.object_key`.
-
- Sep 18, 2020
-
-
Thibault Allançon authored
Use the new SWHID naming convention instead of SWH PID.
-
- Sep 17, 2020
-
-
Antoine Lambert authored
Related to T2610
-
- Aug 25, 2020
-
-
Antoine Lambert authored
-
- Aug 14, 2020
-
-
vlorentz authored
We may unknowingly pass naive datetimes to the storage through them, causing the underlying DB to assign them a timezone that might not match the actual one. It already happens in swh.model and swh.loader.package tests.
-
- Aug 07, 2020
-
-
Antoine R. Dumont authored
Same as for the field data, it helps for code not yet migrated to use model object.
-
Antoine R. Dumont authored
Related to T645
-
- Aug 06, 2020
-
-
Antoine R. Dumont authored
-
- Jul 30, 2020
-
- Jul 20, 2020
-
- Jul 07, 2020
- Jul 06, 2020
-
-
David Douard authored
Add a new extra_headers attribute on Revision and use it for computing the revision's id instead of extract it from the metadata field. Only accept (bytes, bytes) as extra_header. Add a post init hook to Revision to initialize this new attribute from given metadata, if any, for bw compat. Also amend the revision_d hyptothesis strategy to generate extra_headers.
-
- 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
-
-
David Douard authored
And adapt the revisions_d() strategy accordingly.
-
- 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 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.
-
- 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.
-
- 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.
-
- 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
- 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
This ensures all instanciated model entities have valid types for attributes. Related to T2308.
-