Render affected artifacts as dependency graph roots#830
Open
nicksan222 wants to merge 5 commits into
Open
Conversation
Contributor
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the dependency vulnerability graph rendering so that affected build artifacts appear as the entry points (roots) into the graph instead of always starting from the synthetic “Your application” root node, improving clarity when multiple artifacts share the same vulnerable dependency path.
Changes:
- Render artifact nodes as layout roots when the dependency tree’s direct children are artifacts, while still keeping the synthetic root in the view model for traversal/risk propagation.
- Extend graph highlighting to support multiple highlighted paths (one per artifact) instead of a single path.
- Improve artifact label formatting by stripping the internal
artifact:prefix and mapping empty artifact names to “Default”, with added tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/dependencyGraphHelpers.ts | Renders artifact children as layout roots and reuses a shared visited set for deterministic merged layout. |
| src/utils/dependencyGraphHelpers.test.ts | Adds coverage for shared dependency paths across multiple artifact roots and root rendering behavior. |
| src/utils/common.ts | Formats artifact: identifiers for display (strip prefix; empty becomes “Default”). |
| src/utils/common.test.ts | Adds tests for artifact label formatting behavior in beautifyPurl. |
| src/components/DependencyGraph.tsx | Changes highlight handling from a single path to multiple paths and updates edge highlighting logic. |
| src/app/(loading-group)/[organizationSlug]/projects/[projectSlug]/assets/[assetSlug]/refs/[assetVersionSlug]/dependency-risks/[vulnId]/page.tsx | Builds per-artifact graph paths and wires them into the graph + highlighting props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.

What this fixes
Dependency vulnerability graphs currently begin at the synthetic “Your application” node. That hides which artifacts actually contain the vulnerable dependency path, especially when the same path belongs to several artifacts.
This change renders every affected artifact as an entry point into the graph and connects each one to the shared dependency path.
Design
artifactsrelation. The paths are sorted for deterministic layout and merged through the existing tree conversion, so shared dependency nodes are not duplicated.artifact:identifier prefix only when formatting labels. Empty artifact names use the existing “Default” terminology.Tests
bun test src/hooks/useCreateVexRule.test.ts src/utils/dependencyGraphHelpers.test.ts src/utils/common.test.tsnpm run buildFixes l3montree-dev/devguard#2416