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

new storage #717

Merged
merged 1 commit into from
Jul 12, 2017
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
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ from codeCheckerDBAccess import codeCheckerDBAccess
from codeCheckerDBAccess.ttypes import *

# -- 7. libcodechecker and subpackages, etc.
from libcodechecker import client

from libcodechecker import host_check
from libcodechecker import util
from libcodechecker.analyze import analyzer
Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ thrift: build_dir
if [ -d "$(BUILD_DIR)/gen-js" ]; then rm -rf $(BUILD_DIR)/gen-js; fi

thrift -r -o $(BUILD_DIR) -I api/ \
--gen py api/report_storage_server.thrift

thrift -r -o $(BUILD_DIR) -I api/ \
--gen py --gen js:jquery api/report_viewer_server.thrift
--gen py --gen js:jquery api/report_server.thrift

thrift -r -o $(BUILD_DIR) -I api/ \
--gen py api/authentication.thrift
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,13 @@ Check your project using SQLite database. The database will be placed in your
workspace directory (`~/.codechecker` by default), which can be provided via
the `-w` flag.


CodeChecker check -n test-check -b "cd ~/your-project && make clean && make"


### Start a web server

Start a CodeChecker web and storage server in another terminal or as a background process. By default it will listen on `localhost:8001'.

CodeChecker server

Analyze your project with the check command.

CodeChecker check -n test-check -b "cd ~/your-project && make clean && make"

### View results

Expand Down
12 changes: 4 additions & 8 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
# Thrift APIs
These APIs should be used by the clients using the database to store or to get the results. Any new client should only interact with the database through these APIs.

## Report viewer server API
The report viewer server API should be used by any client to view the check results.
See [report_viewer_server.thrift](https://raw.githubusercontent.com/Ericsson/codechecker/master/thrift_api/report_viewer_server.thrift).

## Report storage server API
The report storage server API is used internally in the package during runtime to store the results to the database.
See [report_storage_server.thrift](https://raw.githubusercontent.com/Ericsson/codechecker/master/thrift_api/report_storage_server.thrift).
## Report server API
The report server API should be used by any client to view or store check results.
See [report_server.thrift](https://raw.githubusercontent.com/Ericsson/codechecker/master/api/report_server.thrift).

## Authentication system API
The authentication layer is used for supporting privileged-access only access.
See [authentication.thrift](https://raw.githubusercontent.com/Ericsson/codechecker/master/thrift_api/authentication.thrift)
See [authentication.thrift](https://raw.githubusercontent.com/Ericsson/codechecker/master/thrift_api/authentication.thrift)
96 changes: 95 additions & 1 deletion api/report_viewer_server.thrift → api/report_server.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ struct BuildActionData {
}
typedef list<BuildActionData> BuildActionDataList


struct NeedFileResult {
1: bool needed;
2: i64 fileId;
}

//-----------------------------------------------------------------------------
service codeCheckerDBAccess {

Expand Down Expand Up @@ -279,6 +285,94 @@ service codeCheckerDBAccess {
2: i64 new_run_id,
3: DiffType diff_type,
4: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError)
throws (1: shared.RequestFailed requestError),


//============================================
// Analysis result storage related API calls.
//============================================

// store checker run related data to the database
// by default updates the results if name was already found
// using the force flag removes existing analysis results for a run
i64 addCheckerRun(
1: string command,
2: string name,
3: string version,
4: bool force)
throws (1: shared.RequestFailed requestError),

bool replaceConfigInfo(
1: i64 run_id,
2: shared.CheckerConfigList values)
throws (1: shared.RequestFailed requestError),

bool addSuppressBug(
1: i64 run_id,
2: shared.SuppressBugList bugsToSuppress
)
throws (1: shared.RequestFailed requestError),

# remove all suppress information from the database
bool cleanSuppressData(
1: i64 run_id,
)
throws (1: shared.RequestFailed requestError),

# the map contains a path and a comment (can be empty)
bool addSkipPath(
1: i64 run_id,
2: map<string, string> paths)
throws (1: shared.RequestFailed requestError),


// The next few following functions must be called via the same connection.
// =============================================================
i64 addBuildAction(
1: i64 run_id,
2: string build_cmd_hash,
3: string check_cmd,
4: string analyzer_type,
5: string analyzed_source_file)
throws (1: shared.RequestFailed requestError),

i64 addReport(
1: i64 build_action_id,
2: i64 file_id,
3: string bug_hash,
4: string checker_message,
5: shared.BugPath bugpath,
6: shared.BugPathEvents events,
7: string checker_id,
8: string checker_cat,
9: string bug_type,
10: shared.Severity severity,
11: bool suppress)
throws (1: shared.RequestFailed requestError),

bool finishBuildAction(
1: i64 action_id,
2: string failure)
throws (1: shared.RequestFailed requestError),

NeedFileResult needFileContent(
1: i64 run_id,
2: string filepath)
throws (1: shared.RequestFailed requestError),

bool addFileContent(
1: i64 file_id,
2: string file_content)
throws (1: shared.RequestFailed requestError),

bool finishCheckerRun(1: i64 run_id)
throws (1: shared.RequestFailed requestError),

bool setRunDuration(1: i64 run_id,
2: i64 duration)
throws (1: shared.RequestFailed requestError),

bool stopServer()
throws (1: shared.RequestFailed requestError)

}
101 changes: 0 additions & 101 deletions api/report_storage_server.thrift

This file was deleted.

Loading