[provenance] HistoryGraph building is failing when reaching the first revision
The the origin layer is plugged on the graph, when the first parent revision is reached, the graph doesn't found any relation and return an empty string:
/tmp/petsc @5f4ed19a ❯ http "http://graph.internal.softwareheritage.org:5009/graph/neighbors/swh:1:rev:0ebd13eb0d83a1506b322480611f8c87f30f3546?edges=rev:rev&direction=forward&max_edges=0&return_types=rev"
HTTP/1.1 200 OK
Content-Type: text/plain
Date: Tue, 07 Jun 2022 22:41:03 GMT
Server: Python/3.7 aiohttp/3.6.2
Transfer-Encoding: chunked
swh:1:rev:5f4ed19a8efdb486a315195012d444ef692ac3ef
/tmp/petsc @5f4ed19a ❯ http "http://graph.internal.softwareheritage.org:5009/graph/neighbors/swh:1:rev:5f4ed19a8efdb486a315195012d444ef692ac3ef?edges=rev:rev&direction=forward&max_edges=0&return_types=rev"
HTTP/1.1 200 OK
Content-Type: text/plain
Date: Tue, 07 Jun 2022 22:41:09 GMT
Server: Python/3.7 aiohttp/3.6.2
Transfer-Encoding: chunked
/tmp/petsc @5f4ed19a ❯ git --no-pager log 5f4ed19a8efdb486a315195012d444ef692ac3ef
commit 5f4ed19a8efdb486a315195012d444ef692ac3ef (HEAD)
Author: <redacted>
Date: Thu Sep 22 10:38:35 1994 -0600
Initial revision
It fails on the provenance side when the result is parsed:
origin_client_1 | Process worker0:
origin_client_1 | Traceback (most recent call last):
origin_client_1 | File "/usr/local/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
origin_client_1 | self.run()
origin_client_1 | File "/src/swh-provenance/swh/provenance/tools/origins/client.py", line 64, in run
origin_client_1 | origin_add(provenance, archive, batch)
origin_client_1 | File "/src/venv/lib/python3.9/site-packages/swh/core/statsd.py", line 120, in wrapped
origin_client_1 | result = func(*args, **kwargs)
origin_client_1 | File "/src/swh-provenance/swh/provenance/origin.py", line 68, in origin_add
origin_client_1 | proceed_origin(provenance, archive, origin)
origin_client_1 | File "/src/venv/lib/python3.9/site-packages/swh/core/statsd.py", line 120, in wrapped
origin_client_1 | result = func(*args, **kwargs)
origin_client_1 | File "/src/swh-provenance/swh/provenance/origin.py", line 88, in proceed_origin
origin_client_1 | graph = HistoryGraph(archive, revision)
origin_client_1 | File "/src/venv/lib/python3.9/site-packages/swh/core/statsd.py", line 120, in wrapped
origin_client_1 | result = func(*args, **kwargs)
origin_client_1 | File "/src/swh-provenance/swh/provenance/graph.py", line 42, in __init__
origin_client_1 | current.retrieve_parents(archive)
origin_client_1 | File "/src/swh-provenance/swh/provenance/model.py", line 67, in retrieve_parents
origin_client_1 | self._parents_entries = [RevisionEntry(id) for id in self._parents_ids]
origin_client_1 | File "/src/swh-provenance/swh/provenance/model.py", line 67, in <listcomp>
origin_client_1 | self._parents_entries = [RevisionEntry(id) for id in self._parents_ids]
origin_client_1 | File "/src/swh-provenance/swh/provenance/swhgraph/archive.py", line 32, in revision_get_parents
origin_client_1 | yield from (CoreSWHID.from_string(swhid).object_id for swhid in request)
origin_client_1 | File "/src/swh-provenance/swh/provenance/swhgraph/archive.py", line 32, in <genexpr>
origin_client_1 | yield from (CoreSWHID.from_string(swhid).object_id for swhid in request)
origin_client_1 | File "/src/venv/lib/python3.9/site-packages/swh/model/swhids.py", line 140, in from_string
origin_client_1 | parts = _parse_swhid(s)
origin_client_1 | File "/src/venv/lib/python3.9/site-packages/swh/model/swhids.py", line 443, in _parse_swhid
origin_client_1 | raise ValidationError(
origin_client_1 | swh.model.exceptions.ValidationError: ['Invalid SWHID: invalid syntax: ']
Migrated from T4314 (view on Phabricator)