-
Notifications
You must be signed in to change notification settings - Fork 379
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
Detection status #724
Detection status #724
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ struct RunData{ | |
6: string runCmd, // the used check command | ||
7: optional bool can_delete // true if codeCheckerDBAccess::removeRunResults() | ||
// is allowed on this run (see issue 151) | ||
8: map<shared.DetectionStatus, i32> detectionStatusCount | ||
// this maps the detection status to its count | ||
} | ||
typedef list<RunData> RunDataList | ||
|
||
|
@@ -43,16 +45,17 @@ struct ReviewData{ | |
|
||
//----------------------------------------------------------------------------- | ||
struct ReportData{ | ||
1: string checkerId, // the qualified id of the checker that reported this | ||
2: string bugHash, // This is unique id of the concrete report. | ||
3: string checkedFile, // this is a filepath | ||
4: string checkerMsg, // description of the bug report | ||
5: i64 reportId, // id of the report in the current run in the db | ||
6: i64 fileId, // unique id of the file the report refers to | ||
7: shared.BugPathEvent lastBugPosition // This contains the range and message of the last item in the symbolic | ||
// execution step list. | ||
8: shared.Severity severity // checker severity | ||
9: ReviewData review // bug review status informations. | ||
1: string checkerId, // the qualified id of the checker that reported this | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a name, not an id. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is how the API was laid out originally, just Git sometimes diffs bigger hunks than what was actually changed. If this is changed, perhaps a lot of places irrelevant to this PR would need be changed too (especially on the webgui, and such)! |
||
2: string bugHash, // This is unique id of the concrete report. | ||
3: string checkedFile, // this is a filepath | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is checkedFile? The TU for which we run the analyzer? Or the last/uniquing position of the bug? If the later, this name is misleading. Maybe we should fix it with this patch. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my comment about renaming above, the same applies here. This is the file that the bug was reported in, the file that you can search on the webgui. It is labelled as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. checkedFile is confusing indeed. Maybe sourceFileName would be a better name... |
||
4: string checkerMsg, // description of the bug report | ||
5: i64 reportId, // id of the report in the current run in the db | ||
6: i64 fileId, // unique id of the file the report refers to | ||
7: shared.BugPathEvent lastBugPosition // This contains the range and message of the last item in the symbolic | ||
// execution step list. | ||
8: shared.Severity severity // checker severity | ||
9: ReviewData review // bug review status informations. | ||
10: shared.DetectionStatus detectionStatus // state of the bug (see the enum constant values) | ||
} | ||
typedef list<ReportData> ReportDataList | ||
|
||
|
@@ -144,12 +147,6 @@ enum DiffType { | |
UNRESOLVED | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
struct NeedFileResult { | ||
1: bool needed; | ||
2: i64 fileId; | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
struct CommentData { | ||
1: i64 id, | ||
|
@@ -303,67 +300,35 @@ service codeCheckerDBAccess { | |
// 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), | ||
// The client can ask the server whether a file is already stored in the | ||
// database. If it is, then it is not necessary to send it in the ZIP file | ||
// with massStoreRun() function. This function requires a list of file hashes | ||
// (sha256) and returns the ones which are not stored yet. | ||
list<string> necessaryFileContents( | ||
1: list<string> file_hashes) | ||
throws (1: shared.RequestFailed requestError), | ||
|
||
// This function stores an entire run encapsulated and sent in a ZIP file. | ||
// The ZIP file has to be compressed and sent as a base64 encoded string. The | ||
// ZIP file must contain exactly one directory which has a "reports" and an | ||
// optional "root" sub-folder. The former one is the output of "CodeChecker | ||
// analyze" command and the latter one contains the source files on absolute | ||
// paths starting as if "root" was the "/" directory. The source files are | ||
// not necessary to be wrapped in the ZIP file (see necessaryFileContents() | ||
// function). | ||
// The "version" parameter is the used CodeChecker version which checked this | ||
// run. | ||
// The "force" parameter removes existing analysis results for a run. | ||
i64 massStoreRun( | ||
1: string run_name, | ||
2: string version, | ||
3: string zipfile, | ||
4: bool force) | ||
throws (1: shared.RequestFailed requestError), | ||
|
||
bool replaceConfigInfo( | ||
1: i64 run_id, | ||
2: shared.CheckerConfigList values) | ||
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 addReport( | ||
1: i64 run_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) | ||
throws (1: shared.RequestFailed requestError), | ||
|
||
|
||
// * If (filepath, content_hash) is in the DB return (existing fileId, false). | ||
// * If only the content_hash matches, a (new fileId, false) is returned. | ||
// * If the filepath matches, but content_hash not, a (new file_id, true) is returned. | ||
// * If none of them matches a (new file_id, true) is returned. | ||
NeedFileResult needFileContent( | ||
1: string filepath, | ||
2: string content_hash) | ||
throws (1: shared.RequestFailed requestError), | ||
|
||
bool addFileContent( | ||
1: string content_hash, | ||
2: string file_content, | ||
3: optional Encoding encoding) | ||
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) | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will be a separate count api with filtering if the schema is ready. I'm not sure we should return this value here. For now we can keep it.