Fix circular dependency detection and hide empty graph modal
- Add artifact-level self-dependency check (skip if dep resolves to same artifact) - Close dependency graph modal if package has no dependencies to show (only root package with no children and no missing deps)
This commit is contained in:
@@ -791,6 +791,11 @@ def resolve_dependencies(
|
||||
continue
|
||||
|
||||
dep_artifact_id, dep_version, dep_size = resolved_dep
|
||||
|
||||
# Skip if resolved to same artifact (self-dependency at artifact level)
|
||||
if dep_artifact_id == artifact_id:
|
||||
continue
|
||||
|
||||
_resolve_recursive(
|
||||
dep_artifact_id,
|
||||
dep.dependency_project,
|
||||
|
||||
@@ -117,6 +117,14 @@ function DependencyGraph({ projectName, packageName, tagName, onClose }: Depende
|
||||
|
||||
try {
|
||||
const result = await resolveDependencies(projectName, packageName, tagName);
|
||||
|
||||
// If only the root package (no dependencies) and no missing deps, close the modal
|
||||
const hasDeps = result.artifact_count > 1 || (result.missing && result.missing.length > 0);
|
||||
if (!hasDeps) {
|
||||
onClose();
|
||||
return;
|
||||
}
|
||||
|
||||
setResolution(result);
|
||||
|
||||
const graph = await buildGraph(result);
|
||||
|
||||
Reference in New Issue
Block a user