Description
DependencyGraph is fully implemented and tested in apps/backend/tests/deployment/dependency-graph.test.ts but is never consulted before a deployment pipeline starts. Circular dependencies or missing nodes can cause silent mid-pipeline failures.
Requirements and context
- Must be secure, tested, and documented where applicable
- Should stay reviewable and fit the current monorepo structure
- Relevant files:
apps/backend/tests/deployment/dependency-graph.test.ts, apps/backend/src/services/deployment-pipeline.service.ts
Suggested execution
- Create branch:
issue-021-validate-deployment-dependency-graph
- Keep changes scoped to the issue and reference the task IDs in the PR
Implement changes
- Build the dependency graph from the deployment's template and customization config at pipeline start
- Call
hasCycle() and reject with a descriptive error if a cycle is detected
- Log the
topologicalOrder to deployment_logs at info level for observability
Test and commit
- Add pipeline tests for: valid graph proceeds, cyclic graph rejected, missing node rejected
- Verify the deployment status is set to
failed with a user-readable message on rejection
- Edge case: single-node graph (no dependencies) must always pass validation
Example commit message
feat(pipeline): validate dependency graph before execution
Guidelines
- Prefer small, reviewable PRs
- Keep naming and data contracts consistent with the spec docs
Description
DependencyGraphis fully implemented and tested inapps/backend/tests/deployment/dependency-graph.test.tsbut is never consulted before a deployment pipeline starts. Circular dependencies or missing nodes can cause silent mid-pipeline failures.Requirements and context
apps/backend/tests/deployment/dependency-graph.test.ts,apps/backend/src/services/deployment-pipeline.service.tsSuggested execution
issue-021-validate-deployment-dependency-graphImplement changes
hasCycle()and reject with a descriptive error if a cycle is detectedtopologicalOrdertodeployment_logsatinfolevel for observabilityTest and commit
failedwith a user-readable message on rejectionExample commit message
Guidelines