MaibornWolff / codecharta

CodeCharta visualizes multiple code metrics using 3D tree maps.
https://maibornwolff.github.io/codecharta/
BSD 3-Clause "New" or "Revised" License
191 stars 30 forks source link

Merge multiple project files into multiple project outputs (MIMO) #3742

Open Richargh opened 1 month ago

Richargh commented 1 month ago

Feature request

Improve merge so it is better at handling typical microservice merge cases where we merge multiple files for multiple repos.

Description

As an auditor, I want to merge multiple repositories automatically so that merging multiple microservice cc.jsons is much easier.

Context

Let's say you have an audit where a team has divided their code up into 20 repositories. Then you'll have 20 .sonar.cc.json and 20 .git.cc.json files which you have to merge. Perhaps these files are organized like this:

├📁 sonar  
├─📄 prj1.sonar.cc.json                
├─📄 ...
├─📄 prj20.sonar.cc.json               
├📁 git
├─📄 prj1.git.cc.json
├─📄 ...
├─📄 prj20.git.cc.json
├📁 raw # perhaps you have another folder with raw metrics
├📁 merge # empty right now, but this could be the folder where the merge result would be

Or perhaps these files are organized like this:

├📁 projects  
├─📄 prj1.sonar.cc.json                
├─📄 prj1.git.cc.json
├─📄 ...
├─📄 prj20.sonar.cc.json               
├─📄 prj20.git.cc.json
├📁 merge # empty right now, but this could be the folder where the merge result would be

Note that in both cases the project names match exactly, it just the git/sonar/raw that is different.

I would be great if you could merge these projects via command-line so the result looks like:

├📁 merge
├─📄 prj1.merge.cc.json                
├─📄 ...
├─📄 prj20.merge.cc.json               

Acceptance criteria

Development notes (optional Task Breakdown)

Open questions

ViktoriaGordeevaVG commented 1 week ago

@Richargh @ChristianHuehn Do I understand correctly that instead of using MATCH_BY_DOT_PREFIX, one of the existing strategies (recursive/leaf) should be chosen? I believe that by entering the -mimo command, it's already clear that the merge will check the project names based on the "dot prefix."

Should this merge also take into account the top-level nodes? As mentioned here #3745 .

ChristianHuehn commented 6 days ago

Do I understand correctly that instead of using MATCH_BY_DOT_PREFIX, one of the existing strategies (recursive/leaf) should be chosen? I believe that by entering the -mimo command, it's already clear that the merge will check the project names based on the "dot prefix."

@Richargh wanted to have the parameter just for future changes. We don't need it right now. -mimo already specifies the strategy for now.

Should this merge also take into account the top-level nodes? As mentioned here https://github.com/MaibornWolff/codecharta/issues/3745 .

Yes, per folder, Example:

It should use 3745 for merging everything in A and everything in B.