-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bundler(fix): Generate purls for platform specific gems
This commit fixes a bug when downloading platform specific gems. All SBOM components are de-duplicated by the PURL as the key. We have to ensure that all gems that are downloaded are accurately recorded in the SBOM, so all downloaded gems must have an unique PURL -> add platform qualifier to the PURL. + Regenerate test data to reflect this change. Signed-off-by: Michal Šoltis <[email protected]>
- Loading branch information
1 parent
fce7117
commit ff4f85a
Showing
4 changed files
with
178 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,7 +397,87 @@ | |
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]", | ||
"purl": "pkg:gem/[email protected]?platform=aarch64-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=arm-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=arm64-darwin", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86_64-darwin", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86_64-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -408,7 +408,87 @@ | |
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]", | ||
"purl": "pkg:gem/[email protected]?platform=aarch64-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=arm-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=arm64-darwin", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86_64-darwin", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
{ | ||
"name": "nokogiri", | ||
"properties": [ | ||
{ | ||
"name": "cachi2:bundler:package:binary", | ||
"value": "true" | ||
}, | ||
{ | ||
"name": "cachi2:found_by", | ||
"value": "cachi2" | ||
} | ||
], | ||
"purl": "pkg:gem/[email protected]?platform=x86_64-linux", | ||
"type": "library", | ||
"version": "1.16.7" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,6 +318,15 @@ def test_purls(rooted_tmp_path_repo: RootedPath) -> None: | |
), | ||
"pkg:gem/[email protected]", | ||
), | ||
( | ||
GemPlatformSpecificDependency( | ||
name="my-platform-gem-dep", | ||
version="0.1.0", | ||
source="https://rubygems.org", | ||
platform="x86_64_linux", | ||
), | ||
"pkg:gem/[email protected]?platform=x86_64_linux", | ||
), | ||
( | ||
GitDependency( | ||
name="my-git-dep", | ||
|