Skip to content

Commit b6b988a

Browse files
authored
Fix attributes being dropped during dedupe (#34)
1 parent 3169feb commit b6b988a

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

socketdev/core/dedupe.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,10 @@ def alert_identity(alert: dict) -> tuple:
5656
alert_map[identity]["releases"].append(release)
5757

5858
base = package_group[0]
59-
return {
60-
"id": base.get("id"),
61-
"author": base.get("author"),
62-
"size": base.get("size"),
63-
"type": base.get("type"),
64-
"name": base.get("name"),
65-
"namespace": base.get("namespace"),
66-
"version": base.get("version"),
67-
"releases": sorted(releases),
68-
"alerts": list(alert_map.values()),
69-
"score": base.get("score", {}),
70-
"license": base.get("license"),
71-
"licenseDetails": base.get("licenseDetails", []),
72-
"batchIndex": base.get("batchIndex"),
73-
"purl": f"pkg:{base.get('type', 'unknown')}/{base.get('name', 'unknown')}@{base.get('version', '0.0.0')}"
74-
}
59+
base["releases"] = sorted(releases)
60+
base["alerts"] = list(alert_map.values())
61+
base["purl"] = f"pkg:{base.get('type', 'unknown')}/{base.get('name', 'unknown')}@{base.get('version', '0.0.0')}"
62+
return base
7563

7664
@staticmethod
7765
def dedupe(packages: List[Dict[str, Any]], batched: bool = True) -> List[Dict[str, Any]]:

socketdev/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.20"
1+
__version__ = "2.0.21"

0 commit comments

Comments
 (0)