Skip to content

[ResponseOps][MW] Allow users to delete MWs#211399

Merged
guskovaue merged 13 commits intoelastic:mainfrom
guskovaue:MX-198559-allow-users-delete-mws
Mar 3, 2025
Merged

[ResponseOps][MW] Allow users to delete MWs#211399
guskovaue merged 13 commits intoelastic:mainfrom
guskovaue:MX-198559-allow-users-delete-mws

Conversation

@guskovaue
Copy link
Contributor

@guskovaue guskovaue commented Feb 17, 2025

Resolve: #198559
Resolve: #205269

Here I used the existing DELETE /internal/alerting/rules/maintenance_window/{id} API to delete MWs from the UI.
I added an action to the MW table so users can delete MWs. And show a delete confirmation modal when users delete a MW from the UI.

Checklist

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Unit or functional tests were updated or added to match the most common scenarios
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
@guskovaue guskovaue added Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// backport:prev-minor v9.1.0 v8.19.0 labels Feb 17, 2025
@guskovaue guskovaue self-assigned this Feb 17, 2025
@guskovaue
Copy link
Contributor Author

/ci

@guskovaue guskovaue added backport:version Backport to applied version labels and removed backport:prev-minor labels Feb 19, 2025
@guskovaue guskovaue marked this pull request as ready for review February 21, 2025 13:48
@guskovaue guskovaue requested a review from a team as a code owner February 21, 2025 13:48
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7916

[✅] x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/config.ts: 100/100 tests passed.

see run history

@elastic elastic deleted a comment from kibanamachine Feb 24, 2025
@umbopepato umbopepato self-requested a review March 3, 2025 08:39
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please upload the it renders test in x-pack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/maintenance_windows_list.test.tsx?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @adcoelho!
Why do you think it's important?
It just I did it from beginning, but it turned out that it'll be almost the same coverage as table_actions_popover.test.tsx. And also table_actions_popover.test.tsx + maintenance_windows_table.ts covers the whole functionality. So I decided that it's redundant.
WDYT?

Copy link
Contributor

@adcoelho adcoelho Mar 3, 2025

Choose a reason for hiding this comment

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

I misread the test there.

I thought we had a section to make sure all the correct actions render, but i confused it with the status.

    // check the status
    expect(result.getAllByText('Running')).toHaveLength(1);
    expect(result.getAllByText('Upcoming')).toHaveLength(1);
    expect(result.getAllByText('Finished')).toHaveLength(1);
    expect(result.getAllByText('Archived')).toHaveLength(1);

Nevermind then 👍

Copy link
Member

@umbopepato umbopepato left a comment

Choose a reason for hiding this comment

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

Local testing works correctly, also with limited privileges
LGTM! 🚀

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
alerting 235 237 +2

Async chunks

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

id before after diff
alerting 100.0KB 101.4KB +1.4KB

History

cc @guskovaue

@guskovaue guskovaue merged commit 6ce22f4 into elastic:main Mar 3, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13634250025

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [Response Ops] Fix maintenance window custom schedule create and update error (#192649)

Manual backport

To create the backport manually run:

node scripts/backport --pr 211399

Questions ?

Please refer to the Backport tool documentation

@guskovaue
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

guskovaue added a commit that referenced this pull request Mar 5, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ResponseOps][MW] Allow users to delete MWs
(#211399)](#211399)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT
[{"author":{"name":"Julia","email":"iuliia.guskova@elastic.co"},"sourceCommit":{"committedDate":"2025-03-03T15:20:31Z","message":"[ResponseOps][MW]
Allow users to delete MWs (#211399)\n\nResolve:
https://github.com/elastic/kibana/issues/198559\nResolve:
https://github.com/elastic/kibana/issues/205269\n\nHere I used the
existing DELETE\n/internal/alerting/rules/maintenance_window/{id} API to
delete MWs from\nthe UI.\nI added an action to the MW table so users can
delete MWs. And show a\ndelete confirmation modal when users delete a MW
from the UI.\n\n### Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"6ce22f4a336caa774acd360e3f66b74517d0bad0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Alerting","release_note:skip","Team:ResponseOps","backport:version","v9.1.0","v8.19.0"],"title":"[ResponseOps][MW]
Allow users to delete
MWs","number":211399,"url":"https://github.com/elastic/kibana/pull/211399","mergeCommit":{"message":"[ResponseOps][MW]
Allow users to delete MWs (#211399)\n\nResolve:
https://github.com/elastic/kibana/issues/198559\nResolve:
https://github.com/elastic/kibana/issues/205269\n\nHere I used the
existing DELETE\n/internal/alerting/rules/maintenance_window/{id} API to
delete MWs from\nthe UI.\nI added an action to the MW table so users can
delete MWs. And show a\ndelete confirmation modal when users delete a MW
from the UI.\n\n### Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"6ce22f4a336caa774acd360e3f66b74517d0bad0"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211399","number":211399,"mergeCommit":{"message":"[ResponseOps][MW]
Allow users to delete MWs (#211399)\n\nResolve:
https://github.com/elastic/kibana/issues/198559\nResolve:
https://github.com/elastic/kibana/issues/205269\n\nHere I used the
existing DELETE\n/internal/alerting/rules/maintenance_window/{id} API to
delete MWs from\nthe UI.\nI added an action to the MW table so users can
delete MWs. And show a\ndelete confirmation modal when users delete a MW
from the UI.\n\n### Checklist\n\n- [x] Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] This was
checked for breaking HTTP API changes, and any breaking\nchanges have
been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests
changed","sha":"6ce22f4a336caa774acd360e3f66b74517d0bad0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
Resolve: elastic#198559
Resolve: elastic#205269

Here I used the existing DELETE
/internal/alerting/rules/maintenance_window/{id} API to delete MWs from
the UI.
I added an action to the MW table so users can delete MWs. And show a
delete confirmation modal when users delete a MW from the UI.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

5 participants