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] Allow initialization of the scope form the rule list component #173795

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

XavierM
Copy link
Contributor

@XavierM XavierM commented Dec 20, 2023

Summary

FIx _> #172785

Checklist

@XavierM XavierM added bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.0 v8.13.0 labels Dec 20, 2023
@XavierM XavierM requested review from a team as code owners December 20, 2023 23:23
@elasticmachine
Copy link
Contributor

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

@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Dec 20, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@XavierM XavierM force-pushed the init-scope-from-o11y-rule-management branch from 04c230b to c3e992a Compare December 20, 2023 23:26
@XavierM XavierM added the release_note:skip Skip the PR/issue when compiling release notes label Dec 20, 2023
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.

Checked locally and work as expected 👍🏻

Added two clarification questions.

@@ -67,13 +67,20 @@ export interface RuleFormConsumerSelectionProps {
consumers: RuleCreationValidConsumer[];
onChange: (consumer: RuleCreationValidConsumer | null) => void;
errors: IErrorObject;
selectedConsumer: RuleCreationValidConsumer | null | undefined;
selectedConsumer?: RuleCreationValidConsumer | null;
initialSelectedConsumer?: RuleCreationValidConsumer | null;
Copy link
Member

Choose a reason for hiding this comment

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

Why is null also acceptable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's the way it was setup before me so I kept it, I will ask @Zacqary if he has any use cases for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI -> @Zacqary

@maryam-saeidi had the idea to use null to avoid any kind of initialization. Therefore, rule creator can have the choice to obligated their user to set this value by themself.

Copy link
Contributor

Choose a reason for hiding this comment

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

That works. We can differentiate between null as an explicit uninitialized empty value, and undefined as something waiting for its initial initialization.

@XavierM XavierM force-pushed the init-scope-from-o11y-rule-management branch from 32218b8 to cacd11a Compare December 21, 2023 14:57
Copy link
Contributor

@Zacqary Zacqary left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
observability 587.1KB 587.2KB +33.0B
triggersActionsUi 1.4MB 1.4MB +221.0B
total +254.0B

History

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

@@ -97,6 +98,7 @@ export function RulesTab({ setRefresh, stateRefresh }: RulesTabProps) {
onSearchFilterChange={handleSearchFilterChange}
onStatusFilterChange={handleStatusFilterChange}
onTypeFilterChange={handleTypeFilterChange}
initialSelectedConsumer={AlertConsumers.LOGS}
Copy link
Member

Choose a reason for hiding this comment

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

@XavierM When I change this to initialSelectedConsumer={AlertConsumers.INFRASTRUCTURE}, should I see the Metrics as the default option? For me, it still shows Logs as the default option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You also need to change it there -> https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/pages/rules/rules.tsx#L150 because you folks are by passing our rule creation button.

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.

LGTM!

@XavierM XavierM merged commit 833eebf into elastic:main Dec 21, 2023
35 checks passed
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 21, 2023
…lastic#173795)

## Summary

FIx _> elastic#172785

### 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

(cherry picked from commit 833eebf)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.12

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 Dec 21, 2023
…ponent (#173795) (#173877)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[RAM] Allow initialization of the scope form the rule list component
(#173795)](#173795)

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

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

<!--BACKPORT [{"author":{"name":"Xavier
Mouligneau","email":"xavier.mouligneau@elastic.co"},"sourceCommit":{"committedDate":"2023-12-21T20:20:59Z","message":"[RAM]
Allow initialization of the scope form the rule list component
(#173795)\n\n## Summary\r\n\r\nFIx _>
https://github.com/elastic/kibana/issues/172785\r\n\r\n\r\n###
Checklist\r\n\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","sha":"833eebf6107b37ac1fc505b0b619587851479d70","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","impact:high","Team:ResponseOps","v8.12.0","Team:obs-ux-management","v8.13.0"],"number":173795,"url":"https://github.com/elastic/kibana/pull/173795","mergeCommit":{"message":"[RAM]
Allow initialization of the scope form the rule list component
(#173795)\n\n## Summary\r\n\r\nFIx _>
https://github.com/elastic/kibana/issues/172785\r\n\r\n\r\n###
Checklist\r\n\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","sha":"833eebf6107b37ac1fc505b0b619587851479d70"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173795","number":173795,"mergeCommit":{"message":"[RAM]
Allow initialization of the scope form the rule list component
(#173795)\n\n## Summary\r\n\r\nFIx _>
https://github.com/elastic/kibana/issues/172785\r\n\r\n\r\n###
Checklist\r\n\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","sha":"833eebf6107b37ac1fc505b0b619587851479d70"}}]}]
BACKPORT-->

Co-authored-by: Xavier Mouligneau <xavier.mouligneau@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.0 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants