Not used yet, simply opened and check coverage is good.
This will ease the detection of a swhid reference or an origin within the
<swh:deposit /> xml block.
This is a first step towards adding more support to metadata-only deposit.
Related to T2537
Differential D4442
deposit.parser: Add parse_swh_reference function Authored by ardumont on Nov 6 2020, 5:40 PM.
Details
Not used yet, simply opened and check coverage is good. This will ease the detection of a swhid reference or an origin within the This is a first step towards adding more support to metadata-only deposit. Related to T2537 tox
Diff Detail
Event TimelineComment Actions Build is green Patch application report for D4442 (id=15718)Rebasing onto a67a8cc770... Current branch diff-target is up to date. Changes applied before testcommit 7bf6671163c335f91b91bfd319715b84a9482683
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.utils: Add utils function to parse swh:deposit xml entry
Related to T2537See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/290/ for more details. Comment Actions Build is green Patch application report for D4442 (id=15719)Rebasing onto a67a8cc770... Current branch diff-target is up to date. Changes applied before testcommit 220654be7dd8ff54f0421c9bd45d1e1e77f48b5b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.utils: Add utils function to parse swh:deposit xml entry
Related to T2537See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/291/ for more details. Comment Actions Build is green Patch application report for D4442 (id=15722)Rebasing onto a67a8cc770... Current branch diff-target is up to date. Changes applied before testcommit aebd577b0f4642aebc0c9b3b28700386c9bcb44c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.parser: Add parse_swh_reference function
This will ease the detection of a swhid reference or an origin within the
<swh:deposit /> xml block.
This is a first step towards adding more support to metadata-only deposit.
Related to T2537See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/292/ for more details. Comment Actions why do we need/want clean_swhid? if there is garbage in the input we should just reject it. Comment Actions
ok, even simpler. Comment Actions
hmm, no not simpler...
Yes, but what's a valid swhid? For example: SWHID(namespace='swh', scheme_version=1, object_type='directory', object_id='31b5c8cc985d190b5a7ef4878128ebfdc2358f49', metadata=ImmutableDict({' origin': 'https://hal.archives-ouvertes.fr/hal-01243573', ' visit': 'swh:1:snp:4fc1e36fca86b2070204bedd51106014a614f321', ' anchor': 'swh:1:rev:9c5de20cfb54682370a398fcc733e829903c8cba', ' path': '/moranegg-AffectationRO-df7f68b/'}))Is that a valid swhid? (look at the keys in the Immutable Dict, they contain lots of blanks) Comment Actions
Comment Actions Build is green Patch application report for D4442 (id=15746)Rebasing onto 7148a257b2... First, rewinding head to replay your work on top of it... Applying: deposit.parser: Add parse_swh_reference function Changes applied before testcommit 0ed646d6d0577125fc168892dae39caa7c4da82c
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.parser: Add parse_swh_reference function
This will ease the detection of a swhid reference or an origin within the
<swh:deposit /> xml block.
This is a first step towards adding more support to metadata-only deposit.
Related to T2537See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/303/ for more details. Comment Actions It's something that follows this grammar: https://docs.softwareheritage.org/devel/swh-model/persistent-identifiers.html#syntax Which hopefully is equivalent to passing that call.
Forgive the intense semantic nitpicking, but SWHIDs are plain strings, so anything you build with SWHID(...) isn't an SWHID, it's an instance of the SWHID class. So I'll rephrases your question as:
and the answer currently is no, because, by definition definition, SWHIDs cannot contain spaces. Comment Actions
Cool, thanks for the clarification. But that's not a logic that should be done deposit side (or clients of the parse_swhid function for that matters). Comment Actions Update documentation and code to test on valid swhid The swhid invalidity checks need to happen in the Comment Actions Build has FAILED Patch application report for D4442 (id=15767)Rebasing onto 7148a257b2... Current branch diff-target is up to date. Changes applied before testcommit 1ac47c1d5c622da1a7b118e36d01514f1ec26c0b
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.parser: Add parse_swh_reference function
This will ease the detection of a swhid reference or an origin within the
<swh:deposit /> xml block.
This is a first step towards adding more support to metadata-only deposit.
Related to T2537Link to build: https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/308/ Comment Actions Build is green Patch application report for D4442 (id=15769)Rebasing onto 7148a257b2... Current branch diff-target is up to date. Changes applied before testcommit 018500c195610398bc78c68720446c295a6b7359
Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org>
Date: Fri Nov 6 17:39:08 2020 +0100
deposit.parser: Add parse_swh_reference function
This will ease the detection of a swhid reference or an origin within the
<swh:deposit /> xml block.
This is a first step towards adding more support to metadata-only deposit.
Related to T2537See https://jenkins.softwareheritage.org/job/DDEP/job/tests-on-diff/309/ for more details. |