nixguix: Exclude faulty "recursive" file origins from listing

For now, those can be faulty as the manifest is missing 'critical' information about how
to recompute the hash (e.g. fs layout, executable bit, ...).

Related to T4608
Related to T3781
This commit is contained in:
Antoine R. Dumont (@ardumont) 2022-10-06 15:38:30 +02:00
parent 5a53243bd3
commit c22f41a6d7
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
2 changed files with 23 additions and 0 deletions

View file

@ -430,6 +430,18 @@ class NixGuixLister(StatelessLister[PageResult]):
# the output can be anything, including a directory tree.
outputHashMode = artifact.get("outputHashMode", "flat")
if not is_tar and outputHashMode == "recursive":
# T4608: Cannot deal with those properly yet as some can be missing
# 'critical' information about how to recompute the hash (e.g. fs
# layout, executable bit, ...)
logger.warning(
"Skipping artifact <%s>: 'file' artifact of type <%s> is "
" missing information to properly check its integrity",
artifact,
artifact_type,
)
continue
logger.debug("%s: %s", "dir" if is_tar else "cnt", origin)
yield ArtifactType.ARTIFACT, Artifact(
origin=origin,

View file

@ -37,6 +37,17 @@
],
"inferredFetcher": "fetchzip"
},
{
"outputHash": "0s2mvy1nr2v1x0rr1fxlsv8ly1vyf9978rb4hwry5vnr678ls522",
"outputHashAlgo": "sha256",
"outputHashMode": "recursive",
"type": "url",
"urls": [
"https://www.unicode.org/Public/emoji/12.1/emoji-zwj-sequences.txt"
],
"integrity": "sha256-QhRN0THZ7uIzh2RldFJyfgdP0da0u5Az6GGLbIPfVWg=",
"inferredFetcher": "unclassified"
},
{
"type": "url",
"urls": [ "unknown://example.org/wrong-scheme-so-skipped.txt" ],