Skip to content

Commit

Permalink
Use the new client count/filter api everywhere
Browse files Browse the repository at this point in the history
* use the new filtering api in the command line
* remove the old api calls
* remove the temporary v2 naming
  • Loading branch information
Gyorgy Orban committed Sep 14, 2017
1 parent e4fbb31 commit b25936f
Show file tree
Hide file tree
Showing 19 changed files with 322 additions and 1,513 deletions.
126 changes: 15 additions & 111 deletions api/v6/report_server.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -70,33 +70,11 @@ struct ReportData {
}
typedef list<ReportData> ReportDataList

/**
* TODO: DEPRECATED
* Members of this struct are interpreted in "AND" relation with each other.
* So they need to match a single report at the same time.
*/
struct ReportFilter {
1: optional string filepath, // In the filters a single wildcard can be be used: *
2: optional string checkerMsg,
3: optional shared.Severity severity,
4: optional string checkerId, // should filter in the fully qualified checker id name such as alpha.core.
// the analyzed system. Projects can optionally use this concept.
5: optional string bugHash,
6: optional shared.ReviewStatus status
}

/**
* TODO: DEPRECATED
* If there is a list of ReportFilter, there is an OR relation between the list members.
*/
typedef list<ReportFilter> ReportFilterList


/**
* Members of this struct are interpreted in "OR" relation with each other.
* Between the members there is "AND" relation.
*/
struct ReportFilter_v2 {
struct ReportFilter {
1: list<string> filepath,
2: list<string> checkerMsg,
3: list<string> checkerName,
Expand Down Expand Up @@ -201,53 +179,35 @@ service codeCheckerDBAccess {
1: i64 reportId)
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED v2 filter should be used with the new api
// get the results for some runIds
// PERMISSION: PRODUCT_ACCESS
ReportDataList getRunResults(
1: list<i64> runIds,
2: i64 limit,
3: i64 offset,
4: list<SortMode> sortType,
5: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError),

// Get the results for some runIds
// can be used in diff mode if cmpData is set.
// PERMISSION: PRODUCT_ACCESS
ReportDataList getRunResults_v2(
ReportDataList getRunResults(
1: list<i64> runIds,
2: i64 limit,
3: i64 offset,
4: list<SortMode> sortType,
5: ReportFilter_v2 reportFilter,
5: ReportFilter reportFilter,
6: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED v2 filter should be used with the new api
// count all the results some runIds
// PERMISSION: PRODUCT_ACCESS
i64 getRunResultCount(
1: list<i64> runIds,
2: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError),

// Count the results separately for multiple runs.
// If an empty run id list is provided the report
// counts will be calculated for all of the available runs.
// PERMISSION: PRODUCT_ACCESS
RunReportCounts getRunReportCounts(
1: list<i64> runIds,
2: ReportFilter_v2 reportFilter)
2: ReportFilter reportFilter)
throws (1: shared.RequestFailed requestError),

// Count all the results some runIds can be used for diff counting.
// PERMISSION: PRODUCT_ACCESS
i64 getRunResultCount_v2(
1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),
i64 getRunResultCount(
1: list<i64> runIds,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

// gives back the all marked region and message for a report
// PERMISSION: PRODUCT_ACCESS
Expand Down Expand Up @@ -302,37 +262,6 @@ service codeCheckerDBAccess {
string getCheckerDoc(1: string checkerId)
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED getRunResults_v2 should be used
// compare the results of two runs
// PERMISSION: PRODUCT_ACCESS
ReportDataList getNewResults(1: i64 base_run_id,
2: i64 new_run_id,
3: i64 limit,
4: i64 offset,
5: list<SortMode> sortType,
6: ReportFilterList reportFilters )
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED getRunResults_v2 should be used
// PERMISSION: PRODUCT_ACCESS
ReportDataList getResolvedResults(1: i64 base_run_id,
2: i64 new_run_id,
3: i64 limit,
4: i64 offset,
5: list<SortMode> sortType,
6: ReportFilterList reportFilters )
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED getRunResults_v2 should be used
// PERMISSION: PRODUCT_ACCESS
ReportDataList getUnresolvedResults(1: i64 base_run_id,
2: i64 new_run_id,
3: i64 limit,
4: i64 offset,
5: list<SortMode> sortType,
6: ReportFilterList reportFilters )
throws (1: shared.RequestFailed requestError),

// get the checker configuration values
// PERMISSION: PRODUCT_ACCESS or PRODUCT_STORE
shared.CheckerConfigList getCheckerConfigs(1: i64 runId)
Expand All @@ -343,14 +272,6 @@ service codeCheckerDBAccess {
SkipPathDataList getSkipPaths(1: i64 runId)
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED should be removed
// get all the results for one runId
// count all results for a checker
// PERMISSION: PRODUCT_ACCESS
ReportDataTypeCountList getRunResultTypes(1: i64 runId,
2: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError),

// returns the CodeChecker version that is running on the server
string getPackageVersion();

Expand All @@ -365,30 +286,13 @@ service codeCheckerDBAccess {
string getSuppressFile()
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED getRunResultCount should be used.
// count the diff results
// PERMISSION: PRODUCT_ACCESS
i64 getDiffResultCount(1: i64 base_run_id,
2: i64 new_run_id,
3: DiffType diff_type,
4: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError),

// TODO: DEPRECATED the new counter api should be used!
// count all the diff results for each checker
// PERMISSION: PRODUCT_ACCESS
ReportDataTypeCountList getDiffResultTypes(1: i64 base_run_id,
2: i64 new_run_id,
3: DiffType diff_type,
4: ReportFilterList reportFilters)
throws (1: shared.RequestFailed requestError),

// If the run id list is empty the metrics will be counted
// for all of the runs and in compare mode all of the runs
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
map<shared.Severity, i64> getSeverityCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand All @@ -397,7 +301,7 @@ service codeCheckerDBAccess {
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
map<string, i64> getCheckerMsgCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand All @@ -406,7 +310,7 @@ service codeCheckerDBAccess {
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
map<shared.ReviewStatus, i64> getReviewStatusCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand All @@ -415,7 +319,7 @@ service codeCheckerDBAccess {
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
map<shared.DetectionStatus, i64> getDetectionStatusCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand All @@ -424,7 +328,7 @@ service codeCheckerDBAccess {
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
map<string, i64> getFileCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand All @@ -433,7 +337,7 @@ service codeCheckerDBAccess {
// will be used as a baseline excluding the runs in compare data.
// PERMISSION: PRODUCT_ACCESS
CheckerCounts getCheckerCounts(1: list<i64> runIds,
2: ReportFilter_v2 reportFilter,
2: ReportFilter reportFilter,
3: CompareData cmpData)
throws (1: shared.RequestFailed requestError),

Expand Down
25 changes: 17 additions & 8 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1105,11 +1105,14 @@ positional arguments:
optional arguments:
-h, --help show this help message and exit
-s, --suppressed Filter results to only show suppressed entries.
(default: False)
-s, --suppressed Show only suppressed results instead of only
unsuppressed ones. (default: False)
--filter FILTER Filter results. The filter string has the following
format: <severity>:<checker_name>:<file_path>
(default: ::)
format:
[<SEVERITIES>]:[<CHECKER_NAMES>]:[<FILE_PATHS>] where
severites, checker_names, file_paths should be a comma
separated list, e.g.:
"high,medium:unix,core:*.cpp,*.h" (default: ::)
~~~~~~~~~~~~~~~~~~~~~

### Show differences between two runs (`diff`)
Expand Down Expand Up @@ -1141,8 +1144,11 @@ optional arguments:
-s, --suppressed Filter results to only show suppressed entries.
(default: False)
--filter FILTER Filter results. The filter string has the following
format: <severity>:<checker_name>:<file_path>
(default: ::)
format:
[<SEVERITIES>]:[<CHECKER_NAMES>]:[<FILE_PATHS>] where
severites, checker_names, file_paths should be a comma
separated list, e.g.:
"high,medium:unix,core:*.cpp,*.h" (default: ::)
comparison modes:
--new Show results that didn't exist in the 'base' but
Expand Down Expand Up @@ -1189,8 +1195,11 @@ optional arguments:
-s, --suppressed Filter results to only show suppressed entries.
(default: False)
--filter FILTER Filter results. The filter string has the following
format: <severity>:<checker_name>:<file_path>
(default: ::)
format:
[<SEVERITIES>]:[<CHECKER_NAMES>]:[<FILE_PATHS>] where
severites, checker_names, file_paths should be a comma
separated list, e.g.:
"high,medium:unix,core:*.cpp,*.h" (default: ::)
~~~~~~~~~~~~~~~~~~~~~

### Remove analysis runs (`del`)
Expand Down
Loading

0 comments on commit b25936f

Please sign in to comment.