Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge multiple projects files into one fat .cc.json #3743

Open
Richargh opened this issue Sep 16, 2024 · 3 comments
Open

Merge multiple projects files into one fat .cc.json #3743

Richargh opened this issue Sep 16, 2024 · 3 comments
Labels
difficulty:medium The difficulty to solve this is not super complex but not easy either pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO

Comments

@Richargh
Copy link

Richargh commented Sep 16, 2024

Feature request

Description

As an auditor, I want to merge multiple project files for separate services into one fat file with folders per project so that it's easier to load and share them.

Context

Let's say you have an audit where a team has divided their code up into 20 repositories. #3742 makes it already easier to merge these. But it is a bit tiresome to load them in codecharta and share the files. It would be much nicer if you could merge all 20 (or 50 or 100) of these files into one big file. Perhaps these files are organized like this:

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

Internally the files are structure like

# prj1.merge.cc.json
root
- src/
- pom.xml

and

# prj2.merge.cc.json
root
- src/
- pom.xml

If I were to blindly merge files on the same level then files like pom.xml would override each other and src/ would end up in a very strange state.

It would be much nicer if the output of this merge could be:

# all.merge.cc.json
root
- prj1
- - src/
- - pom.xml
- prj2
- - src/
- - pom.xml

Acceptance criteria

  • One new command-line argument exists to merge multiple files into one fat output file where each input file gets its own folder. For example:
    • ccsh merge merge1/ merge2/ --fat -o all.merge.cc.json

Assumptions & Exclusions

Development notes (optional Task Breakdown)

  • [ ]
  • [ ]
  • [ ]

Open questions

@ChristianHuehn ChristianHuehn added priority:high Set by PO difficulty:medium The difficulty to solve this is not super complex but not easy either pr-analysis Issues that touch the analysis pr(oject). labels Sep 20, 2024
@phanlezz
Copy link
Collaborator

What would be the behavior like if there are two prj1 files present (multiple files with the same prefix)?
Maybe this is a sub-mode for --mimo ? I think it would not be too much work to remove the single file checks and modify the file output of MIMO to implement this feature. @Richargh

@Richargh
Copy link
Author

@phanlezz you mean like the following?

├📁 merge
├─📄 prj1.git.cc.json
├─📄 prj1.sonar.cc.json                
├─📄 prj2.merge.cc.json
├─📄 ...
├─📄 prj20.merge.cc.json               

I'd say it would be nice if --fat complained and aborted then. Maybe the user forgot to merge the two prj1 files beforehand.

@Richargh
Copy link
Author

For now at least, I would keep --mimo and --fat seperate. They fulfil different purposes during a health check and I hope the code is clearer when we keep them separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:medium The difficulty to solve this is not super complex but not easy either pr-analysis Issues that touch the analysis pr(oject). priority:high Set by PO
Projects
None yet
Development

No branches or pull requests

3 participants