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

[web] Add analyzer commands for reports #3320

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions web/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ build: clean target_dirs
rm -rf $(API_DIR)/gen-nodejs/
rm -rf $(API_DIR)/gen-py/

# When someone is developing CodeChecker and changes the API multiple times
# we need to remove the changes from package-lock.json file to install
# the api correctly by npm.
git checkout -- $(API_DIR)/../server/vue-cli/package-lock.json

publish: build publish_py publish_js

publish_py:
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/js/codechecker-api-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codechecker-api",
"version": "6.39.0",
"version": "6.40.0",
"description": "Generated node.js compatible API stubs for CodeChecker server.",
"main": "lib",
"homepage": "https://github.com/Ericsson/codechecker",
Expand Down
Binary file modified web/api/py/codechecker_api/dist/codechecker_api.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/py/codechecker_api/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()

api_version = '6.39.0'
api_version = '6.40.0'

setup(
name='codechecker_api',
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion web/api/py/codechecker_api_shared/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
with open('README.md', encoding='utf-8', errors="ignore") as f:
long_description = f.read()

api_version = '6.39.0'
api_version = '6.40.0'

setup(
name='codechecker_api_shared',
Expand Down
18 changes: 18 additions & 0 deletions web/api/report_server.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,16 @@ struct ExportData {
2: map<string, ReviewData> reviewData, // Map review data to report hashes.
}

union AnalysisInfoFilter {
1: i64 runId,
2: i64 runHistoryId,
3: i64 reportId,
}

struct AnalysisInfo {
1: string analyzerCommand,
}

service codeCheckerDBAccess {

// Gives back all analyzed runs.
Expand All @@ -384,10 +394,18 @@ service codeCheckerDBAccess {

// Get check command for a run.
// PERMISSION: PRODUCT_ACCESS
// !DEPRECATED Use getAnalysisInfo API to get the check commands.
string getCheckCommand(1: i64 runHistoryId,
2: i64 runId)
throws (1: codechecker_api_shared.RequestFailed requestError),

// Get analyzer commands based on the given filters.
// PERMISSION: PRODUCT_ACCESS
list<AnalysisInfo> getAnalysisInfo(1: AnalysisInfoFilter analysisInfoFilter,
2: i64 limit,
3: i64 offset)
throws (1: codechecker_api_shared.RequestFailed requestError),

// Get run history for runs.
// If an empty run id list is provided the history
// will be returned for all the available runs ordered by run history date.
Expand Down
9 changes: 0 additions & 9 deletions web/client/codechecker_client/cmd/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from codechecker_api_shared.ttypes import RequestFailed, ErrorCode

from codechecker_client import client as libclient
from codechecker_client.metadata import merge_metadata_json

from codechecker_common import arg, logger, plist_parser, util, cmd_config
from codechecker_common.report import Report
Expand Down Expand Up @@ -640,12 +639,10 @@ def assemble_zip(inputs, zip_file, client):
if file_hash:
file_hash_with_review_status.add(file_hash)

metadata_files_to_merge = []
for input_dir_path in inputs:
for root_dir_path, _, _ in os.walk(input_dir_path):
metadata_file_path = os.path.join(root_dir_path, 'metadata.json')
if os.path.exists(metadata_file_path):
metadata_files_to_merge.append(metadata_file_path)
files_to_compress.add(metadata_file_path)

skip_file_path = os.path.join(root_dir_path, 'skip_file')
Expand Down Expand Up @@ -679,12 +676,6 @@ def assemble_zip(inputs, zip_file, client):

zipf.write(ftc, zip_target)

merged_metadata = merge_metadata_json(
metadata_files_to_merge, len(inputs))

zipf.writestr(os.path.join('reports', 'metadata.json'),
json.dumps(merged_metadata))

for f, h in file_to_hash.items():
if h in necessary_hashes or h in file_hash_with_review_status:
LOG.debug("File contents for '%s' needed by the server", f)
Expand Down
2 changes: 1 addition & 1 deletion web/codechecker_web/shared/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# The newest supported minor version (value) for each supported major version
# (key) in this particular build.
SUPPORTED_VERSIONS = {
6: 39
6: 40
}

# Used by the client to automatically identify the latest major and minor
Expand Down
Loading