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

Use the new client count/filter api everywhere #918

Merged
merged 1 commit into from
Sep 14, 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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is suppression still a thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just updated the documentation based on the current command output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeChecker cmd results has a suppressed option

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it does. But does it need to have one, since the new API? Note that detection status and review status changes were introduced without a proper command-line touch-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've got your point, this should be rechecked later, as you mentioned.

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