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] [Rule Form V2] Add full-page create/edit form behind feature flag to Stack Management #180539

Closed
wants to merge 73 commits into from

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Apr 10, 2024

Summary

Closes #179105

Rule Form V2 is now accessible from Stack Management by adding this to kibana.yml:

xpack.trigger_actions_ui.enableExperimental: ['ruleFormV2']

Actions cannot yet be configured. These will be added in #179106 and #179107

Screenshot 2024-04-10 at 3 29 36 PM

Create and Edit

This full page form works both for creating new rules and editing existing ones. It can be accessed using the existing UI, or using the new routes rule/create/:ruleTypeId and rule/edit/:ruleId.

Expression validation

Error messages from the expression component affect the overall form validation.
Screenshot 2024-04-10 at 3 31 51 PM
Screenshot 2024-04-10 at 3 31 42 PM

Known broken rule types

V2 contains breaking changes for the following rule type expression components:

  • Log threshold
  • Inventory threshold
  • Uptime monitor status
  • Synthetics TLS certificate

These should be fairly simple errors to fix, and we can include them in a further PR where we add this rule form to Observability.

Checklist

Delete any items that are not applicable to this PR.

@Zacqary Zacqary added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesManagement Issues related to the Rules Management UX v8.14.0 labels Apr 10, 2024
@Zacqary Zacqary requested a review from a team as a code owner April 10, 2024 20:49
@elasticmachine
Copy link
Contributor

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

@Zacqary
Copy link
Contributor Author

Zacqary commented Apr 17, 2024

I noticed we have this new show api request button, do we want to port this over too?

Ported over in latest commit

@Zacqary Zacqary requested a review from JiaweiWu April 17, 2024 20:30
@Zacqary
Copy link
Contributor Author

Zacqary commented Apr 18, 2024

@elasticmachine merge upstream

@Zacqary
Copy link
Contributor Author

Zacqary commented Apr 23, 2024

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 175 231 +56
observability 510 566 +56
securitySolution 5452 5508 +56
stackAlerts 145 242 +97
triggersActionsUi 733 792 +59
total +324

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
@kbn/alerts-ui-shared 98 122 +24

Async chunks

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

id before after diff
alerting 91.5KB 95.7KB +4.1KB
observability 287.3KB 291.5KB +4.2KB
securitySolution 14.6MB 14.7MB +4.3KB
stackAlerts 82.5KB 72.2KB -10.3KB
triggersActionsUi 1.6MB 1.6MB +3.0KB
total +5.2KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/alerts-ui-shared 2 3 +1

Page load bundle

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

id before after diff
alerting 23.6KB 23.8KB +112.0B
observability 150.7KB 150.9KB +269.0B
stackAlerts 24.7KB 40.0KB +15.3KB
triggersActionsUi 120.7KB 153.1KB +32.4KB
total +48.1KB
Unknown metric groups

API count

id before after diff
@kbn/alerts-ui-shared 110 134 +24

ESLint disabled line counts

id before after diff
@kbn/alerts-ui-shared 6 9 +3

References to deprecated APIs

id before after diff
infra 4 28 +24
ml 27 28 +1
observability 0 13 +13
stackAlerts 17 30 +13
stackConnectors 0 5 +5
total +56

Total ESLint disabled count

id before after diff
@kbn/alerts-ui-shared 6 9 +3

History

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

JiaweiWu added a commit that referenced this pull request May 31, 2024
## Summary
Issue: #179105
Related PR: #180539

Part 1 of 3 PRs of new rule form. This PR extracts the first section of
the rule form, the rule definition, from the original PR. The purpose is
to fix a few bugs (Such as improving the alert delay and the rule
schedule input validation), and also try to make the PR much smaller for
review. The design philosophy in the PR is to create components that are
devoid of any fetching or form logic. These are simply dumb components.

I have also created a example plugin to demonstrate this PR. To access: 

1. Run the branch with `yarn start --run-examples`
2. Navigate to
`http://localhost:5601/app/triggersActionsUiExample/rule_definition`

And you should be able to play around with the components in this PR:

<img width="1257" alt="Screenshot 2024-05-13 at 10 10 51 AM"
src="https://github.com/elastic/kibana/assets/74562234/a1ab6d96-946d-4bf6-94e2-6aa903d0b8f5">

### Checklist
- [x] [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: Zacqary <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
JiaweiWu added a commit that referenced this pull request Jun 5, 2024
## Summary
Issue: #179105
Related PR: #180539

Part 1: #183325

Part 2 of 3 PRs of new rule form. This PR depends on the code from part
1, so only merge this when part 1 has been merged. This PR extracts the
last section of the rule form, the rule details, from the original PR.
The design philosophy in the PR is to create components that are devoid
of any fetching or form logic. These are simply dumb components.

I have also created a example plugin to demonstrate this PR. To access:

1. Run the branch with yarn start --run-examples
2. Navigate to
http://localhost:5601/app/triggersActionsUiExample/rule_details

And you should be able to play around with the components in this PR:

<img width="1281" alt="Screenshot 2024-05-13 at 9 44 14 PM"
src="https://github.com/elastic/kibana/assets/74562234/7ca900e3-ca9a-4810-8b24-7c3ea41055d6">

### Checklist
- [x] [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: Zacqary <[email protected]>
Co-authored-by: kibanamachine <[email protected]>
JiaweiWu added a commit that referenced this pull request Jun 12, 2024
…UI to shared package (#184977)

## Summary

Issue: #179105
Related PR: #180539

Part 2.5/3 PRs of the new rule form. This PR acts as the foundation PR
for the main rule form PR by moving a lot of the dependencies needed by
the rules form to a shared package. So no new features added, just
moving stuff around.

### Checklist

- [x] [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: kibanamachine <[email protected]>
JiaweiWu added a commit that referenced this pull request Jul 4, 2024
…anagement (#184892)

## Summary
Issue: #179105
Related PR: #180539

Part 3/3 PRs of the new rule form. This PR adds the create and edit rule
page as well as the state management using react reducers.

I have also created a example plugin to demonstrate this PR. To access:

1. Run the branch with yarn start --run-examples
2. Navigate to
`http://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>`
(I use `.es-query`)
3. Create a rule
4. Navigate to
`http://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>`
with the rule you just created to edit the rule

<img width="1196" alt="Screenshot 2024-05-14 at 8 27 00 PM"
src="https://github.com/elastic/kibana/assets/74562234/576fecdd-bd7b-4cad-a3db-aab3163abc46">


### Checklist
- [x] [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: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
@Zacqary
Copy link
Contributor Author

Zacqary commented Sep 9, 2024

Rule form V2 work has moved to a series of other PRs, closing this one

@Zacqary Zacqary closed this Sep 9, 2024
JiaweiWu added a commit that referenced this pull request Sep 27, 2024
…Form (#187434)

## Summary
Issue: #179105
Related PR: #180539

Final PR of the rule actions V2 PR (2/2 of the actions PRs). This PR
contains the actions modal and actions form. This PR depends on
#186490.

I have also created a example plugin to demonstrate this PR. To access:

1. Run the branch with yarn start --run-examples
2. Navigate to
http://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>
(I use .es-query)
3. Create a rule
4. Navigate to
http://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>
with the rule you just created to edit the rule

<img width="1236" alt="Screenshot 2024-07-02 at 5 15 51 PM"
src="https://github.com/elastic/kibana/assets/74562234/1dc5d2a9-804a-4861-94ba-814de73dc3ab">

![Screenshot 2024-07-08 at 10 53
44 PM](https://github.com/elastic/kibana/assets/74562234/07efade1-4b9c-485f-9833-84698dc29219)

<img width="1087" alt="Screenshot 2024-07-02 at 5 15 58 PM"
src="https://github.com/elastic/kibana/assets/74562234/903e66b5-f9a1-4d09-b121-b1dcecdff72c">


### Checklist
- [x] [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: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 27, 2024
…Form (elastic#187434)

## Summary
Issue: elastic#179105
Related PR: elastic#180539

Final PR of the rule actions V2 PR (2/2 of the actions PRs). This PR
contains the actions modal and actions form. This PR depends on
elastic#186490.

I have also created a example plugin to demonstrate this PR. To access:

1. Run the branch with yarn start --run-examples
2. Navigate to
http://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>
(I use .es-query)
3. Create a rule
4. Navigate to
http://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>
with the rule you just created to edit the rule

<img width="1236" alt="Screenshot 2024-07-02 at 5 15 51 PM"
src="https://github.com/elastic/kibana/assets/74562234/1dc5d2a9-804a-4861-94ba-814de73dc3ab">

![Screenshot 2024-07-08 at 10 53
44 PM](https://github.com/elastic/kibana/assets/74562234/07efade1-4b9c-485f-9833-84698dc29219)

<img width="1087" alt="Screenshot 2024-07-02 at 5 15 58 PM"
src="https://github.com/elastic/kibana/assets/74562234/903e66b5-f9a1-4d09-b121-b1dcecdff72c">

### Checklist
- [x] [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: kibanamachine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit 54659e8)
kibanamachine referenced this pull request Sep 27, 2024
…tions Form (#187434) (#194254)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Response Ops][Rule Form V2] Rule form v2: Actions Modal and Actions
Form (#187434)](#187434)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Jiawei
Wu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-27T06:34:27Z","message":"[Response
Ops][Rule Form V2] Rule form v2: Actions Modal and Actions Form
(#187434)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/179105\r\nRelated PR:
https://github.com/elastic/kibana/pull/180539\r\n\r\nFinal PR of the
rule actions V2 PR (2/2 of the actions PRs). This PR\r\ncontains the
actions modal and actions form. This PR depends
on\r\nhttps://github.com//pull/186490.\r\n\r\nI have also
created a example plugin to demonstrate this PR. To access:\r\n\r\n1.
Run the branch with yarn start --run-examples\r\n2. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>\r\n(I
use .es-query)\r\n3. Create a rule\r\n4. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>\r\nwith
the rule you just created to edit the rule\r\n\r\n<img width=\"1236\"
alt=\"Screenshot 2024-07-02 at 5 15
51 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/1dc5d2a9-804a-4861-94ba-814de73dc3ab\">\r\n\r\n![Screenshot
2024-07-08 at 10
53\r\n44 PM](https://github.com/elastic/kibana/assets/74562234/07efade1-4b9c-485f-9833-84698dc29219)\r\n\r\n<img
width=\"1087\" alt=\"Screenshot 2024-07-02 at 5 15
58 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/903e66b5-f9a1-4d09-b121-b1dcecdff72c\">\r\n\r\n\r\n###
Checklist\r\n- [x] [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: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"54659e8ae002aa68be3ee472ef12b3d3f546a1ea","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0"],"title":"[Response
Ops][Rule Form V2] Rule form v2: Actions Modal and Actions
Form","number":187434,"url":"https://github.com/elastic/kibana/pull/187434","mergeCommit":{"message":"[Response
Ops][Rule Form V2] Rule form v2: Actions Modal and Actions Form
(#187434)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/179105\r\nRelated PR:
https://github.com/elastic/kibana/pull/180539\r\n\r\nFinal PR of the
rule actions V2 PR (2/2 of the actions PRs). This PR\r\ncontains the
actions modal and actions form. This PR depends
on\r\nhttps://github.com//pull/186490.\r\n\r\nI have also
created a example plugin to demonstrate this PR. To access:\r\n\r\n1.
Run the branch with yarn start --run-examples\r\n2. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>\r\n(I
use .es-query)\r\n3. Create a rule\r\n4. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>\r\nwith
the rule you just created to edit the rule\r\n\r\n<img width=\"1236\"
alt=\"Screenshot 2024-07-02 at 5 15
51 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/1dc5d2a9-804a-4861-94ba-814de73dc3ab\">\r\n\r\n![Screenshot
2024-07-08 at 10
53\r\n44 PM](https://github.com/elastic/kibana/assets/74562234/07efade1-4b9c-485f-9833-84698dc29219)\r\n\r\n<img
width=\"1087\" alt=\"Screenshot 2024-07-02 at 5 15
58 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/903e66b5-f9a1-4d09-b121-b1dcecdff72c\">\r\n\r\n\r\n###
Checklist\r\n- [x] [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: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"54659e8ae002aa68be3ee472ef12b3d3f546a1ea"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187434","number":187434,"mergeCommit":{"message":"[Response
Ops][Rule Form V2] Rule form v2: Actions Modal and Actions Form
(#187434)\n\n## Summary\r\nIssue:
https://github.com/elastic/kibana/issues/179105\r\nRelated PR:
https://github.com/elastic/kibana/pull/180539\r\n\r\nFinal PR of the
rule actions V2 PR (2/2 of the actions PRs). This PR\r\ncontains the
actions modal and actions form. This PR depends
on\r\nhttps://github.com//pull/186490.\r\n\r\nI have also
created a example plugin to demonstrate this PR. To access:\r\n\r\n1.
Run the branch with yarn start --run-examples\r\n2. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/create/<ruleTypeId>\r\n(I
use .es-query)\r\n3. Create a rule\r\n4. Navigate
to\r\nhttp://localhost:5601/app/triggersActionsUiExample/rule/edit/<ruleId>\r\nwith
the rule you just created to edit the rule\r\n\r\n<img width=\"1236\"
alt=\"Screenshot 2024-07-02 at 5 15
51 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/1dc5d2a9-804a-4861-94ba-814de73dc3ab\">\r\n\r\n![Screenshot
2024-07-08 at 10
53\r\n44 PM](https://github.com/elastic/kibana/assets/74562234/07efade1-4b9c-485f-9833-84698dc29219)\r\n\r\n<img
width=\"1087\" alt=\"Screenshot 2024-07-02 at 5 15
58 PM\"\r\nsrc=\"https://github.com/elastic/kibana/assets/74562234/903e66b5-f9a1-4d09-b121-b1dcecdff72c\">\r\n\r\n\r\n###
Checklist\r\n- [x] [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: kibanamachine
<[email protected]>\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"54659e8ae002aa68be3ee472ef12b3d3f546a1ea"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jiawei Wu <[email protected]>
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:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RAM] [Rule Form V2] Add full-page create/edit form
7 participants