Add component dependency tree API#621
Merged
Merged
Conversation
Co-authored-by: Codex <noreply@openai.com>
Contributor
Coverage Report
File CoverageNo changed files found. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Components API endpoint to fetch a bounded dependency tree (direct + transitive) from Neo4j, including cycle detection, truncation metadata, and optional system/scope filtering, backed by new repository/service plumbing and OpenAPI + type definitions.
Changes:
- Added
GET /api/components/{key}/dependenciesAPI handler with query param validation (system,scope,maxDepth,limit) and OpenAPI docs. - Added Neo4j recursive
DEPENDS_ONquery and repository/service methods to build a dependency tree with depth + circular flags. - Added repository + API tests covering empty trees, transitive nesting, cycles, and system/scope filtering.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| types/api.d.ts | Adds API types for dependency tree responses. |
| server/api/components/[key]/dependencies.get.ts | New endpoint handler for dependency tree retrieval + validation. |
| server/services/component.service.ts | Exposes dependency-tree method on the ComponentService. |
| server/repositories/component.repository.ts | Executes recursive query and builds the in-memory tree structure. |
| server/database/queries/components/find-dependencies-recursive.cypher | Recursive bounded Cypher query to collect dependency paths with optional system/scope filters. |
| server/openapi.ts | Adds OpenAPI schemas for DependencyNode + DependencyTreeResponse. |
| public/openapi.json | Generated OpenAPI output updated with the new schemas + path. |
| test/server/repositories/component.repository.spec.ts | Integration-style tests for repository tree generation behavior. |
| test/server/api/component-dependencies.spec.ts | Unit tests for the new API handler behavior and validation. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
Adds
GET /api/components/{key}/dependenciesto return a bounded dependency tree for a component, including direct and transitive dependencies, depth metadata, cycle flags, truncation metadata, and optional system-scoped scope filtering.The endpoint requires
systemwhenscopeis provided because dependency scope is stored onSystem -[:USES]-> Componentrelationships rather than onDEPENDS_ONedges.Type of Change
Related Issues
Fixes #616
Relates to #616
Changes Made
DEPENDS_ONquery for component dependency trees.DependencyNodeandDependencyTreeResponse.Screenshots
Not applicable.
Checklist
npm run lintand fixed any issuesnpm run devnpm run buildAdditional Notes
Verification run locally:
npm run testnpm run lintnpm run mdlintnpm run docs:api