Include skiplist file in the analysis info#4798
Include skiplist file in the analysis info#4798barnabasdomozi wants to merge 1 commit intoEricsson:masterfrom
Conversation
a266ce7 to
95942c7
Compare
8586d7c to
c1b9b9a
Compare
3661f49 to
39a5e15
Compare
dkrupp
left a comment
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
fef4592 to
ee296ef
Compare
| .filter(AnalysisInfo.analyzer_command == cmd) \ | ||
| .all() | ||
|
|
||
| if analysis_info_rows: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
ee296ef to
8659f56
Compare
|
@bruntib Updated alembic schema file. |
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.