Mastercard / flow

Testing framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve artifact dependency diagram

therealryan opened this issue · comments

The artifact dependency structure diagram for the example service is a bit messy - in order to get a reasonable layout we had to include the internal structure of the flow lib itself, which is extraneous in this context.

A bout of manual shenanigans with the connectivity data has resulted in this improved form:

graph LR
  subgraph core
    builder
    model
  end
  subgraph message
    message-http
    message-json
    message-sql
    message-text
    message-web
  end
  subgraph validation
    validation-junit5
    coppice
  end
  subgraph assert
    assert-junit5
  end

  subgraph example
    app-api
    app-assert
    app-core
    app-framework
    app-histogram
    app-itest
    app-model
    app-queue
    app-store
    app-ui
    app-web-ui
  end
  
  coppice -.-> app-model
  validation-junit5 -.-> app-model
  
  message-http --> app-model
  message-json --> app-model
  message-sql --> app-model
  message-text --> app-model
  message-web --> app-model
  
  builder --> app-model
  model --> app-model
  assert-junit5 --> app-assert

  app-core --> app-itest
  app-histogram --> app-itest
  app-queue --> app-itest
  app-store --> app-itest
  app-ui --> app-itest
  app-web-ui --> app-itest
  app-assert -.-> app-web-ui
  app-assert -.-> app-ui
  app-assert -.-> app-core
  app-assert -.-> app-histogram
  app-assert -.-> app-queue
  app-assert -.-> app-store
  app-model --> app-assert
  app-api --> app-web-ui
  app-api --> app-ui
  app-api --> app-core
  app-api --> app-histogram
  app-api --> app-queue
  app-api --> app-store
  app-api --> app-model
  app-framework --> app-api
  app-assert -.-> app-itest
  
  %% keeps subgraphs positioned correctly
  core ~~~ message
  message ~~~ validation
  validation ~~~ assert

Loading

It'd be good to refactor the diagram-generating test to produce this form. I strongly suspect it'll be unviable to get the test to generate it directly, but we should at least be able to get it to validate that the diagram is correct (i.e.: all dependencies and scopes are represented accurately in the markup). This would allow human edits for layout reasons while still providing confidence that the diagram will remain correct in the face of project structure updates.