Add support for transitive dependencies for detect.uv.dependency.groups.only property - #1868
Merged
Conversation
bd-spratikbharti
requested review from
bd-samratmuk,
dterrybd and
zahidblackduck
and
a lite review from Copilot
September 7, 2026 08:46
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new isProjectEntry-gated behavior relies on comparing a normalized rootName to an unnormalized lockfile dependencyName, which can misclassify the project entry and incorrectly include regular/optional deps under onlyGroups.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the UV lockfile parsing logic so detect.uv.dependency.groups.only filters only the project/workspace’s top-level dependency sections, while preserving full transitive dependency chains for selected group members.
Changes:
- Narrows
onlyGroupsskipping logic to only apply to the root project / workspace entries (not all packages). - Ensures non-project packages’
dependencies(and related sections) are still parsed even whenonlyGroupsis set, preserving transitive dependencies. - Adds a regression unit test that verifies multi-level transitive dependencies are retained when scanning a selected dependency group.
File summaries
| File | Description |
|---|---|
| detectable/src/main/java/com/blackduck/integration/detectable/detectables/uv/transform/UVLockParser.java | Adjusts dependency-section parsing to avoid dropping transitive dependencies when onlyGroups is set. |
| detectable/src/test/java/com/blackduck/integration/detectable/detectables/uv/unit/UVLockParserTest.java | Adds a regression test covering transitive dependency inclusion for selected dependency groups. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dterrybd
approved these changes
Sep 10, 2026
zahidblackduck
approved these changes
Sep 11, 2026
…ups.only property is used
bd-spratikbharti
force-pushed
the
IDETECT-5305
branch
from
September 11, 2026 07:13
d1890dd to
6f5ec46
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What This Fixes
When a customer sets
detect.uv.dependency.groups.only(for example,dev) for a UV project scanned viauv.lock, Detect correctly picked only the packages in that group as direct dependencies. However, it was silently dropping those packages' own dependencies.These dependencies are still part of the actual installation and should therefore be included in the dependency graph and BOM.
What Changed
The
only-groupsfilter was being applied too broadly. It was incorrectly skipping the regular dependencies section for every package in the lockfile, rather than only for the project's own top-level dependencies.This fix narrows the filter's scope so that it applies only to project/workspace-level dependencies, which is the intended behaviour. All other packages now have their dependency lists parsed normally, ensuring that complete transitive dependency chains are preserved.
Test Coverage
Added a new unit test in
UVLockParserTestthat reproduces the real-world scenario reported by the customer: a dependency in a selected group with multiple levels of transitive dependencies.The test verifies that: