rfellows / dependency-graphml-merger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dependency-graphml-merger

Provides the capability to merge graphml files produced by my modified maven-dependency-plugin (https://github.com/rfellows/maven-dependency-plugin) into a single graph

Required

  • Maven, version 3+
  • Java JDK 1.8
  • This settings.xml in your /.m2 directory

Optional

###Generate graphs You can generate sample graphs just by running the unit tests.

$ mvn clean test

This will generate 2 different graphs.

  • A GraphML file target/merged.graphml
  • A Neo4J graph database target/neo4j/data/databases/graph.db/

Viewing the neo4j database

# Run the tests first so the db gets created
$ mvn clean test

# If you haven't done so already, get the latest neo4j docker image.
$ docker pull neo4j

# start up the neo4j container, pointing it at the graph database we just generated by running the tests
$ docker run --publish=7474:7474 --publish=7687:7687 --volume=$PWD/target/neo4j/data:/data --env=NEO4J_AUTH=none neo4j
 

At this point, you should be able to open up the neo4j web interface and run queryies against the data.

Open http://localhost:7474/browser

To see the entire graph, run this command in the :

MATCH(a:Artifact) return a;

TODO/Potential Stories

  • Figure out a way to handle updates (really removed dependency connections) from the graph.
    • Either always build the whole graph or
    • Handle dependency relationships that "go-away". Meaning project A used to depend on B & C. But in the new sub-graph that we try to merge in for A only shows a dependency on B. The dependency on C has gone away. We would need to remove this prior relationship from the graph.
  • Work out a way to automate the gathering of the dependency graphs from each pentaho artifact and feed them into the graph merger.
    • Maybe add a profile to the parent poms that use the updated maven-dependency-plugin to generate the graphml files and publish them to nexus as artifacts with a new classifier (maybe graphml).
    • Then we have a maven project that resolves all of them in and generates the merged graph.
    • We would then fire up a server that can accept requests for dependency graph inquiries.
  • Build tools/utilities that make use of the merged graph information
    • Something for wingman to add to the comments on PRs that the current project has downstream dependencies that might be impacted.
    • Some commandline tool or maven plugin that devs can run to determine what downstream projects depend on the one they are interested in
    • Automate the downstream relationships of Jenkins (devci) jobs

Sample neo4j cypher queries

This is a great resource for learning cypher: http://neo4j.com/docs/developer-manual/3.1/cypher/clauses/

Get all artifacts (up to 6 relationships away) that depend on kettle-engine

match (a:Artifact {artifactId: "kettle-engine"})<-[*1..6]-(d:Artifact)
return a,d;

Get all artifacts that either depend on pentaho-geo-core or that pentaho-geo-core depends on

match (a:Artifact {artifactId: "pentaho-geo-core"})-[*1..6]-(d:Artifact)
return a,d;

About


Languages

Language:Java 100.0%