modules-graph-assert icon indicating copy to clipboard operation
modules-graph-assert copied to clipboard

Accept multiple modules and generate json report for `generateModulesGraphStatistics`

Open horowitz opened this issue 3 years ago • 1 comments

Hi @jraska

I was looking into the issues and there was a feature request created long ago which served +- as an inspiration for this PR.

I'm working on the same team that Marcello was and my team is trying to continuously track the statistics of each feature module we have in our code base. At the moment the plugin has some limitations which this PR tries to solve

  • Generate statistics to multiple modules
  • Generate a report so that later this can be used by further automation

I wasn't sure if this is something you would like to have in the plugin, however after reading the issue comments I thought it could be a good idea to just go ahead and continue the discussion in a PR. Please feel free to challenge the new features added and i would totally understand if this is not something you would like to add to the plugin

Some technical decisions:

  • I had to add a dependency to do JSON operations and i chose Kotlin Serialization.
  • For the report generation I chose to put it in the build folder, much like the Talaiot plugin also following their way to store the json file and generate the path
  • For the parameter I just added the option to send multiple options by using commas ,

horowitz avatar Mar 28 '22 09:03 horowitz

Hi Daniel, thanks for the PR.

I will have a look and answer properly this week once I get to it :)

jraska avatar Mar 29 '22 15:03 jraska

Hi Daniel,

I'm really sorry for taking so long to reply properly :( thanks once more for taking the time back then to propose the contribution.

The JSON generation is though something which I think goes out of scope of this plugin. Even adding the graph statistics were kind of a mistake which moved the plugin in slightly different direction than assertions, because then it added the "graph analysis" responsibility to this plugin where people logically want to add more functionality.

I think this should be a different plugin, which can actually add way more features than just JSON export - the betweenness centrality from Siggi could be another feature what to put into statistics - https://github.com/jraska/modules-graph-assert/pull/176 and potentially finding some defects on the graph like lists, dependency hubs, diamond dependencies etc. with more customizable drawing features like requested for example in https://github.com/jraska/modules-graph-assert/issues/78 or https://github.com/jraska/modules-graph-assert/issues/148.

Ideally this would be a separate module and plugin within this repository, but I didn't find time for this within last year so I see unlikely I will get to it anytime soon 🤷 this is why I keep being reluctant of extending functionality of this "graph analysis" domain to be able to maintain the project with very little time allocation.

With saying that I won't accept the contribution and I would suggest as an alternative using the bespoke solution within your project or possibly go through a path of a publishing a separate plugin focused mostly on the analysis of the project and module graph :)

Thanks for understanding. 🙇‍♂️

jraska avatar Aug 28 '22 09:08 jraska

Hi Daniel,

I'm really sorry for taking so long to reply properly :( thanks once more for taking the time back then to propose the contribution.

The JSON generation is though something which I think goes out of scope of this plugin. Even adding the graph statistics were kind of a mistake which moved the plugin in slightly different direction than assertions, because then it added the "graph analysis" responsibility to this plugin where people logically want to add more functionality.

I think this should be a different plugin, which can actually add way more features than just JSON export - the betweenness centrality from Siggi could be another feature what to put into statistics - #176 and potentially finding some defects on the graph like lists, dependency hubs, diamond dependencies etc. with more customizable drawing features like requested for example in #78 or #148.

Ideally this would be a separate module and plugin within this repository, but I didn't find time for this within last year so I see unlikely I will get to it anytime soon 🤷 this is why I keep being reluctant of extending functionality of this "graph analysis" domain to be able to maintain the project with very little time allocation.

With saying that I won't accept the contribution and I would suggest as an alternative using the bespoke solution within your project or possibly go through a path of a publishing a separate plugin focused mostly on the analysis of the project and module graph :)

Thanks for understanding. 🙇‍♂️

Hey @jraska No problem at all! As you might imagine I've already went with that approach. Actually on our use case this plugin was very helpful and we were able to significantly reduce the complexity of our graph. The json generation served us to continuously track our progress and get some monitoring over this metric.

I'll study the case of publishing this as a standalone plugin. Thanks for the reply! 🙌

horowitz avatar Aug 29 '22 10:08 horowitz

Actually on our use case this plugin was very helpful and we were able to significantly reduce the complexity of our graph. The json generation served us to continuously track our progress and get some monitoring over this metric.

Sounds awesome! :) Great to hear that!

jraska avatar Aug 30 '22 09:08 jraska