Skip to content

Merge distributed rule metadata files - #260

Open
furtib wants to merge 3 commits into
Ericsson:mainfrom
furtib:metadata_2
Open

Merge distributed rule metadata files#260
furtib wants to merge 3 commits into
Ericsson:mainfrom
furtib:metadata_2

Conversation

@furtib

@furtib furtib commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Why:
We don't need multiple metadata files, just one.

What:

  • Merge metadata files.

Addresses:
Fixes: #45

Depends on:
#79

@furtib
furtib requested a review from Szelethus July 5, 2026 12:09
@furtib furtib self-assigned this Jul 5, 2026
@furtib furtib added the enhancement New feature or request label Jul 5, 2026
furtib added 3 commits July 5, 2026 15:06
We absolutely do not need the individual metadata files in the data
folder, the merged one is enough

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note that the structure of metadata.json, specifically version 2, is specified here:
https://github.com/Ericsson/codechecker/blob/master/docs/report_directory.md#metadata-structure

It might be wise to drop this somewhere in the new metadata_merge.py file.

Comment thread src/metadata_merge.py
Comment on lines +38 to +39
# Fail if the plist file version is different
assert json1["version"] == json2["version"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll one up you: Fail if the version isn't 2.

@Szelethus Szelethus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to follow the official documents order of items.

Also, we could have a very nice unit test on this. And currently we have none :)

Comment thread src/metadata_merge.py
Comment on lines +40 to +41
json1_root = json1["tools"][0]
json2_root = json2["tools"][0]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*_root sounds like a poor name. How about *_first_tool or something like that?

Comment thread src/metadata_merge.py
# Merge time; we assume here both json files describe jobs in
# the same analysis invocation, implying that the analysis start
# time is the lowest timestamp, and the end is the highest.
# Note: caching will break this assumption

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a bigger deal than this Note implies.

Comment thread src/metadata_merge.py
assert json1_root["name"] == json2_root["name"]
# same CodeChecker version
assert json1_root["version"] == json2_root["version"]
# We assume that the list of enabled checkers haven't changed between runs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have several, differently configured codechecker_test targets, on which a main test target depends? Would each of those targets do their metadata merge individually?

Can we (should we) assert on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate metadata.json in file-by-file rule

2 participants