This will be used to store the original manifest of 'weird' git objects,
when we cannot reasonably represent them otherwise.
First step for T3753.
Differential D6801
model: Add a raw_manifest attribute vlorentz on Dec 8 2021, 5:22 PM. Authored by
Details
This will be used to store the original manifest of 'weird' git objects, First step for T3753.
Diff Detail
Event TimelineComment Actions Build has FAILED Patch application report for D6801 (id=24650)Could not rebase; Attempt merge onto c32290481c... Updating c322904..5d078ec Fast-forward swh/model/model.py | 110 ++++++++++++++++++++++++++++++++---------- swh/model/tests/test_model.py | 102 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+), 26 deletions(-) Changes applied before testcommit 5d078ecf17538e264ea2616a5863edceee39fc56 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:28:25 2021 +0100 model: Add a raw_manifest attribute This will be used to store the original manifest of 'weird' git objects, when we cannot reasonably represent them otherwise. commit 1c4d0bb0fae359ce506db5e678386a0c8bb6ded8 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:20:38 2021 +0100 model: Deduplicate calls to hashlib. It's just simpler this way commit 59ed64b08cd42c5af988b402f5948b077a5cb296 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:24:38 2021 +0100 model: Add a check() method to model objects 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 commit 5eb65393af220b3e52f83f34bd27af9d0047cbf2 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:20:38 2021 +0100 model: Deduplicate calls to hashlib. It's just simpler this way commit 2d0105b8413064db60aaa0802a45b0fad8b12d25 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:17:40 2021 +0100 model: Add support for None to the type checker For the sake of completeness (a future commit may depend on it). Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/427/ Comment Actions Build is green Patch application report for D6801 (id=24651)Could not rebase; Attempt merge onto c32290481c... Updating c322904..b9e0617 Fast-forward swh/model/model.py | 106 +++++++++++++++++++++++++++++++----------- swh/model/tests/test_model.py | 102 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 26 deletions(-) Changes applied before testcommit b9e0617e74d790c224f0bba31e541fe7b6b673de Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:28:25 2021 +0100 model: Add a raw_manifest attribute This will be used to store the original manifest of 'weird' git objects, when we cannot reasonably represent them otherwise. commit 59ed64b08cd42c5af988b402f5948b077a5cb296 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:24:38 2021 +0100 model: Add a check() method to model objects 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 commit 5eb65393af220b3e52f83f34bd27af9d0047cbf2 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:20:38 2021 +0100 model: Deduplicate calls to hashlib. It's just simpler this way commit 2d0105b8413064db60aaa0802a45b0fad8b12d25 Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:17:40 2021 +0100 model: Add support for None to the type checker For the sake of completeness (a future commit may depend on it). See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/428/ for more details.
Comment Actions You've made _compute_hash_from_attributes a "private" method, but wouldn't the git loader need to call it explicitly to know whether to populate the raw_manifest field? Apart from that question, this looks fine, thanks! Comment Actions No, it just needs to call compute_hash(). Before setting a raw_manifest, both are equivalent Comment Actions Build is green Patch application report for D6801 (id=24897)Rebasing onto 9e1e14a829... Current branch diff-target is up to date. Changes applied before testcommit f6144a15fa507ffd4e7acca207bcf5272ed16fbd Author: Valentin Lorentz <vlorentz@softwareheritage.org> Date: Wed Dec 8 16:28:25 2021 +0100 model: Add a raw_manifest attribute This will be used to store the original manifest of 'weird' git objects, when we cannot reasonably represent them otherwise. See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/436/ for more details. |