From 3ba213010ffbf597ef02d7d116a2c979d459ce09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Umann?= Date: Mon, 11 Mar 2024 11:04:26 +0100 Subject: [PATCH] Tidy up the patch --- .../codechecker_report_converter/report/hash.py | 1 + web/client/codechecker_client/cmd/store.py | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/report-converter/codechecker_report_converter/report/hash.py b/tools/report-converter/codechecker_report_converter/report/hash.py index e69ff13e8b..cf91f1dc4c 100644 --- a/tools/report-converter/codechecker_report_converter/report/hash.py +++ b/tools/report-converter/codechecker_report_converter/report/hash.py @@ -205,5 +205,6 @@ def get_report_path_hash(report: Report) -> str: if not report_path_hash: LOG.error('Failed to generate report path hash: %s', report) + # This might be a little too verbose even for the verbose output. # LOG.debug(report_path_hash) return __str_to_hash(report_path_hash) diff --git a/web/client/codechecker_client/cmd/store.py b/web/client/codechecker_client/cmd/store.py index ecc4d91399..d4502df093 100644 --- a/web/client/codechecker_client/cmd/store.py +++ b/web/client/codechecker_client/cmd/store.py @@ -51,7 +51,6 @@ from codechecker_web.shared import webserver_context, host_check from codechecker_web.shared.env import get_default_workspace -# from codechecker_server import MetadataInfoParser try: from codechecker_client.blame_info import assemble_blame_info except ImportError: @@ -425,6 +424,10 @@ def assemble_zip(inputs, """Collect and compress report and source files, together with files contanining analysis related information into a zip file which will be sent to the server. + + For each report directory, we create a uniqued zipped directory. Each + report directory to store could have been made with different + configurations, so we can't merge them all into a single zip. """ files_to_compress: Dict[str, set] = defaultdict(set) analyzer_result_file_paths = [] @@ -473,7 +476,9 @@ def assemble_zip(inputs, if report.changed_files: changed_files.update(report.changed_files) continue - # Need to calculate unique reoirt count to determine report limit + # Unique all bug reports per report directory; also, count how many + # reports we want to store at once to check for the report store + # limit. report_path_hash = get_report_path_hash(report) if report_path_hash not in unique_report_hashes: unique_report_hashes.add(report_path_hash) @@ -485,7 +490,6 @@ def assemble_zip(inputs, file_paths.update(report.original_files) file_report_positions[report.file.original_path].add(report.line) - # TODO: Doesn't support storing multiple report dirs. if unique_reports: for dirname, analyzer_reports in unique_reports.items(): for analyzer_name, reports in analyzer_reports.items():