lister.nixguix: Propagate the origin reference to the loader
Without this, the loader will fail. Refs. swh/meta#4979
This commit is contained in:
parent
0756c44ea3
commit
197fb3400b
2 changed files with 11 additions and 5 deletions
|
@ -626,15 +626,18 @@ class NixGuixLister(StatelessLister[PageResult]):
|
|||
def artifact_to_listed_origin(self, artifact: Artifact) -> Iterator[ListedOrigin]:
|
||||
"""Given an artifact (tarball, file), yield one ListedOrigin."""
|
||||
assert self.lister_obj.id is not None
|
||||
loader_arguments = {
|
||||
"checksums": artifact.checksums,
|
||||
"checksum_layout": artifact.checksum_layout.value,
|
||||
"fallback_urls": artifact.fallback_urls,
|
||||
}
|
||||
if artifact.ref:
|
||||
loader_arguments["ref"] = artifact.ref
|
||||
yield ListedOrigin(
|
||||
lister_id=self.lister_obj.id,
|
||||
url=artifact.origin,
|
||||
visit_type=artifact.visit_type,
|
||||
extra_loader_arguments={
|
||||
"checksums": artifact.checksums,
|
||||
"checksum_layout": artifact.checksum_layout.value,
|
||||
"fallback_urls": artifact.fallback_urls,
|
||||
},
|
||||
extra_loader_arguments=loader_arguments,
|
||||
)
|
||||
|
||||
def get_origins_from_page(
|
||||
|
|
|
@ -359,6 +359,9 @@ def test_lister_nixguix_ok(datadir, swh_scheduler, requests_mock):
|
|||
# no last update is listed on those manifests
|
||||
assert listed_origin.last_update is None
|
||||
|
||||
if listed_origin.visit_type in {"git-checkout", "svn-export", "hg-checkout"}:
|
||||
assert listed_origin.extra_loader_arguments["ref"] is not None
|
||||
|
||||
mapping_visit_types[listed_origin.visit_type] += 1
|
||||
|
||||
assert dict(mapping_visit_types) == expected_visit_types
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue