Improve Composer meta analyzer's ability to deal with minified metadata#5019
Improve Composer meta analyzer's ability to deal with minified metadata#5019nscuro merged 2 commits intoDependencyTrack:masterfrom ch8matt:patch-1
Conversation
Signed-off-by: McFY49 <[email protected]>
Some Composer repositories (e.g., Satis) do not include the "minified" key in their packages.json, even though they return packages in minified format (arrays instead of versioned objects). This commit enhances the isMinified() method to heuristically detect minified metadata by inspecting the structure of the packages object. This improves compatibility with such repositories and avoids JSON parsing issues during metadata analysis. Signed-off-by: ch8matt <[email protected]>
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
|
@valentijnscholten Can you confirm this is okay :) ? |
|
Looking at the source code of And the Summarizing I don't know why we need this PR but it does solve the problem and would be safe to merge. |
|
@nscuro Hello, could you tell me what you think about this PR ? Would love to have the feature fixed in the future version of Dependency-Track :D |
Description
Some Composer repositories (e.g., Satis) do not include the "minified" key in their packages.json,
even though they return packages in minified format (arrays instead of versioned objects).
This commit enhances the isMinified() method to heuristically detect minified metadata by inspecting
the structure of the packages object. This improves compatibility with such repositories and avoids
JSON parsing issues during metadata analysis.
Addressed Issue
Additional Details
Checklist