Page MenuHomeSoftware Heritage

test_identifiers.py: Make sha1_git literals more consistent.
ClosedPublic

Authored by vlorentz on Sep 22 2021, 6:43 PM.

Diff Detail

Event Timeline

Build is green

Patch application report for D6328 (id=22984)

Could not rebase; Attempt merge onto b6f5e30b53...

Updating b6f5e30..8b0a01c
Fast-forward
 swh/model/from_disk.py              |   10 +-
 swh/model/git_objects.py            |  409 ++++++++++++++
 swh/model/hypothesis_strategies.py  |   10 +-
 swh/model/identifiers.py            | 1026 +----------------------------------
 swh/model/model.py                  |  138 +++--
 swh/model/swhids.py                 |  448 +++++++++++++++
 swh/model/tests/test_identifiers.py |  162 ++----
 7 files changed, 1047 insertions(+), 1156 deletions(-)
 create mode 100644 swh/model/git_objects.py
 create mode 100644 swh/model/swhids.py
Changes applied before test
commit 8b0a01c0d390a334bb4ea2633a3446158f761b9e
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 18:43:18 2021 +0200

    test_identifiers.py: Make sha1_git literals more consistent.

commit b082ffe2fe30ffd0d8ad3addb2a62c866d33f619
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:59:25 2021 +0200

    Remove identifier_to_bytes and identifier_to_hex
    
    They are not used anywhere.

commit 7e56c547276f2308c3fbdf2d980e9fc6f05c7493
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:41:15 2021 +0200

    Move manifest computation functions from identifiers.py to git_objects.py
    
    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.

commit b4764ee68e5a4a71c90e81482ed133ca8b22eb12
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:32:48 2021 +0200

    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.

commit 209356fc6704070bbac0b5f09b9c2e0c9aa2f12c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:19:10 2021 +0200

    test_identifiers.py: Fix/update malformed data dicts
    
    A future commit will make identifier computation use the attrs classes,
    which are strict about what they accept.

commit d08b45c8766ec82ef9b47c30e2d574e279a0e37e
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 16:36:30 2021 +0200

    Move SWHID classes and functions from identifiers.py to swhids.py
    
    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.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/378/ for more details.

This revision is now accepted and ready to land.Sep 22 2021, 7:27 PM
This revision was landed with ongoing or failed builds.Sep 23 2021, 7:55 PM
This revision was automatically updated to reflect the committed changes.

Build is green

Patch application report for D6328 (id=23023)

Could not rebase; Attempt merge onto 0dd33cdf7d...

Updating 0dd33cd..df73e74
Fast-forward
 swh/model/from_disk.py              |   10 +-
 swh/model/git_objects.py            |  403 ++++++++++++++
 swh/model/hypothesis_strategies.py  |   10 +-
 swh/model/identifiers.py            | 1025 +----------------------------------
 swh/model/model.py                  |  129 +++--
 swh/model/swhids.py                 |  448 +++++++++++++++
 swh/model/tests/test_identifiers.py |  174 +++---
 7 files changed, 1039 insertions(+), 1160 deletions(-)
 create mode 100644 swh/model/git_objects.py
 create mode 100644 swh/model/swhids.py
Changes applied before test
commit df73e74b40ccc24fd2c756e79bcf3eac6fc8b8b5
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 18:43:18 2021 +0200

    test_identifiers.py: Make sha1_git literals more consistent.

commit 510df60c31815f0e568d6b179a68087aa2c7394a
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:59:25 2021 +0200

    Remove identifier_to_bytes and identifier_to_hex
    
    They are not used anywhere.

commit 9e8a547622239ebf949ddbacec42e113e525c245
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:41:15 2021 +0200

    Move manifest computation functions from identifiers.py to git_objects.py
    
    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.

commit 57ae405d312879bec19107d29a20c2c290d7861d
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:32:48 2021 +0200

    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.

commit 6a72f88c5687f5b6c05f9b25eb73bce2d772f97c
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 17:19:10 2021 +0200

    test_identifiers.py: Fix/update malformed data dicts
    
    A future commit will make identifier computation use the attrs classes,
    which are strict about what they accept.

commit 9ec683264c415731286005dff823e1099ef358c3
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Wed Sep 22 16:36:30 2021 +0200

    Move SWHID classes and functions from identifiers.py to swhids.py
    
    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.

See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/389/ for more details.