Skip to content

Add dependency graph ingestion module for service topology analysis - #10

Open
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1779846517-dependency-graph-module
Open

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1779846517-dependency-graph-module

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown

Summary

Introduces a new dependency-graph Maven module that parses the bank application's infrastructure configuration files and normalizes them into a typed graph model. This enables programmatic analysis of service dependencies for incident investigation, impact analysis, and change management.

Graph Model

  • Nodes with typed categories: SERVICE, DATABASE, MESSAGE_BROKER, EVENT_STORE, MAIL_SERVER, GATEWAY, DISCOVERY
  • Edges with typed relationships: HTTP, JDBC, AMQP, SMTP, EUREKA_REGISTER, GATEWAY_ROUTE, AXON
  • Full metadata support on both nodes and edges (ports, database names, predicates, URIs, etc.)

Parsers

Parser Input What it extracts
DockerComposeParser docker-compose.yml Service topology, depends_on edges, inferred DB/Axon/mail/RabbitMQ nodes from env vars
EurekaRegistrationParser application.properties / application.yml Eureka registration edges, JDBC connections, Axon Server, mail server
GatewayRouteParser Gateway application.yml Explicit lb:// and http:// routes, discovery-first routing mode, route predicates

How this improves incident investigation

When a service fails or behaves unexpectedly, responders need to quickly answer: "What does this service depend on, and what depends on it?" Today, that requires reading Docker Compose files, application properties, and Feign client annotations across multiple modules.

This module automates that by building a queryable graph from the existing config files. With the graph, you can:

  • Trace blast radius: given a failing MySQL instance, instantly find every service with a JDBC edge to it
  • Identify upstream/downstream impact: if account-service is down, query incoming edges to see which gateway routes and Feign clients are affected
  • Detect infrastructure drift: compare the Docker Compose graph against Eureka registration graphs to find services that are defined but not registering (or vice versa)
  • Support runbook automation: feed the graph into alerting/triage tools to auto-correlate alerts with service dependencies

Test coverage

59 tests across 4 test classes covering:

  • Valid inputs from the actual bank repo configurations
  • Malformed YAML, null/blank content, missing required keys
  • Map-style and list-style depends_on
  • Map-style and list-style environment variables
  • RabbitMQ, Axon, SMTP infrastructure inference
  • Discovery-first vs explicit gateway routing
  • Graph model operations (merge, filtering, equality, metadata immutability)

Review & Testing Checklist for Human

  • Verify the parsers produce correct graphs for the actual docker-compose.yml and application.properties files in this repo — run mvn test -pl dependency-graph
  • Review the NodeType and EdgeType enums to confirm they cover the infrastructure types relevant to your deployment
  • Check that the DockerComposeParser correctly infers MySQL, Axon, and mail connections from environment variable patterns in your compose file

Notes

  • The module is a pure library with no Spring Boot dependency — only SnakeYAML for parsing. This keeps it lightweight and usable in CLI tools, CI pipelines, or runtime services.
  • The DependencyGraph.merge() method allows combining graphs from multiple parsers into a unified view.
  • The authentication-service appears as user-service in docker-compose.yml — both are captured correctly by their respective parsers.

Link to Devin session: https://app.devin.ai/sessions/75cc02940ecf4523a51f2964865feee2
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)

Introduce a new dependency-graph module that parses infrastructure
configuration files and normalizes them into a typed graph model
with nodes (services, databases, message brokers, event stores,
mail servers) and edges (HTTP, JDBC, AMQP, SMTP, Eureka registration,
Gateway routing, Axon).

Parsers included:
- DockerComposeParser: extracts service topology, depends_on edges,
  and infers infrastructure nodes from environment variables
- EurekaRegistrationParser: parses Spring application.properties/.yml
  to extract Eureka registration, datasource, mail, and Axon connections
- GatewayRouteParser: parses Spring Cloud Gateway YAML for explicit
  routes (lb:// and http://) and discovery-first routing mode

59 tests covering valid inputs, malformed YAML, missing keys,
null/blank content, map/list-style depends_on, and various
infrastructure combinations.

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

devin-ai-integration[bot]

This comment was marked as resolved.

Replace naive indexOf(':') with a regex that iteratively resolves all
${VAR:default} placeholders in a string. The previous implementation
broke on values like jdbc:mysql://${HOST:localhost}:${PORT:3306}/db
because it found the colon in 'jdbc:' instead of within the placeholder.

Add tests for JDBC URL placeholder resolution and multi-placeholder
Axon server values.

Co-Authored-By: Achal Channarasappa <achal.channarasappa@cognition.ai>
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