- Mar 23, 2022
-
- Mar 18, 2022
-
-
David Douard authored
these fields are computed attributes and may be removed from the backend storage. Helps writing tests.
-
- Mar 16, 2022
-
-
vlorentz authored
This reverts commit a0f54362. This means this commit removes the 'offset' and 'negative_utc' arguments. It also removes the 'negative_utc' attribute (which is not used anymore), but keeps an 'offset' property, which is an alias to 'offset_minutes()'. This is only to keep this commit readable; the next commit will remove this alias.
- Feb 10, 2022
-
-
vlorentz authored
This should slightly reduce the memory used by dir/rev/rel objects
-
- Jan 26, 2022
- Jan 21, 2022
-
- Jan 17, 2022
-
-
vlorentz authored
-
- Jan 14, 2022
-
- Jan 13, 2022
-
-
vlorentz authored
'offset' becomes a property instead of an attribute and constructor argument. This also removes both from the output of `.to_dict()`. This is step 6 of https://forge.softwareheritage.org/T3752 This will break packages that still use the constructor directly, ie. swh-storage and swh-loader-git (and tests of swh-loader-core and swh-loader-svn)
-
- Jan 12, 2022
-
-
vlorentz authored
-
- Dec 22, 2021
-
-
vlorentz authored
1. Most objects do not need it so it's a waste of space 2. This means we just extend the existing format (some objects will have that key in their dict) instead of changing it (retroactively adding it to all objects)
-
vlorentz authored
This will be used to store the original manifest of 'weird' git objects, when we cannot reasonably represent them otherwise.
-
- Dec 08, 2021
-
-
vlorentz authored
It calls attr.validate() (which calls the validators), and recomputes the hash of HashableObject instances. A future commit will also make it check the raw_manifest attribute when relevant
-
vlorentz authored
It's just simpler this way
-
vlorentz authored
For the sake of completeness (a future commit may depend on it).
-
vlorentz authored
For now it is filled from 'offset' and 'negative_utc', but it will replace them in a future commit. This is to simplify and add support for more 'weird' offsets we do not currently support.
-
- Dec 01, 2021
-
-
vlorentz authored
I don't know any instance of these, but there is no harm in checking them.
-
- Nov 05, 2021
-
-
vlorentz authored
1. hashes are now repr()ed as `hash_to_bytes("1234...")` instead of b"\x12\x34..."` 2. SWHID objects are now repr()ed as `CoreSWHID.from_string('swh:1:...:1234...')` instead of `CoreSWHID(scheme='swh', version='1', object_type=..., object_id=b'\x12\x34')` 3. enums are now repr()ed as `MyEnum.NAME` instead of "<MyEnum.NAME: 'value'>` Thanks to these three changes, using repr() on a model object now prints a string that can be pasted directly in a `.py` file to write a new test case.
-
- Oct 01, 2021
-
-
vlorentz authored
The previous replaced attrs-strict's type validator with our own, stricter and faster, validator. However, the strictness can be a burden in other packages; for example, swh-storage tests rely on it to insert dummy data that raises exception when accessed, and it would be hard to do while using the exact expected type. This commit reverts the strict behavior, but keeps the performance optimization, by always checking with type equality, but in case type equality fails (which would raise an error before this commit), it gives the value a 'second chance', by trying isinstance. This means that, outside tests, isinstance should not be used at all, or very rarely.
-
- Sep 28, 2021
-
-
vlorentz authored
This reimplements attrs_strict.type_validator(), using type equality instead of isinstance. This makes my checksum validation script (that mostly just instantiates model objects, computes a checksum, then discard) run twice as fast.
-
- Sep 23, 2021
-
-
vlorentz authored
-
vlorentz authored
Since they are used by the vault for non-identifier-related stuff, I think it makes sense to move them to a new module. identifiers.py is now an empty shell, as all its features were moved to other modules and it only contains reexports and backward-compat functions. Therefore, it should be considered deprecated from now on.
-
vlorentz authored
Refactor identifiers & model to make *_git_object() functions work on model classes instead of dicts Since we now use these classes everywhere, computing hashes required using to_dict() just to compute identifiers, which can be a performance bottleneck in code computing many checksums.
-
vlorentz authored
identifiers.py initially worked only on bare sha1_git. I chose to add the SWHID classes in that module because of the name, but the SWHID code didn't actually interact with the other functions in the module, so it now feels out of place to me.
-
Raphaël Gomès authored
We're about to have a Bazaar loader
-
- Sep 16, 2021
-
- Jul 27, 2021
-
-
Stefan Sperling authored
-
- Jul 23, 2021
-
-
Nicolas Dandrimont authored
This allows distinguishing multiple potential versions of the mapping between external objects and their counterparts archived in Software Heritage, for instance when a loader has a backwards-incompatible change that should result in objects being loaded again. The field defaults to zero, in which case it's backwards-compatible with the previous implementation in terms of identifier computation.
-
- Jun 15, 2021
-
-
David Douard authored
-
- Mar 18, 2021
-
-
Nicolas Dandrimont authored
This truncation is already enshrined at the identifier level. Truncate the object itself as well, to reduce the possibility multiple different metadata objects with the same identifier.
-
- Mar 12, 2021
-
- Mar 10, 2021
-
-
David Douard authored
this object aims at being able to keep in the SWH Archive an SWHID <-> External object ID map, e.g. to be able to keep track of Mercurial ids so the Mercurial loader can be made more efficient. Related to T2849.
-
- Mar 08, 2021
-
-
David Douard authored
was modifying the dict given as argument.
-
- Mar 04, 2021
-
-
vlorentz authored
So that they can be properly deduplicated and referenced.
- Mar 01, 2021
-
-
vlorentz authored
SWHID is deprecated; and CoreSWHID does not support qualifiers at all, so RawExtrinsicMetadata no longer needs to check there are no qualifiers.
-
vlorentz authored
ExtendedSWHID can identify either a software artifact or an origin, so we no longer need Union[SWHID, str]. Therefore, we no longer need the 'type' attribute, as it was only used to tell when the target is a SWHID and when it's an origin URL.
-
vlorentz authored
It can be handy as a shortcut to build SWHID objects.
-