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

Fix exceptions_success_count relate only to exceptions items #145700

Merged
merged 4 commits into from
Nov 22, 2022

Conversation

nkhristinin
Copy link
Contributor

@nkhristinin nkhristinin commented Nov 18, 2022

Fix import rules success message

fix #136760

exceptions_success_count now don't count exceptions list, only exceptions list items

After discussion with the team, that is ok to return only exceptions list items as success_count for the rule import, because it reflects our UI. It does not really reflect the backend, because we also have the exceptions list container.

Screen.Recording.2022-11-18.at.10.32.39.mov

@nkhristinin nkhristinin requested review from a team as code owners November 18, 2022 09:37
@nkhristinin nkhristinin added release_note:skip Skip the PR/issue when compiling release notes Team:Security Solution Platform Security Solution Platform Team backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 18, 2022
@nkhristinin
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@maximpn maximpn left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -43,7 +43,7 @@ export const importRuleExceptions = async ({
const {
errors,
success,
success_count: successCount,
success_count_exception_list_items: successCount,
Copy link
Contributor

@maximpn maximpn Nov 21, 2022

Choose a reason for hiding this comment

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

It would be nice to have a comment why success_count_exception_list_items is used instead of success_count. Otherwise it may raise questions later on.

@nkhristinin nkhristinin requested a review from a team as a code owner November 21, 2022 13:40
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 442 448 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 67 73 +6
osquery 110 117 +7
securitySolution 519 525 +6
total +21

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@vitaliidm vitaliidm left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -43,7 +43,9 @@ export const importRuleExceptions = async ({
const {
errors,
success,
success_count: successCount,
// return only count of exception list items, without count excpetions list
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// return only count of exception list items, without count excpetions list
// return only count of exception list items, without count exceptions list

@nkhristinin nkhristinin merged commit 93e0cf5 into elastic:main Nov 22, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 22, 2022
…#145700)

## Fix import rules success message

fix elastic#136760

exceptions_success_count now don't count exceptions list, only
exceptions list items

After discussion with the team, that is ok to return only exceptions
list items as success_count for the rule import, because it reflects our
UI. It does not really reflect the backend, because we also have the
exceptions list container.

https://user-images.githubusercontent.com/7609147/202669384-5ddda1a7-e832-41a9-b899-5473a8188681.mov

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 93e0cf5)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 23, 2022
…145700) (#146012)

# Backport

This will backport the following commits from `main` to `8.6`:
- [Fix exceptions_success_count relate only to exceptions items
(#145700)](#145700)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Khristinin
Nikita","email":"nikita.khristinin@elastic.co"},"sourceCommit":{"committedDate":"2022-11-22T15:51:54Z","message":"Fix
exceptions_success_count relate only to exceptions items (#145700)\n\n##
Fix import rules success message\r\n\r\nfix
https://github.com/elastic/kibana/issues/136760\r\n\r\nexceptions_success_count
now don't count exceptions list, only\r\nexceptions list
items\r\n\r\nAfter discussion with the team, that is ok to return only
exceptions\r\nlist items as success_count for the rule import, because
it reflects our\r\nUI. It does not really reflect the backend, because
we also have the\r\nexceptions list
container.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7609147/202669384-5ddda1a7-e832-41a9-b899-5473a8188681.mov\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"93e0cf5a34bd5aef5a2be6cb8d43c8f9597e3b02","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Security
Solution
Platform","backport:prev-minor","v8.7.0"],"number":145700,"url":"https://github.com/elastic/kibana/pull/145700","mergeCommit":{"message":"Fix
exceptions_success_count relate only to exceptions items (#145700)\n\n##
Fix import rules success message\r\n\r\nfix
https://github.com/elastic/kibana/issues/136760\r\n\r\nexceptions_success_count
now don't count exceptions list, only\r\nexceptions list
items\r\n\r\nAfter discussion with the team, that is ok to return only
exceptions\r\nlist items as success_count for the rule import, because
it reflects our\r\nUI. It does not really reflect the backend, because
we also have the\r\nexceptions list
container.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7609147/202669384-5ddda1a7-e832-41a9-b899-5473a8188681.mov\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"93e0cf5a34bd5aef5a2be6cb8d43c8f9597e3b02"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145700","number":145700,"mergeCommit":{"message":"Fix
exceptions_success_count relate only to exceptions items (#145700)\n\n##
Fix import rules success message\r\n\r\nfix
https://github.com/elastic/kibana/issues/136760\r\n\r\nexceptions_success_count
now don't count exceptions list, only\r\nexceptions list
items\r\n\r\nAfter discussion with the team, that is ok to return only
exceptions\r\nlist items as success_count for the rule import, because
it reflects our\r\nUI. It does not really reflect the backend, because
we also have the\r\nexceptions list
container.\r\n\r\n\r\nhttps://user-images.githubusercontent.com/7609147/202669384-5ddda1a7-e832-41a9-b899-5473a8188681.mov\r\n\r\nCo-authored-by:
Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>","sha":"93e0cf5a34bd5aef5a2be6cb8d43c8f9597e3b02"}}]}]
BACKPORT-->

Co-authored-by: Khristinin Nikita <nikita.khristinin@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Security Solution Platform Security Solution Platform Team v8.6.0 v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] Wrong success message when importing a rule with an exception
5 participants