Riduidel / aadarchi

A maven archetype to generate easily projects allowing architecture description using a mix of C4, agile architecture, Asciidoc and PlantUML
https://riduidel.github.io/aadarchi/
Apache License 2.0
39 stars 12 forks source link

Change the way element discovery is logged #341

Closed Riduidel closed 1 year ago

Riduidel commented 1 year ago

When we discover new model elements with ComponentDetector we emit logs such as the following (directly pulled from GitHub Action execution), we get the following

[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 3 components of aadarchi-maven-plugin.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of adr-tickets-extractor. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 1 components of adr-tickets-extractor.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of markdown-to-asciidoc. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of markdown-to-asciidoc.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of sequence-diagram-generator. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of sequence-diagram-generator.
Warning:  (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) As there are no aadarchi.java.packages property defined on container Container://Aadarchi.spring-components-detector, we're not able to detect components in that container
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of github-scm-handler. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 3 components of github-scm-handler.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of gitlab-scm-handler. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of gitlab-scm-handler.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of cdi-in-maven-plugin-helper. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of cdi-in-maven-plugin-helper.
Warning:  (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) As there are no aadarchi.java.packages property defined on container Container://Aadarchi.archetype, we're not able to detect components in that container
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of maven-metadata-inferer. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 1 components of maven-metadata-inferer.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of aadarchi-test-utils. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of aadarchi-test-utils.
Warning:  (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) As there are no aadarchi.java.packages property defined on container Container://Aadarchi.maven, we're not able to detect components in that container
Warning:  (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) As there are no aadarchi.java.packages property defined on container Container://Aadarchi.asciidoc, we're not able to detect components in that container
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of cdi-config-extension. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of cdi-config-extension.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of sipoc-diagram-generator. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of sipoc-diagram-generator.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of base. It can be long ...
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "org.ndx.aadarchi.base.providers.FromDsl" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 10 components of base.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of architecture-documentation. It can be long ...
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "org.ndx.aadarchi.base.providers.FromDsl" could not be found.
Warning:  (com.structurizr.analysis.StructurizrAnnotationsComponentFinderStrategy) A component of type "javax.enterprise.inject.Instance" could not be found.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 18 components of architecture-documentation.
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detecting components of structurizr-components-detector. It can be long ...
[INFO] (org.ndx.aadarchi.structurizr.components.detector.ComponentDetector) Detected 0 components of structurizr-components-detector.

Can we

  1. Emit the log only at element exit
  2. Emit the log only when a new element has been detected
  3. Change the log message to have something like Detected %d new components in %s
Helielzel commented 1 year ago

I did not fully understand what you mean by "element", could you be more precise ? Do I have to remove the logs saying that an element "could not be found" ? (The warnings) and the logs saying that "could not be detected" ?

Riduidel commented 1 year ago

An element in Structurizr vocabulary is a SoftwareSystem, Container or Component.

I suggest you start by creating a test where you "emulate" component detection in order to see what logs are produced.

Helielzel commented 1 year ago

So I think I understood some things, like : in detectComponentsIn I have to remove the first log "Detecting components of %s. It can be long ...", and keep only the 2nd one Detected %d components of %s. and change it like you said in 3. earlier

Helielzel commented 1 year ago

delete "detecing" and add "%d modules found in %s"