Skip to content

Include skiplist file in the analysis info#4798

Open
barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
barnabasdomozi:extend_analysis_info
Open

Include skiplist file in the analysis info#4798
barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
barnabasdomozi:extend_analysis_info

Conversation

@barnabasdomozi
Copy link
Copy Markdown
Collaborator

@barnabasdomozi barnabasdomozi commented Mar 5, 2026

This patch introduces a new table called AnalysisInfoFile,
which is intended to store files related to analysis information.
The actual file contents are stored separately in the FileContent
table.

During CodeChecker analyze, we create a new directory called
conf/ in the report directory.
The entire conf/ directory will be added to the massStoreRun
ZIP file.

With this PR, only the skipfile is copied to the conf directory,
but this could be extended later.

@barnabasdomozi barnabasdomozi added database 🗄️ Issues related to the database schema. server 🖥️ new feature 👍 New feature request labels Mar 6, 2026
@barnabasdomozi barnabasdomozi force-pushed the extend_analysis_info branch 3 times, most recently from 8586d7c to c1b9b9a Compare March 6, 2026 08:35
@barnabasdomozi barnabasdomozi marked this pull request as draft March 6, 2026 08:40
@barnabasdomozi barnabasdomozi added the WIP 💣 Work In Progress label Mar 6, 2026
@barnabasdomozi barnabasdomozi force-pushed the extend_analysis_info branch 5 times, most recently from 3661f49 to 39a5e15 Compare March 8, 2026 23:03
@barnabasdomozi barnabasdomozi marked this pull request as ready for review March 8, 2026 23:03
@barnabasdomozi barnabasdomozi removed the WIP 💣 Work In Progress label Mar 8, 2026
Copy link
Copy Markdown
Member

@dkrupp dkrupp left a comment

Choose a reason for hiding this comment

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

Please keep the original config file name.
Otherwise looks good.

hashlib.md5(report_dir_path.encode('utf-8')).hexdigest())

skip_file = os.path.join(zip_report_dir, 'skip_file')
if os.path.isfile(skip_file):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be great to preserve the original file name of the config files as the user sees the command with its oriignal file name.
Now the name skip_file is wired in. ... And I see that it is wired in at the analysis client.

I suggest creating a "conf" subdirectory in the report_directory where you collect all config files used by the CodeChecker analyze command with their original names.

Then the name could be preserved.

Image

@barnabasdomozi barnabasdomozi force-pushed the extend_analysis_info branch 3 times, most recently from fef4592 to ee296ef Compare March 13, 2026 22:46
@barnabasdomozi
Copy link
Copy Markdown
Collaborator Author

@dkrupp
Implemented in commit ee296ef.

The analysis info page now correctly uses the actual file name instead of the generic name "skip_file".

@barnabasdomozi barnabasdomozi requested a review from dkrupp March 16, 2026 08:43
.filter(AnalysisInfo.analyzer_command == cmd) \
.all()

if analysis_info_rows:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why has this "if" statement been removed? In the new version, a new analysis info is added. What happens if it already exists in the database?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously, the if check was used to determine whether a given analyzer command had already been inserted into the "AnalysisInfo" table, and if so, no new row was created.

However, with the introduction of the AnalysisInfoFile table, the design now includes a mapping between an AnalysisInfo ID and the corresponding FileContent rows that should be displayed on the analysis info page. If we keep the old if check, this leads to incorrect behavior.

Consider a scenario where 2 runs use the same analyzer command (for example, CodeChecker analyze -i ./skipfile ...), but the skipfile content differs between them.

When storing the first run, a new row is inserted into the AnalysisInfo table (e.g., ID 1), and the associated file content is linked through the AnalysisInfoFile table. For the second run, the if check detects that the analyzer command already exists and reuses AnalysisInfo ID 1 instead of creating a new row, while still inserting a new entry into AnalysisInfoFile linked to that same ID. As a result, both runs share the same AnalysisInfo entry, and we will display both skipfile contents for both run 1 and run 2.

To avoid this issue, a new AnalysisInfo entry must be created for every stored run, even if the analyzer command itself is identical.

This patch introduces a new table called AnalysisInfoFile,
which is intended to store files related to analysis information.
The actual file contents are stored separately in the FileContent
table.

During CodeChecker analyze, we create a new directory called
conf/ in the report directory.
The entire conf/ directory will be added to the massStoreRun
ZIP file.

With this PR, only the skipfile is copied to the conf directory,
but this could be extended later.
@barnabasdomozi
Copy link
Copy Markdown
Collaborator Author

@bruntib Updated alembic schema file.

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

Labels

database 🗄️ Issues related to the database schema. new feature 👍 New feature request server 🖥️

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants