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

[RAM][O11Y] Integrate Conditional Actions with several Observability rule types #159522

Merged
merged 39 commits into from Jun 27, 2023

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Jun 12, 2023

Summary

Closes #159520

Screenshot 2023-06-12 at 3 12 27 PM

Checklist

Zacqary and others added 30 commits May 25, 2023 12:55
This reverts commit 1ac38bd.
@Zacqary Zacqary marked this pull request as ready for review June 15, 2023 18:55
@Zacqary Zacqary requested review from a team as code owners June 15, 2023 18:55
@Zacqary Zacqary requested a review from xcrzx June 15, 2023 18:55
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@Zacqary
Copy link
Contributor Author

Zacqary commented Jun 15, 2023

@elasticmachine merge upstream

@maximpn maximpn self-requested a review June 19, 2023 09:55
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.

@Zacqary the changes look good overall 👍 I've spotted a few potential problems and left comments regarding that but it doesn't look critical so I'm approving in advance.


const aadFields = useAsync(async () => {
if (!ruleTypeId) return [];
const fields = await http.get<DataViewField[]>(`${BASE_RAC_ALERTS_API_PATH}/aad_fields`, {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if an http request fails for some reason?

@@ -243,13 +244,13 @@ export const RuleActionsField: React.FC<Props> = ({
setActionFrequencyProperty: setActionFrequency,
setActionAlertsFilterProperty,
featureId: SecurityConnectorFeatureId,
producerId: AlertConsumers.SIEM,
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is a bit confused as a producer isn't the same as a consumer. Making this assignment without knowing what's going on under the hood leads to questions like "Why is it the same?". As I see it's just used to conditionally display alerts filter. I'm pretty sure it will confuse the code readers later on. A boolean flag showActionAlertsFilter was quite clear. Have you considered using an optional context or leaving a comment to make the intentions transparent?

@@ -37,6 +37,7 @@ export default function listRuleTypes({ getService }: FtrProviderContext) {
name: 'Recovered',
},
enabled_in_license: true,
has_fields_for_a_a_d: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Such a diff highlights a disadvantage such bulk tests. Instead of testing one specific feature it works with the whole data set so any contract changes require changes here. If the test fails it's hard to say what's a real cause. I'd recommend considering partial asserting via expect.objectContaining and etc.

Copy link
Contributor

@xcrzx xcrzx left a comment

Choose a reason for hiding this comment

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

Rules management area changes LGTM

@Zacqary Zacqary enabled auto-merge (squash) June 26, 2023 15:41
@Zacqary
Copy link
Contributor Author

Zacqary commented Jun 26, 2023

@elasticmachine merge upstream

@kibanamachine kibanamachine requested a review from a team as a code owner June 26, 2023 17:16
Copy link
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed left a comment

Choose a reason for hiding this comment

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

Infra changes LGTM!

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

AO changes LGTM

@Zacqary Zacqary merged commit faadf34 into elastic:main Jun 27, 2023
25 checks passed
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 565 566 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
triggersActionsUi 520 521 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 11.0MB 11.0MB +4.0B
triggersActionsUi 1.4MB 1.4MB +776.0B
total +780.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 86.6KB 86.7KB +41.0B
Unknown metric groups

API count

id before after diff
triggersActionsUi 546 547 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 14 16 +2
securitySolution 413 417 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 15 17 +2
securitySolution 492 496 +4
total +6

History

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 27, 2023
…rule types (elastic#159522)

## Summary

Closes elastic#159520

<img width="573" alt="Screenshot 2023-06-12 at 3 12 27 PM"
src="https://github.com/elastic/kibana/assets/1445834/ec16b8d7-25a5-435c-bf29-7392747b8c0f">

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
(cherry picked from commit faadf34)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.9

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 Jun 27, 2023
…ility rule types (#159522) (#160666)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[RAM][O11Y] Integrate Conditional Actions with several Observability
rule types (#159522)](#159522)

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

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

<!--BACKPORT [{"author":{"name":"Zacqary Adam
Xeper","email":"Zacqary@users.noreply.github.com"},"sourceCommit":{"committedDate":"2023-06-27T16:36:49Z","message":"[RAM][O11Y]
Integrate Conditional Actions with several Observability rule types
(#159522)\n\n## Summary\r\n\r\nCloses #159520 \r\n\r\n<img width=\"573\"
alt=\"Screenshot 2023-06-12 at 3 12 27
PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1445834/ec16b8d7-25a5-435c-bf29-7392747b8c0f\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Patryk Kopyciński
<contact@patrykkopycinski.com>","sha":"faadf347ae903eba7e9035e417be135f3e36df17","branchLabelMapping":{"^v8.10.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:ResponseOps","release_note:feature","Feature:Alerting/RulesManagement","v8.9.0","v8.10.0"],"number":159522,"url":"#159522
Integrate Conditional Actions with several Observability rule types
(#159522)\n\n## Summary\r\n\r\nCloses #159520 \r\n\r\n<img width=\"573\"
alt=\"Screenshot 2023-06-12 at 3 12 27
PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1445834/ec16b8d7-25a5-435c-bf29-7392747b8c0f\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Patryk Kopyciński
<contact@patrykkopycinski.com>","sha":"faadf347ae903eba7e9035e417be135f3e36df17"}},"sourceBranch":"main","suggestedTargetBranches":["8.9"],"targetPullRequestStates":[{"branch":"8.9","label":"v8.9.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.10.0","labelRegex":"^v8.10.0$","isSourceBranch":true,"state":"MERGED","url":"#159522
Integrate Conditional Actions with several Observability rule types
(#159522)\n\n## Summary\r\n\r\nCloses #159520 \r\n\r\n<img width=\"573\"
alt=\"Screenshot 2023-06-12 at 3 12 27
PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1445834/ec16b8d7-25a5-435c-bf29-7392747b8c0f\">\r\n\r\n\r\n###
Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Patryk Kopyciński
<contact@patrykkopycinski.com>","sha":"faadf347ae903eba7e9035e417be135f3e36df17"}}]}]
BACKPORT-->

Co-authored-by: Zacqary Adam Xeper <Zacqary@users.noreply.github.com>
rshen91 pushed a commit that referenced this pull request Jun 28, 2023
…rule types (#159522)

## Summary

Closes #159520 

<img width="573" alt="Screenshot 2023-06-12 at 3 12 27 PM"
src="https://github.com/elastic/kibana/assets/1445834/ec16b8d7-25a5-435c-bf29-7392747b8c0f">


### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Alerting/RulesManagement Issues related to the Rules Management UX release_note:feature Makes this part of the condensed release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.9.0 v8.10.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate new KQL bar for o11y inside of conditional actions