It is cleaner, avoids warnings, and will be needed when introducing
ExtendedSWHID in a future commit.
Depends on D5116.
Differential D5117
Use dict instead of temporary SWHID when parsing {Core,Qualified}SWHID. Authored by vlorentz on Feb 19 2021, 2:17 PM.
Details
It is cleaner, avoids warnings, and will be needed when introducing Depends on D5116.
Diff Detail
Event TimelineComment Actions Build has FAILED Patch application report for D5117 (id=18303)Could not rebase; Attempt merge onto 758eb885d3... Updating 758eb88..3668e2e Fast-forward swh/model/identifiers.py | 349 +++++++++++++++++++++++++++++++++-- swh/model/tests/test_identifiers.py | 359 ++++++++++++++++++++++++++++++++++-- tox.ini | 1 + 3 files changed, 673 insertions(+), 36 deletions(-) Changes applied before testcommit 3668e2e928d0452af9116c5b56da73afd5720737
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Fri Feb 19 13:58:03 2021 +0100
Use dict instead of temporary SWHID when parsing {Core,Qualified}SWHID.
It is cleaner, avoids warnings, and will be needed when introducing
ExtendedSWHID in a future commit.
commit 8e917597dbb22054ada06387a0501452d8862d34
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Fri Feb 19 10:56:29 2021 +0100
QualifiedSWHID: Replace the 'qualifiers' dict with statically defined attributes
And store their parsed values (CoreSWHID, tuple of ints, etc.) instead of string.
commit eba8d84de660e2b3d7df304fa32da7404fb9f6bb
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Thu Feb 18 13:09:21 2021 +0100
Add new class CoreSWHID as an alternative to SWHID/QualifiedSWHID
Following the discussion on T3034, we decided to replace SWHID with
two or three classes:
* QualifiedSWHID to replace the existing SWHID (standard types + qualifiers)
* CoreSWHID, for "core SWHID" only (standard types + no qualifiers)
* ExtendedSWHID for internal use in Software Heritage (extra types + no qualifiers)
This commit adds the second one
commit 690b7f824f55bc65fbec21b29714926476038abb
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Tue Feb 16 13:33:13 2021 +0100
Add new class QualifiedSWHID to replace SWHID, and deprecate the latter.
Following the discussion on T3034, we decided to replace SWHID with
two or three classes:
* QualifiedSWHID to replace the existing SWHID (standard types + qualifiers)
* CoreSWHID, for "core SWHID" only (standard types + no qualifiers)
* ExtendedSWHID for internal use in Software Heritage (extra types + no qualifiers)
Since migrating from SWHID will break existing code, this commit uses
the opportunity to modernize it a little, ie.:
* `keyword`-only constructor, to get rid of the hacky default values for
`object_type` and `object_id`
* enum instead of strings for the object type
* `bytes` instead of an hex string for the object id
* rename `metadata` to `qualifiers`Link to build: https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/247/ Comment Actions remove 'type: ignore' on QualifiedSWHID(parts, qualifiers), mypy no longer needs/accepts it Comment Actions Build is green Patch application report for D5117 (id=18304)Could not rebase; Attempt merge onto 758eb885d3... Updating 758eb88..9923765 Fast-forward swh/model/identifiers.py | 349 +++++++++++++++++++++++++++++++++-- swh/model/tests/test_identifiers.py | 359 ++++++++++++++++++++++++++++++++++-- tox.ini | 1 + 3 files changed, 673 insertions(+), 36 deletions(-) Changes applied before testcommit 992376597d6f44dfe78c4eef40bf651fe355f0fd
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Fri Feb 19 13:58:03 2021 +0100
Use dict instead of temporary SWHID when parsing {Core,Qualified}SWHID.
It is cleaner, avoids warnings, and will be needed when introducing
ExtendedSWHID in a future commit.
commit 8e917597dbb22054ada06387a0501452d8862d34
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Fri Feb 19 10:56:29 2021 +0100
QualifiedSWHID: Replace the 'qualifiers' dict with statically defined attributes
And store their parsed values (CoreSWHID, tuple of ints, etc.) instead of string.
commit eba8d84de660e2b3d7df304fa32da7404fb9f6bb
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Thu Feb 18 13:09:21 2021 +0100
Add new class CoreSWHID as an alternative to SWHID/QualifiedSWHID
Following the discussion on T3034, we decided to replace SWHID with
two or three classes:
* QualifiedSWHID to replace the existing SWHID (standard types + qualifiers)
* CoreSWHID, for "core SWHID" only (standard types + no qualifiers)
* ExtendedSWHID for internal use in Software Heritage (extra types + no qualifiers)
This commit adds the second one
commit 690b7f824f55bc65fbec21b29714926476038abb
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Tue Feb 16 13:33:13 2021 +0100
Add new class QualifiedSWHID to replace SWHID, and deprecate the latter.
Following the discussion on T3034, we decided to replace SWHID with
two or three classes:
* QualifiedSWHID to replace the existing SWHID (standard types + qualifiers)
* CoreSWHID, for "core SWHID" only (standard types + no qualifiers)
* ExtendedSWHID for internal use in Software Heritage (extra types + no qualifiers)
Since migrating from SWHID will break existing code, this commit uses
the opportunity to modernize it a little, ie.:
* `keyword`-only constructor, to get rid of the hacky default values for
`object_type` and `object_id`
* enum instead of strings for the object type
* `bytes` instead of an hex string for the object id
* rename `metadata` to `qualifiers`See https://jenkins.softwareheritage.org/job/DMOD/job/tests-on-diff/248/ for more details. |