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

[Rules migration] Add possibility to navigate to a specific migration (#11264) #201597

Merged

Conversation

e40pud
Copy link
Contributor

@e40pud e40pud commented Nov 25, 2024

Summary

Internal link to the feature details

With these changes we:

  • allow user to navigate to a specific migration by its id
  • handle different possible states on migrations rules page:
    • no migrations: if there are no existing migrations we will redirect user to the landing page
    • unknown selected migration: if unknown migration id is specified in the URL, then "Unknown Migration" page will be shown
    • no selected migration: if user lands on the root "SIEM migrations rules" page, then most recent migration will be shown
    • show existing migration: selected migration will be shown

Screenshots

Unknown migration

Screenshot 2024-11-25 at 14 46 56

Show existing migration

Screenshot 2024-11-25 at 15 03 53

@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) labels Nov 25, 2024
@e40pud e40pud requested a review from semd November 25, 2024 14:06
@e40pud e40pud self-assigned this Nov 25, 2024
@e40pud e40pud requested a review from a team as a code owner November 25, 2024 14:06
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

💚 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
securitySolution 13.4MB 13.4MB -98.0B

History

cc @e40pud

import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import * as i18n from './translations';

const UnknownMigrationComponent = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we export the memo component directly everywhere? It's shorter and it makes it easier to find the references in the IDE.

export const UnknownMigration = React.memo(() => {
// [...]
});
UnknownMigration.displayName = 'UnknownMigration';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, will update our components in one of the next PRs.

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

LGTM

@e40pud e40pud merged commit 17410c3 into elastic:main Nov 26, 2024
43 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 26, 2024
…elastic#11264) (elastic#201597)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we:
* allow user to navigate to a specific migration by its id
* handle different possible states on migrations rules page:
* `no migrations`: if there are no existing migrations we will redirect
user to the landing page
* `unknown selected migration`: if unknown migration id is specified in
the URL, then "Unknown Migration" page will be shown
* `no selected migration`: if user lands on the root "SIEM migrations
rules" page, then most recent migration will be shown
  * `show existing migration`: selected migration will be shown

### Screenshots

**Unknown migration**

<img width="1312" alt="Screenshot 2024-11-25 at 14 46 56"
src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769">

**Show existing migration**

<img width="1312" alt="Screenshot 2024-11-25 at 15 03 53"
src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156">

(cherry picked from commit 17410c3)
@kibanamachine
Copy link
Contributor

💚 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

kibanamachine added a commit that referenced this pull request Nov 26, 2024
…ration (#11264) (#201597) (#201735)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Rules migration] Add possibility to navigate to a specific migration
(#11264) (#201597)](#201597)

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

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-26T09:39:17Z","message":"[Rules
migration] Add possibility to navigate to a specific migration (#11264)
(#201597)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we:\r\n* allow user to
navigate to a specific migration by its id\r\n* handle different
possible states on migrations rules page:\r\n* `no migrations`: if there
are no existing migrations we will redirect\r\nuser to the landing
page\r\n* `unknown selected migration`: if unknown migration id is
specified in\r\nthe URL, then \"Unknown Migration\" page will be
shown\r\n* `no selected migration`: if user lands on the root \"SIEM
migrations\r\nrules\" page, then most recent migration will be shown\r\n
* `show existing migration`: selected migration will be shown\r\n\r\n###
Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\"
alt=\"Screenshot 2024-11-25 at 14 46
56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show
existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot
2024-11-25 at 15 03
53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","Team: SecuritySolution","backport:prev-minor"],"title":"[Rules
migration] Add possibility to navigate to a specific migration
(#11264)","number":201597,"url":"https://github.com/elastic/kibana/pull/201597","mergeCommit":{"message":"[Rules
migration] Add possibility to navigate to a specific migration (#11264)
(#201597)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we:\r\n* allow user to
navigate to a specific migration by its id\r\n* handle different
possible states on migrations rules page:\r\n* `no migrations`: if there
are no existing migrations we will redirect\r\nuser to the landing
page\r\n* `unknown selected migration`: if unknown migration id is
specified in\r\nthe URL, then \"Unknown Migration\" page will be
shown\r\n* `no selected migration`: if user lands on the root \"SIEM
migrations\r\nrules\" page, then most recent migration will be shown\r\n
* `show existing migration`: selected migration will be shown\r\n\r\n###
Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\"
alt=\"Screenshot 2024-11-25 at 14 46
56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show
existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot
2024-11-25 at 15 03
53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201597","number":201597,"mergeCommit":{"message":"[Rules
migration] Add possibility to navigate to a specific migration (#11264)
(#201597)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we:\r\n* allow user to
navigate to a specific migration by its id\r\n* handle different
possible states on migrations rules page:\r\n* `no migrations`: if there
are no existing migrations we will redirect\r\nuser to the landing
page\r\n* `unknown selected migration`: if unknown migration id is
specified in\r\nthe URL, then \"Unknown Migration\" page will be
shown\r\n* `no selected migration`: if user lands on the root \"SIEM
migrations\r\nrules\" page, then most recent migration will be shown\r\n
* `show existing migration`: selected migration will be shown\r\n\r\n###
Screenshots\r\n\r\n**Unknown migration**\r\n\r\n<img width=\"1312\"
alt=\"Screenshot 2024-11-25 at 14 46
56\"\r\nsrc=\"https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769\">\r\n\r\n**Show
existing migration**\r\n\r\n<img width=\"1312\" alt=\"Screenshot
2024-11-25 at 15 03
53\"\r\nsrc=\"https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156\">","sha":"17410c39279fcca551d3af7299b04d1ccf8ceefa"}}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <[email protected]>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Nov 26, 2024
…elastic#11264) (elastic#201597)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we:
* allow user to navigate to a specific migration by its id
* handle different possible states on migrations rules page:
* `no migrations`: if there are no existing migrations we will redirect
user to the landing page
* `unknown selected migration`: if unknown migration id is specified in
the URL, then "Unknown Migration" page will be shown
* `no selected migration`: if user lands on the root "SIEM migrations
rules" page, then most recent migration will be shown
  * `show existing migration`: selected migration will be shown

### Screenshots

**Unknown migration**

<img width="1312" alt="Screenshot 2024-11-25 at 14 46 56"
src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769">

**Show existing migration**

<img width="1312" alt="Screenshot 2024-11-25 at 15 03 53"
src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156">
e40pud added a commit that referenced this pull request Dec 4, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Dec 4, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.

* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.

* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?

(cherry picked from commit 4d8f711)
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Dec 9, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
Samiul-TheSoccerFan pushed a commit to Samiul-TheSoccerFan/kibana that referenced this pull request Dec 10, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…elastic#11264) (elastic#201597)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we:
* allow user to navigate to a specific migration by its id
* handle different possible states on migrations rules page:
* `no migrations`: if there are no existing migrations we will redirect
user to the landing page
* `unknown selected migration`: if unknown migration id is specified in
the URL, then "Unknown Migration" page will be shown
* `no selected migration`: if user lands on the root "SIEM migrations
rules" page, then most recent migration will be shown
  * `show existing migration`: selected migration will be shown

### Screenshots

**Unknown migration**

<img width="1312" alt="Screenshot 2024-11-25 at 14 46 56"
src="https://github.com/user-attachments/assets/45f51489-e4f8-496f-86e6-d19130bd6769">

**Show existing migration**

<img width="1312" alt="Screenshot 2024-11-25 at 15 03 53"
src="https://github.com/user-attachments/assets/ca866432-5a61-44c7-8bec-7aa95ba73156">
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
## Summary

These are the followup updated to address feedback from my previous PRs:

* Make sure to use descriptive names specific to the `siem_migrations`
subdomain
([comment](elastic#200978 (review))):

> Make sure you use descriptive names specific to the siem_migrations
subdomain. Names like RulesPage, RulesTable, useRulesColumns etc are way
too generic and conflict with the rule management terminology, which
would make code search more difficult.


* Export the memo component directly everywhere
([comment](elastic#201597 (comment))):

> Could we export the memo component directly everywhere? It's shorter
and it makes it easier to find the references in the IDE.


* Use one hook to access APIs instead of two
([comment](elastic#202494 (comment))):

> I see that for every API request we have to implement 2 separate
hooks. Why don't we add error handling to the same hook that does the
useQuery? so we have everything in one hook. Or is there a reason to
have them separate?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants