Skip to content

Add dependency graph module and outage investigation - #12

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779846587-dependency-graph-module
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1779846587-dependency-graph-module

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented May 27, 2026

Copy link
Copy Markdown

Summary

Adds a new dependency-graph Maven module that parses the bank platform's infrastructure configuration into a typed dependency graph, and uses it to investigate a simulated outage scenario.

Graph module (dependency-graph/):

  • Model: Node (typed: SERVICE, DATABASE, MESSAGE_BROKER), Edge (typed: HTTP, JDBC, AMQP, EUREKA), and DependencyGraph with BFS-based path tracing and blast radius computation.
  • Parsers:
    • DockerComposeParser — extracts services, depends_on edges, JDBC/AMQP connections from environment variables, and classifies nodes by image/name keywords.
    • EurekaConfigParser — parses application.properties and application.yml for Eureka registration metadata and creates EUREKA-typed edges.
    • GatewayRouteParser — parses Spring Cloud Gateway routes (explicit lb:// routes and discovery-first routing) into HTTP edges.
    • DependencyGraphBuilder — orchestrates all parsers from a project root directory.
  • Analysis: OutageAnalyzer traces dependency chains, computes transitive blast radius, gathers evidence, and generates markdown investigation reports.

Tests (35 total, all passing):

  • DockerComposeParserTest (9 tests) — valid compose, broker/DB classification, JDBC edge extraction, malformed/empty inputs.
  • EurekaConfigParserTest (9 tests) — properties and YAML parsing, register/no-register behavior, missing app name.
  • GatewayRouteParserTest (7 tests) — discovery-first routing, explicit routes with predicate paths, malformed/empty configs.
  • DependencyGraphBuilderTest (3 tests) — combined source building, null gateway handling, mixed edge types.
  • OutageAnalyzerTest (7 tests) — dependency chain tracing, blast radius computation, evidence gathering, disconnected nodes, markdown report generation.

Outage investigation (OUTAGE-INVESTIGATION.md):

  • Traces notification-service → discovery-service dependency chain via EUREKA registration and Docker Compose depends_on.
  • Identifies blast radius: all 5 downstream services affected (complete system outage).
  • Root cause: single Eureka instance is a single point of failure.
  • Proposes config changes: HA Eureka (peer replication), Resilience4j circuit breakers, extended lease durations, registry caching, health-check-based depends_on.

Review & Testing Checklist for Human

  • Verify the dependency graph accurately represents the bank platform topology by comparing with docker-compose.yml and service application.properties files
  • Review OUTAGE-INVESTIGATION.md resilience recommendations for applicability to your deployment environment (e.g., whether HA Eureka with peer replication is feasible)
  • Run mvn test -pl dependency-graph to confirm all 35 tests pass locally
  • Consider whether additional edge types should be modeled (e.g., Axon Server connections from account-service)

Recommended test plan: Run mvn clean test -pl dependency-graph and verify 35/35 tests pass. Review the outage investigation document against your understanding of the system's actual runtime behavior.

Notes

  • The module has no runtime dependencies beyond SnakeYAML (already provided by Spring Boot parent). Test dependencies use spring-boot-starter-test for JUnit 5.
  • The DependencyGraphBuilder.buildFromProjectRoot() method can be used to generate a live graph from the actual repo on disk.
  • The Docker Compose parser infers JDBC connections from MYSQL_HOST/MYSQL_DATABASE env vars in addition to parsing jdbc: URLs directly.

Link to Devin session: https://app.devin.ai/sessions/bf1182d4e6644e51ad40772ea5704e80
Requested by: @achalc


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

- New Maven module: dependency-graph
- Parsers for Docker Compose topology, Eureka discovery metadata,
  and Spring Cloud Gateway routes
- Graph model with typed nodes (SERVICE, DATABASE, MESSAGE_BROKER)
  and edges (HTTP, JDBC, AMQP, EUREKA)
- OutageAnalyzer: traces dependency chains, computes blast radius,
  generates markdown investigation reports
- 35 tests covering valid inputs, malformed inputs, and edge cases
- OUTAGE-INVESTIGATION.md: notification-service failure analysis
  tracing discovery-service as single point of failure, with
  resilience config recommendations (HA Eureka, circuit breakers,
  health checks, extended leases)

Co-Authored-By: Achal Channarasappa <achal.channarasappa@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant