Page MenuHomeSoftware Heritage

RawExtrinsicMetadata: Use ExtendedSWHID as target and remove type
ClosedPublic

Authored by vlorentz on Feb 26 2021, 3:02 PM.

Details

Reviewers
anlambert
Group Reviewers
Reviewers
Summary

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.

Note: this will break all packages handling values of RawExtrinsicMetadata.

Diff Detail

Event Timeline

Build is green

Patch application report for D5158 (id=18446)

Could not rebase; Attempt merge onto 24b653e4c0...

Updating 24b653e..0fbefec
Fast-forward
 swh/model/model.py                  | 141 +++++++++++++++------------
 swh/model/tests/swh_model_data.py   |  13 +--
 swh/model/tests/test_identifiers.py |  35 +++----
 swh/model/tests/test_model.py       | 185 +++++++++++-------------------------
 4 files changed, 159 insertions(+), 215 deletions(-)
Changes applied before test
commit 0fbefec7d7e833cda24b46c641116af8cc028340
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Feb 26 11:34:38 2021 +0100

    RawExtrinsicMetadata: Use ExtendedSWHID as target and remove type
    
    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.

commit a934fd55318e9b70c4091780081796bc551566c6
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Fri Feb 26 10:49:10 2021 +0100

    Add a swhid() method to all hashable objects.
    
    It can be handy as a shortcut to build SWHID objects.

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

anlambert added a subscriber: anlambert.

Looks good to me.

This revision is now accepted and ready to land.Mar 1 2021, 4:08 PM

Landed as 752fb81d86fb15e3d8d39ac1420afb8b5b21adfd