-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add shareable rule status filter #130705
Conversation
import { FormattedMessage } from '@kbn/i18n-react'; | ||
import { EuiFilterButton, EuiPopover, EuiFilterGroup, EuiFilterSelectItem } from '@elastic/eui'; | ||
|
||
type State = 'enabled' | 'muted' | 'disabled'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JiaweiWu I know this PR is still a draft, but I would like to give an input at this stage. It should be snoozed
instead of muted
@@ -75,6 +77,7 @@ export interface TriggersAndActionsUIPublicPluginStart { | |||
) => ReactElement<RuleEditProps>; | |||
getAlertsTable: (props: AlertsTableProps) => ReactElement<AlertsTableProps>; | |||
getRuleStatusDropdown: (props: RuleStatusDropdownProps) => ReactElement<RuleStatusDropdownProps>; | |||
getRuleStateFilter: (props: RuleStateFilterProps) => ReactElement<RuleStateFilterProps>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JiaweiWu Do you think we should call it getRuleStatusFilter
instead?
@JiaweiWu As we discussed for the status filter to work, we need some API changes as well, since we are currently using That being said I expect some changes in this function call https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.ts#L40, where we need to pass the new statusFilter along with the rest filters that are currently being passed. This means that this file https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.ts needs to be changed as well. |
@elasticmachine merge upstream |
@mgiota I added changes to the |
@elasticmachine merge upstream |
Pinging @elastic/response-ops (Team:ResponseOps) |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@JiaweiWu I just checked out your branch locally and Stack Management rules page is currently broken. It is most probably related to the refactoring you did to the executionStatus. I will try to use now the shared component in Observability and will give update you on this. |
@JiaweiWu I confirm that I just had to make one small change in triggers_actions_ui plugin to make it work. I will leave a comment inline to export |
@@ -58,6 +58,7 @@ import { | |||
RuleTableItem, | |||
RuleType, | |||
RuleTypeIndex, | |||
RuleStatus, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you export RuleStatus
here https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/index.ts#L15, so that we don't have to redefine the same type in observability?
@@ -163,6 +167,8 @@ export const RulesList: React.FunctionComponent = () => { | |||
); | |||
const [showErrors, setShowErrors] = useState(false); | |||
|
|||
const isRuleStatusFilterEnabled = getIsExperimentalFeatureEnabled('ruleStatusFilter'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no, you shouldn't need to check the experiment in o11y.
I'm doing it here because this is a new filter for the rules list and we don't want to expose it to the user yet (until we get design feedback). So the experiment hides it for the triggers actions UI rules list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I see, thanks for clarifying!
}): Promise<RuleAggregations> { | ||
const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, ruleStatusesFilter }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JiaweiWu Out of curiosity I was wondering why the new ruleStatusesFilter is not included here. Is it because the options of the rule status filter is a static hardcoded list (enabled
, disabled
, snoozed
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to filter the aggregate results as well? I suppose we do, I can add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! One comment about adding a test
}) | ||
).toEqual(['alert.attributes.executionStatus.status:(alert or statuses or filter)']); | ||
}); | ||
|
||
test('should handle ruleStatusesFilter', () => { | ||
expect( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add a test for just disabled
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, good idea!
@elasticmachine merge upstream |
💛 Build succeeded, but was flakyTest FailuresMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
* rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <[email protected]>
* rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <[email protected]>
* Add severity field to create API and migration * Adds integration test for severity field migration * remove exclusive test * Change severity levels * Update integration tests for post case * Add more integration tests * Fix all cases list test * Fix some server test * Fix util server test * Fix client util test * Convert event log's duration from number to string in Kibana (keep as "long" in Elasticsearch) (#130819) * Convert event.duration to string in TypeScript, keep as long in Elasticsearch * Fix jest test * Fix functional tests * Add ecsStringOrNumber to event log schema * Fix jest test * Add utility functions to event log plugin * Use new event log utility functions * PR fixes Co-authored-by: Kibana Machine <[email protected]> * filter o11y rule aggregations (#131301) * [Cloud Posture] Display and save rules per benchmark (#131412) * Adding aria-label for discover data grid select document checkbox (#131277) * Update API docs (#130999) Co-authored-by: Kibana Machine <[email protected]> * [CI] Use GCS buckets for bazel remote caching (#131345) * [Actionable Observability] Add license modal to rules table (#131232) * Add fix license link * fix localization * fix CI error * fix more translation issues Co-authored-by: Kibana Machine <[email protected]> * [RAM] Add shareable rule status filter (#130705) * rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <[email protected]> * [storybook] Watch for changes in packages (#131467) * [storybook] Watch for changes in packages * Update default_config.ts * Improve saved objects migrations failure errors and logs (#131359) * [Unified observability] Add tour step to guided setup (#131149) * [Lens] Improved interval input (#131372) * [Vega] Adjust vega doc for usage of ems files (#130948) * adjust vega doc * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Nick Peihl <[email protected]> * Excess intersections * Create severity user action * Add severity to create_case user action * Fix and add integration tests * Minor improvements Co-authored-by: Mike Côté <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: mgiota <[email protected]> Co-authored-by: Jordan <[email protected]> Co-authored-by: Bhavya RM <[email protected]> Co-authored-by: Thomas Neirynck <[email protected]> Co-authored-by: Brian Seeders <[email protected]> Co-authored-by: Jiawei Wu <[email protected]> Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Christiane (Tina) Heiligers <[email protected]> Co-authored-by: Alejandro Fernández Gómez <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Nick Peihl <[email protected]> Co-authored-by: Christos Nasikas <[email protected]>
* rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <[email protected]>
* Add severity field to create API and migration * Adds integration test for severity field migration * remove exclusive test * Change severity levels * Update integration tests for post case * Add more integration tests * Fix all cases list test * Fix some server test * Fix util server test * Fix client util test * Convert event log's duration from number to string in Kibana (keep as "long" in Elasticsearch) (elastic#130819) * Convert event.duration to string in TypeScript, keep as long in Elasticsearch * Fix jest test * Fix functional tests * Add ecsStringOrNumber to event log schema * Fix jest test * Add utility functions to event log plugin * Use new event log utility functions * PR fixes Co-authored-by: Kibana Machine <[email protected]> * filter o11y rule aggregations (elastic#131301) * [Cloud Posture] Display and save rules per benchmark (elastic#131412) * Adding aria-label for discover data grid select document checkbox (elastic#131277) * Update API docs (elastic#130999) Co-authored-by: Kibana Machine <[email protected]> * [CI] Use GCS buckets for bazel remote caching (elastic#131345) * [Actionable Observability] Add license modal to rules table (elastic#131232) * Add fix license link * fix localization * fix CI error * fix more translation issues Co-authored-by: Kibana Machine <[email protected]> * [RAM] Add shareable rule status filter (elastic#130705) * rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <[email protected]> * [storybook] Watch for changes in packages (elastic#131467) * [storybook] Watch for changes in packages * Update default_config.ts * Improve saved objects migrations failure errors and logs (elastic#131359) * [Unified observability] Add tour step to guided setup (elastic#131149) * [Lens] Improved interval input (elastic#131372) * [Vega] Adjust vega doc for usage of ems files (elastic#130948) * adjust vega doc * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Nick Peihl <[email protected]> * Excess intersections * Create severity user action * Add severity to create_case user action * Fix and add integration tests * Minor improvements Co-authored-by: Mike Côté <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: mgiota <[email protected]> Co-authored-by: Jordan <[email protected]> Co-authored-by: Bhavya RM <[email protected]> Co-authored-by: Thomas Neirynck <[email protected]> Co-authored-by: Brian Seeders <[email protected]> Co-authored-by: Jiawei Wu <[email protected]> Co-authored-by: Clint Andrew Hall <[email protected]> Co-authored-by: Christiane (Tina) Heiligers <[email protected]> Co-authored-by: Alejandro Fernández Gómez <[email protected]> Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Nick Peihl <[email protected]> Co-authored-by: Christos Nasikas <[email protected]>
Summary
Resolves: #130160
Adds a shareable rule status filter, this is a new component that does not exist as a part of the rule list. Therefore, it is not being used, expect as a shareable component.
Also renames the existing
rule_status_filter
torule_execution_status_filter
.