Skip to content

Commit d182e0c

Browse files
committed
Fix search by severity problem when severities are different between MQR and Std
1 parent 33b421f commit d182e0c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sonar/issues.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
OLD_FP = "FALSE-POSITIVE"
5858
NEW_FP = "FALSE_POSITIVE"
5959

60+
_MQR_SEARCH_FIELDS = (_NEW_SEARCH_SEVERITY_FIELD, _NEW_SEARCH_STATUS_FIELD, _NEW_SEARCH_TYPE_FIELD)
61+
_STD_SEARCH_FIELDS = (_OLD_SEARCH_SEVERITY_FIELD, _OLD_SEARCH_STATUS_FIELD, _OLD_SEARCH_TYPE_FIELD)
62+
6063
_COMMA_CRITERIAS = (
6164
_OLD_SEARCH_COMPONENT_FIELD,
6265
_NEW_SEARCH_COMPONENT_FIELD,
@@ -1002,6 +1005,8 @@ def pre_search_filters(endpoint: pf.Platform, params: ApiParams) -> ApiParams:
10021005
if allowed is not None and filters[field] is not None:
10031006
filters[field] = list(set(util.intersection(filters[field], allowed)))
10041007

1008+
disallowed = _STD_SEARCH_FIELDS if endpoint.is_mqr_mode() else _MQR_SEARCH_FIELDS
1009+
filters = {k: v for k, v in filters.items() if k not in disallowed}
10051010
filters = {k: util.list_to_csv(v) for k, v in filters.items() if v}
10061011
log.debug("Sanitized issue search filters %s", str(filters))
10071012
return filters

0 commit comments

Comments
 (0)