getappmap / appmap-intellij-plugin

MIT License
38 stars 9 forks source link

extra path entries in `appmap.yml` #690

Closed apotterri closed 6 months ago

apotterri commented 6 months ago

Sometimes there are path entries added for non-application packages.

For example, the plugin generates this appmap.yml for waltz:

name: "waltz"
appmap_dir: "tmp/appmap"
packages:
- path: "app-group.add-aliases"
- path: "clients.c1.sc1"
- path: "licence.finos"
- path: "licence.spdx"
- path: "lineage"
- path: "liquibase"
- path: "measurable-ratings.edit-ratings"
- path: "org.finos.waltz.common"
- path: "org.finos.waltz.data"
- path: "org.finos.waltz.jobs"
- path: "org.finos.waltz.model"
- path: "org.finos.waltz.service"
- path: "org.finos.waltz.web"
- path: "report-grid.create-grid"
- path: "spark.template.freemarker"
- path: "static"
- path: "taxonomies"
- path: "user.registration"

It should really have no more than

- path: "org.finos.waltz.common"
- path: "org.finos.waltz.data"
- path: "org.finos.waltz.jobs"
- path: "org.finos.waltz.model"
- path: "org.finos.waltz.service"
- path: "org.finos.waltz.web"

and, ideally, even these would be collapsed to their common prefix, i.e. - path: "org.finos.waltz".

jansorg commented 6 months ago

Currently, the package list also includes packages contained in resource folders. Filtering to only allow packages located in source code folders should be possible.

I don't think we could collapse a.b.c.* itno a.b.c (e.g. org.finos.waltz.* into org.finos.waltz) because there may be projects which share a common package prefix with libraries.

apotterri commented 6 months ago

Ok, I'll look at filtering out resource folders.

Re collapsing packages: my example was wrong. We wouldn't want to collapse the path entries in this case. We'd only want to do it if they also contained the common prefix itself, e.g. org.finos, or org.finos.waltz, indicating that there are classes in that package.

jansorg commented 6 months ago

@apotterri Starting point to filter the packages would be appland.execution.AppMapJavaPackageConfig#findTopLevelPackages and probably appland.execution.AppMapJavaPackageConfig#collectSourceRootsWithDependencies. I haven't worked with the Java project model (source folders, resource folders, etc), but these methods seem most promising to me: ModuleRootManager.getInstance(module).getContentEntries()[...].getSource*().

kgilpin commented 6 months ago

What answer do you get if you ask Navie how to implement this?

On Fri, May 3, 2024 at 03:18 Joachim Ansorg @.***> wrote:

@apotterri https://github.com/apotterri Starting point to filter the packages would be appland.execution.AppMapJavaPackageConfig#findTopLevelPackages and probably appland.execution.AppMapJavaPackageConfig#collectSourceRootsWithDependencies . I haven't worked with the Java project model (source folders, resource folders, etc), but these methods seem most promising to me: ModuleRootManager.getInstance(module).getContentEntries()[...].getSource*() .

— Reply to this email directly, view it on GitHub https://github.com/getappmap/appmap-intellij-plugin/issues/690#issuecomment-2092446855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAVC64PKSFSNEYUEUXCR4LZAM26FAVCNFSM6AAAAABHCVPSHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJSGQ2DMOBVGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>