Page tree
Skip to end of metadata
Go to start of metadata

This dependency graph shows all dependencies that are referenced from at least one pom.xml file of the platform-complete modules. An arrow X → Y means that module X depends on module Y.

It lists all maven/pom.xml based FOLIO code libraries and suggests in which order they should be released for a platform release (for example Lotus): Bottom row on day 1, second row from bottom on day 2, etc.

Why are many modules missing from the graph? It only shows code libraries to reduce the noise. It doesn't shows modules that only use FOLIO code libraries but don't provide some FOLIO code library.

Why is mod-configuration shown? A released mod-configuration version always consists of two maven sub-modules: mod-configuration-server (the actual back-end module) and mod-configuration-client, a code library used by many other modules to access mod-configuration-server.

Generate graph

How to generate the dependency graph:

set -e

get-install() {
  wget https://raw.githubusercontent.com/folio-org/platform-complete/master/install.json -O install.json
}

modules() {
  MODULES=`
  cat install.json \
    | jq '.[].id' \
    | sed '/^"folio_/d;        # remove front-end modules
           s/"//;              # remove heading quote
           s/-[[:digit:]].*//  # remove the version number suffix '
  `
}

pull() {
  ln -s Net-Z3950-FOLIO mod-z3950 >/dev/null 2>&1  || true
  for MODULE in $MODULES ; do
    echo $MODULE
    cd $MODULE
    git checkout master
    git pull
    cd ..
  done
}

dependencytrees() {
  for MODULE in $MODULES ; do
    cd $MODULE
    if [ -e pom.xml ]
    then
      echo "$MODULE" >&2
      mvn dependency:tree -B -DoutputType=dot -Dincludes=org.folio,org.folio.okapi,org.olf
    fi
    cd ..
  done
}

convert() {
  grep -E '"(org.folio|org.folio.okapi|org.olf):.* -> "(org.folio|org.folio.okapi|org.olf):' \
    | sed -E 's/"org.folio:(cql2pgjson|cql2pgjson-cli|dbschema|domain-models-api-aspects|domain-models-api-interfaces|domain-models-interface-extensions|domain-models-maven-plugin|domain-models-runtime|domain-models-runtime-it|postgres-runner|postgres-testing|rules|testing|util):/"org.folio:RMB:/g' \
    | sed -E 's/:okapi-[^:]+:/:okapi:/g' \
    | sed -E 's/:([^:]+)-(server|client):/:\1:/g' \
    | sed -E 's/:(mod-erm-usage-counter|mod-erm-usage-harvester|folio-service-tools)[^:]+:/:\1:/g' \
    | sed -E -n '/^[^:]+:([^:]+)+:.* "[^:]+:([^:]+):.*/s//"\1" -> "\2"/p' \
    | grep -v -E '"([^"]+)" -> "\1"' \
    | sed 's/"data-import-processing-core"/"data-import-\\nprocessing-core"/g' \
    | sed 's/"data-import-utils"/"data-import-\\nutils"/g' \
    | sed 's/"folio-custom-fields"/"folio-custom-\\nfields"/g' \
    | sed 's/"folio-di-support"/"folio-di-\\nsupport"/g' \
    | sed 's/"folio-holdingsiq"/"folio-\\nholdingsiq"/g' \
    | sed 's/"folio-kafka-wrapper"/"folio-kafka-\\nwrapper"/g' \
    | sed 's/"folio-liquibase-util"/"folio-liquibase-\\nutil"/g' \
    | sed 's/"folio-service-tools"/"folio-service-\\ntools"/g' \
    | sed 's/"mod-data-import-converter-storage"/"mod-data-import-\\nconverter-storage"/g' \
    | sed 's/"mod-source-record-storage"/"mod-source-\\nrecord-storage"/g' \
    | sed 's/"mod-source-record-manager"/"mod-source-\\nrecord-manager"/g' \
    | sort -u
}

# Filter reused libraries, we don't want modules that are not used by any other module
filter() {
  DEPENDENCIES=`cat`
  LIBRARIES=`echo "$DEPENDENCIES" | sed -E 's/.* -> ("[^"]+").*/\1 ->/' | sort -u`
  echo "$DEPENDENCIES" | grep -F -f <(echo "$LIBRARIES")
}

wrap() {
  echo "digraph {"
  echo "graph [ rankdir=TB ]"
  echo "node [ shape=rectagle ]"
  cat
  echo "}"
}

get-install
modules
pull
dependencytrees > dependencytrees
cat dependencytrees | convert | filter | wrap > complete.graphviz

Use Graphviz to generate the visualisation, for example https://dreampuf.github.io/GraphvizOnline

  • No labels

4 Comments

  1. When I think of dependency diagrams, I think the direction of the line means "a depends upon b". If the arrow points from a towards b then a depends upon b.

    I think the direction in this diagram is the opposite way around and so want to check my understanding.

    Some examples of my interpretation.

    • folio-di-support → mod-data-import-converter-storage means that mod-data-import-converter-storage depends upon folio-di-support
    • okapi -> RMB means that RMB depends upon okapi
    • mod-configuration → data-import-utils means that data-import-utils depends upon mod-configuration

    How wrong is my interpretation?

    1. This is correct for the former diagrams.

      Thanks you for mentioning that dependency trees usually have the arrows in the other direction. I've swapped this now and added an arrow explanation. I've also rotated the diagram into the usual orientation.

      1. Julian Ladisch 

        Thanks you for mentioning that dependency trees usually have the arrows in the other direction. I've swapped this now and added an arrow explanation. I've also rotated the diagram into the usual orientation.

        That's great. Thank you for being responsive to the feedback and for adding an explanation of what the arrows mean.

        1. And the orientation helps me interpret the diagram better, that's a really nice change