Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122804
D2949.id11294.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D2949.id11294.diff
View Options
diff --git a/swh/loader/package/nixguix/loader.py b/swh/loader/package/nixguix/loader.py
--- a/swh/loader/package/nixguix/loader.py
+++ b/swh/loader/package/nixguix/loader.py
@@ -65,11 +65,21 @@
def resolve_revision_from(
self, known_artifacts: Dict, artifact_metadata: Dict
) -> Optional[bytes]:
-
for rev_id, known_artifact in known_artifacts.items():
- known_integrity = known_artifact["extrinsic"]["raw"]["integrity"]
- if artifact_metadata["integrity"] == known_integrity:
- return rev_id
+ try:
+ known_integrity = known_artifact["extrinsic"]["raw"]["integrity"]
+ except KeyError as e:
+ logger.warning(
+ "Divergent metadata revision structure detected, skipping. "
+ f"Reason: {e}"
+ )
+ # metadata field for the revision is not as expected by the loader
+ # nixguix. We consider this not the right revision and continue checking
+ # the other revisions
+ continue
+ else:
+ if artifact_metadata["integrity"] == known_integrity:
+ return rev_id
return None
def extra_branches(self) -> Dict[bytes, Mapping[str, Any]]:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 17, 2:10 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227645
Attached To
D2949: nixguix: catch and log artifact resolution failures
Event Timeline
Log In to Comment