autonomousapps / dependency-analysis-gradle-plugin

Gradle plugin for JVM projects written in Java, Kotlin, Groovy, or Scala; and Android projects written in Java or Kotlin. Provides advice for managing dependencies and other applied plugins
Apache License 2.0
1.67k stars 115 forks source link

Generate output for `project`/`build` health in machine-readable format #1094

Open Nava2 opened 6 months ago

Nava2 commented 6 months ago

Describe the solution you'd like New output format for projectHealth and buildHealth.

In order to support features like Github Checks, we need the ability to see line-numbers and other metadata associated with files specifically.

In order to reduce the feature request, if we generated errorformat outputs, we could hook into tools like @reviewdog/reviewdog.

Describe alternatives you've considered

I wrote up a github action with a python script to parse the buildHealth.txt file for outputs: https://github.com/Nava2/dependency-analysis-reviewdog-action. This works OK, but it is brittle and prone to errors as the formats change.

Another, better example than errorformat is probably using sarif (Link)

autonomousapps commented 5 months ago

The filterAdvice task generates a report at reports/dependency-analysis/final-advice.json, and this report is machine-readable. Is this not sufficient? The plugin also supports users adding their own post-processing task which will automatically ingest that report and give you access to the full data model of the advice. See the wiki.

Nava2 commented 5 months ago

I think the JSON format is much better than what I currently have been using. However, it would still be nice to have sarif format or another widely used format built-in to avoid building them from scratch. 👍🏻

autonomousapps commented 5 months ago

Thanks for the issue. I do not have time to implement this request. I imagine there must be many competing "standards", and I can't implement them all. Maybe what you want is some kind of service loader framework and a plugin system to auto-convert the plugin's canonical output to something custom.