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

Upgrade redux toolkit to 2.2.2 #178986

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Zacqary
Copy link
Contributor

@Zacqary Zacqary commented Mar 19, 2024

Summary

Updates @reduxjs/toolkit to 2.2.1 2.2.2 in preparation to use it in the Rule Form v2. It looks like breaking changes from 1.x to 2.x don't affect us.

Also updates core Redux packages to the same dependencies required by Toolkit.

Affected codeowners:

  • @elastic/kibana-presentation (controls, dashboard, embeddable, presentation_util)
  • @elastic/kibana-visualizations (kbn-coloring, lens)
  • @elastic/security-threat-hunting-investigations (kbn-expandable-flyout, timelines)
  • @elastic/obs-ux-infra_services-team (observability/synthetics)
  • @elastic/ml-ui (transform)

@Zacqary Zacqary added 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 labels Mar 19, 2024
@Zacqary Zacqary requested review from a team March 19, 2024 16:52
@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@Zacqary Zacqary marked this pull request as ready for review March 19, 2024 17:41
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Code seems to LGTM, but when I try to build this locally the bootstrap script fails. Is this happening for anyone else?

[bazel] ERROR: /Users/jk/git/justinkambic/kibana/packages/kbn-ui-shared-deps-npm/BUILD.bazel:72:12: Action packages/kbn-ui-shared-deps-npm/shared_built_assets failed: (Exit 1): webpack-cli.sh failed: error executing command bazel-out/host/bin/external/npm/webpack-cli/bin/webpack-cli.sh --config packages/kbn-ui-shared-deps-npm/webpack.config.js --output-path ... (remaining 3 arguments skipped)

I deleted basically everything and tried doing a fresh install a few different ways and it's failing every time.

@walterra
Copy link
Contributor

walterra commented Mar 19, 2024

Please note that for previous updates of redux-toolkit we also updated its dependencies that are in Kibana's package.json themselves, for example #138818 and #175017. You can see in the linked issues which other packages were updated. The idea was that we would not end up with diverging packages of redux, immer etc. across Kibana.

For example in the file x-pack/plugins/transform/public/app/sections/edit_transform/state_management/edit_transform_flyout_state.tsx we need to import stuff from @reduxjs/toolkit, react-redux and redux. If we updated only redux toolkit in Kibana's package.json we'd end up importing redux toolkit with redux v5 under the hood, but the plain redux import would still be v4.

This PR #166367 lists the redux related packages that are part of the shared bundle: @reduxjs/toolkit, redux, react-redux, immer, reselect. I think we need to make sure there's only one version used for each of these packages to make the shared bundle work, the error @justinkambic is seeing might be related to this.

@PhilippeOberti
Copy link
Contributor

Code seems to LGTM, but when I try to build this locally the bootstrap script fails. Is this happening for anyone else?

[bazel] ERROR: /Users/jk/git/justinkambic/kibana/packages/kbn-ui-shared-deps-npm/BUILD.bazel:72:12: Action packages/kbn-ui-shared-deps-npm/shared_built_assets failed: (Exit 1): webpack-cli.sh failed: error executing command bazel-out/host/bin/external/npm/webpack-cli/bin/webpack-cli.sh --config packages/kbn-ui-shared-deps-npm/webpack.config.js --output-path ... (remaining 3 arguments skipped)

I deleted basically everything and tried doing a fresh install a few different ways and it's failing every time.

I'm seeing the same thing, I can't test the PR at the moment. This is the error I'm getting when running yarn kbn reset && yarn kbn bootstrap
Screenshot 2024-03-20 at 9 04 39 AM

@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 20, 2024

There's a .js file in React Toolkit's dist folder that doesn't seem to have transpiled from Typescript correctly:

if (cache?.has(value))

is not valid Javascript

Trying to figure out if this is a problem on our end or on Redux's end.

@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 20, 2024

Okay actually it turns out they added optional chaining to ECMAScript.

Our build tool didn't get the memo, though. Looking into this.

@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 20, 2024

Turns out EUI ran into this issue as well with another package, and it's because Kibana is still on Webpack 4: #166676 (comment)

I've opened this issue on Redux Toolkit to track, because they explicitly were hoping to achieve Webpack 4 compatibility: reduxjs/redux-toolkit#4282

May need to put this upgrade on hold till Kibana is on Webpack 5, depending on what the Redux team says.

EDIT: Redux maintainers are fixing this today

@Zacqary Zacqary self-assigned this Mar 20, 2024
@Zacqary Zacqary mentioned this pull request Mar 20, 2024
12 tasks
@kqualters-elastic
Copy link
Contributor

Security solution makes use of the maxSize option passed by reselect to the lruMemoize object that reselect 4.x uses by default, and now in 5.x that shouldn't be needed/might blow up once we move to redux-toolkit 2.2.2, as it uses weakMapMemoize by default instead, which does not support maxSize. Will need to test these parts of security solution once everything is up to date. See the reselect 5.0 changelog https://github.com/reduxjs/reselect/releases/tag/v5.0.1 for more, not sure if it will fail silently or just ignore the option or what right now.

@Zacqary Zacqary changed the title Upgrade redux toolkit to 2.2.1 Upgrade redux toolkit to 2.2.2 Mar 21, 2024
@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 21, 2024

@kqualters-elastic Understood, I'll do my best to test this myself but some confirmation from Security that this is good to go would be great. 2.2.2 is merged in this branch now.

@justinkambic @PhilippeOberti Bootstrapping works now with the latest commit if y'all want to test again

@kqualters-elastic
Copy link
Contributor

Only 1 file needs to be changed if so https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/store/sourcerer/selectors.ts I would expect the reselect types to catch this tbh, but maybe not. Will manually test soon.

@mbondyra mbondyra self-requested a review March 25, 2024 09:43
@walterra
Copy link
Contributor

Tricky PR, thanks for picking it up and making good progress! At the moment we still have "react-redux": "^7.2.8", in package.json which uses redux v4. Can you try to update to "react-redux": "^8.1.3", which should pick up redux v5?

@botelastic botelastic bot added the Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team label Mar 25, 2024
@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 25, 2024

@justinkambic Synthetics is fixed, there was an enhancers field defined as an empty array which is a deprecated pattern in 5.x. Also had to upgrade redux-saga to fix a type error with the middleware, this is a minor release though so it shouldn't break anything.

@PhilippeOberti Fixed security as well, same enhancers issue but it was present in kbn-expandable-flyout

@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 25, 2024

@walterra Any reason to use 8.1.3 and not the latest 9.1.0?

@walterra
Copy link
Contributor

@Zacqary What I saw from the dependency requirements is that 8.1.3 supports React 16/17/18 whereas 9.1.0 enforces React 18 only which we don't have yet.

@Zacqary Zacqary requested review from a team as code owners March 25, 2024 22:03
@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Mar 25, 2024
@kibana-ci
Copy link
Collaborator

kibana-ci commented Mar 26, 2024

⏳ Build in-progress, with failures

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / renders analyzer graph correctly
  • [job] [logs] Serverless Detection Engine - Security Solution Cypress Tests #4 / Alert user assignment - ESS & Serverless Alerts filtering by assignee and alert status by assignee and alert status
  • [job] [logs] Detection Engine - Security Solution Cypress Tests #1 / Alert user assignment - ESS & Serverless Alerts filtering by assignee and alert status by assignee and alert status
  • [job] [logs] FTR Configs #50 / Cases - group 1 View case Lens visualization adds lens visualization in description
  • [job] [logs] Investigations - Security Solution Cypress Tests #6 / Changing alert status Marking alerts as acknowledged Mark one alert as acknowledged when more than one open alerts are selected Mark one alert as acknowledged when more than one open alerts are selected
  • [job] [logs] FTR Configs #79 / Controls Dashboard control group settings "before all" hook for "adjust layout of controls"
  • [job] [logs] FTR Configs #53 / dashboard app - group 1 Changing field formatter to Url applied on dashboard
  • [job] [logs] FTR Configs #53 / dashboard app - group 1 Changing field formatter to Url applied on dashboard
  • [job] [logs] FTR Configs #42 / dashboard app - group 3 dashboard time picker Visualization updated when time picker changes
  • [job] [logs] FTR Configs #54 / dashboard app - group 3 dashboard time picker Visualization updated when time picker changes
  • [job] [logs] FTR Configs #54 / dashboard app - group 3 dashboard time picker Visualization updated when time picker changes
  • [job] [logs] FTR Configs #16 / dashboard app - group 4 dashboard empty state adds a new data view when no data views
  • [job] [logs] FTR Configs #6 / dashboard app - group 6 dashboard grid move panel Can move panel from bottom to top row
  • [job] [logs] FTR Configs #6 / dashboard app - group 6 dashboard grid move panel Can move panel from bottom to top row
  • [job] [logs] FTR Configs #90 / Dashboard dashboard with async search not delayed should load
  • [job] [logs] FTR Configs #90 / Dashboard dashboard with async search not delayed should load
  • [job] [logs] FTR Configs #38 / dashboard feature controls dashboard feature controls security global dashboard all privileges, no embeddable application privileges create new dashboard shows addNew button
  • [job] [logs] FTR Configs #11 / dashboard Reporting Dashboard Reporting Screenshots Print PDF button is available if new
  • [job] [logs] FTR Configs #11 / dashboard Reporting Dashboard Reporting Screenshots Print PDF button is available if new
  • [job] [logs] FTR Configs #25 / dashboard save warns on duplicate name for new dashboard
  • [job] [logs] FTR Configs #25 / dashboard save warns on duplicate name for new dashboard
  • [job] [logs] FTR Configs #25 / dashboard sync colors should sync colors on dashboard by default
  • [job] [logs] FTR Configs #25 / dashboard sync colors should sync colors on dashboard by default
  • [job] [logs] Jest Tests #13 / data state when there are parameters to fetch but no pending request should need to request the tree
  • [job] [logs] Jest Tests #13 / data state when there are parameters to fetch but no pending request should not be loading, have an error, have more children or ancestors, or have a pending request that needs to be aborted.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request but no current tree fetching parameters should be loading
  • [job] [logs] Jest Tests #13 / data state when there is a pending request but no current tree fetching parameters should have a request to abort
  • [job] [logs] Jest Tests #13 / data state when there is a pending request but no current tree fetching parameters should not have an error, more children, more ancestors, or request to make.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters should be loading
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters should not have a request to abort
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters should not have an error, more children, more ancestors, a request to make, or a pending request that should be aborted.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters when the pending request fails should have an error
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters when the pending request fails should not be loading
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made using the current parameters when the pending request fails should not be loading, have more children, have more ancestors, have a request to make, or have a pending request that needs to be aborted.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters and when the old request was aborted should have a document to fetch
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters and when the old request was aborted should not be loading
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters and when the old request was aborted should not have an error, more children, or more ancestors.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters and when the old request was aborted should not require a pending request to be aborted
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters should be loading
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters should need to abort the request for the databaseDocumentID
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters should need to request the tree using the second set of parameters
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters should not have an error, more children, or more ancestors.
  • [job] [logs] Jest Tests #13 / data state when there is a pending request that was made with parameters that are different than the current tree fetching parameters should use the correct location for the second resolver
  • [job] [logs] FTR Configs #3 / Discover customization examples Customizations Search bar Prepend Filters exists and should apply filter properly
  • [job] [logs] FTR Configs #24 / discover search with scripted fields query should show incomplete results badge on dashboard
  • [job] [logs] FTR Configs #27 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #33 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #40 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #33 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #27 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #40 / discover/embeddable discover saved search embeddable "before each" hook for "can save a search embeddable with a defined rows per page number"
  • [job] [logs] FTR Configs #21 / discover/group1 discover URL state Side nav should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover
  • [job] [logs] FTR Configs #75 / discover/group1 discover URL state Side nav should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover
  • [job] [logs] FTR Configs #75 / discover/group1 discover URL state Side nav should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover
  • [job] [logs] FTR Configs #21 / discover/group1 discover URL state Side nav should sync Lens global state to Discover sidebar link and carry over the state when navigating to Discover
  • [job] [logs] FTR Configs #83 / discover/group2 discover data grid context tests navigates to context view from embeddable
  • [job] [logs] FTR Configs #10 / discover/group2 discover data grid doc table should show popover with expanded cell content by click on expand button on embeddable
  • [job] [logs] FTR Configs #10 / discover/group2 discover data grid doc table should show popover with expanded cell content by click on expand button on embeddable
  • [job] [logs] FTR Configs #49 / discover/group3 discover time field column should add a time field column data view mode time-based data view should render initial columns correctly
  • [job] [logs] FTR Configs #49 / discover/group3 discover time field column should add a time field column data view mode time-based data view should render initial columns correctly
  • [job] [logs] FTR Configs #61 / discover/group4 adhoc data views search results should be different after data view update
  • [job] [logs] FTR Configs #65 / embedded Lens examples show and save should save to dashboard
  • [job] [logs] Entity Analytics - Security Solution Cypress Tests #1 / Entity Analytics Dashboard legacy risk score With user risk data With alerts data opens alerts page when alerts count is clicked opens alerts page when alerts count is clicked
  • [job] [logs] Jest Tests #12 / GraphOverlay when used in an events viewer (i.e. in the Detections view, or the Host > Events view) it gets index pattern from default data view
  • [job] [logs] Jest Tests #12 / GraphOverlay when used in an events viewer (i.e. in the Detections view, or the Host > Events view) it has 100% width when NOT in full screen mode
  • [job] [logs] Jest Tests #12 / GraphOverlay when used in an events viewer (i.e. in the Detections view, or the Host > Events view) it has a fixed position when in full screen mode
  • [job] [logs] Jest Tests #12 / GraphOverlay when used in the active timeline it clears the graph event id on unmount
  • [job] [logs] FTR Configs #32 / Journey[dashboard_listing_page] Add dashboard
  • [job] [logs] FTR Configs #32 / Journey[dashboard_listing_page] Add dashboard
  • [job] [logs] FTR Configs #54 / Journey[ecommerce_dashboard_map_only] Go to Ecommerce No Map Dashboard
  • [job] [logs] FTR Configs #54 / Journey[ecommerce_dashboard_map_only] Go to Ecommerce No Map Dashboard
  • [job] [logs] FTR Configs #95 / Journey[ecommerce_dashboard] Go to Ecommerce Dashboard
  • [job] [logs] FTR Configs #79 / Journey[flight_dashboard] Go to Flights Dashboard
  • [job] [logs] FTR Configs #50 / Journey[infra_hosts_view] Navigate to Hosts view and load 500 hosts
  • [job] [logs] FTR Configs #96 / lens app - Agg based Vis Open in Lens Pie should convert aggregation with params
  • [job] [logs] FTR Configs #96 / lens app - Agg based Vis Open in Lens Pie should convert aggregation with params
  • [job] [logs] FTR Configs #66 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #77 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #66 / lens app - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #8 / lens app - group 2 lens partition charts "before all" hook for "should be able to nest up to 3 levels for Pie charts"
  • [job] [logs] FTR Configs #68 / lens app - group 3 lens add-to-dashboards tests should allow new lens to be added by value to a new dashboard
  • [job] [logs] FTR Configs #68 / lens app - group 3 lens add-to-dashboards tests should allow new lens to be added by value to a new dashboard
  • [job] [logs] FTR Configs #85 / lens app - group 4 lens color palette tests should allow to pick legacy color palette in xy chart
  • [job] [logs] FTR Configs #85 / lens app - group 4 lens color palette tests should allow to pick legacy color palette in xy chart
  • [job] [logs] FTR Configs #18 / lens app - group 5 lens drag and drop tests basic drag and drop should construct the basic split xy chart
  • [job] [logs] FTR Configs #51 / lens app - group 6 lens metric should render a metric
  • [job] [logs] FTR Configs #82 / lens app - TSVB Open in Lens Convert to Lens action on dashboard should show notification in context menu if visualization can be converted
  • [job] [logs] FTR Configs #82 / lens app - TSVB Open in Lens Convert to Lens action on dashboard should show notification in context menu if visualization can be converted
  • [job] [logs] FTR Configs #76 / lens app - TSVB Open in Lens Metric should convert to Lens
  • [job] [logs] FTR Configs #76 / lens app - TSVB Open in Lens Metric should convert to Lens
  • [job] [logs] FTR Configs #9 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #28 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #32 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #9 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #28 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #32 / lens serverless - group 1 lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #75 / links panel links panel create and edit creation "before all" hook for "can not add an external link that violates externalLinks.policy"
  • [job] [logs] FTR Configs #75 / links panel links panel create and edit creation "before all" hook for "can not add an external link that violates externalLinks.policy"
  • [job] [logs] FTR Configs #90 / machine learning - anomaly detection anomaly charts in dashboard with multi metric job can open job selection flyout
  • [job] [logs] FTR Configs #90 / machine learning - anomaly detection anomaly charts in dashboard with multi metric job can open job selection flyout
  • [job] [logs] FTR Configs #15 / machine learning - data visualizer index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #15 / machine learning - data visualizer index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #18 / machine learning basic license - data visualizer - group 2 index based with view in lens action farequote index pattern loads lens charts
  • [job] [logs] FTR Configs #89 / management kibana settings state:storeInSessionStorage when false, dashboard state is unhashed
  • [job] [logs] FTR Configs #89 / management kibana settings state:storeInSessionStorage when false, dashboard state is unhashed
  • [job] [logs] FTR Configs #61 / maps app dashboard reporting: creates a map report PNG file matches the baseline image, using sample geo data
  • [job] [logs] FTR Configs #12 / maps app embeddable maps add-to-dashboard save flow should allow new map be added by value to a new dashboard
  • [job] [logs] FTR Configs #12 / maps app embeddable maps add-to-dashboard save flow should allow new map be added by value to a new dashboard
  • [job] [logs] FTR Configs #3 / Options list control "before all" hook: setup in "Options list control"
  • [job] [logs] FTR Configs #35 / Reporting Functional Tests with Deprecated Security configuration enabled Security with reporting_user built-in role Dashboard: Download CSV file does not allow user that does not have reporting_user role
  • [job] [logs] FTR Configs #10 / Reporting Functional Tests with Security enabled Security with reporting_user built-in role Dashboard: Generate CSV report does not allow user that does not have reporting privileges
  • [job] [logs] FTR Configs #10 / Reporting Functional Tests with Security enabled Security with reporting_user built-in role Dashboard: Generate CSV report does not allow user that does not have reporting privileges
  • [job] [logs] FTR Configs #35 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #47 / Sanity checks lens app lens smokescreen tests should allow creation of lens xy chart
  • [job] [logs] FTR Configs #69 / Saved query management Feature controls Security: App vs Global privilege dashboard read-only privileges with enabled savedQueryManagement.saveQuery privilege "before all" hook for "shows read-only badge"
  • [job] [logs] FTR Configs #8 / Serverless Common UI - Examples Discover customization examples Customizations Search bar Prepend Filters exists and should apply filter properly
  • [job] [logs] FTR Configs #20 / serverless observability UI Serverless Observability Cases Cases persistable attachments lens visualization "before all" hook for "adds lens visualization to a new case"
  • [job] [logs] FTR Configs #42 / serverless search UI default dataView should show dashboard but with no data in dashboard
  • [job] [logs] FTR Configs #4 / serverless security UI Serverless Security Cases Cases persistable attachments lens visualization "before all" hook for "adds lens visualization to a new case"
  • [job] [logs] Jest Tests #8 / useAlertsPrivileges if there is an error when fetching user privilege, we should get back false for all index related properties
  • [job] [logs] Jest Tests #8 / useAlertsPrivileges returns "hasIndexManage" is false if the privilege does not have cluster manage
  • [job] [logs] Jest Tests #8 / useAlertsPrivileges returns "hasIndexManage" is true if the privilege has cluster manage
  • [job] [logs] Jest Tests #8 / useAlertsPrivileges returns "hasKibanaCRUD" as false if user does not have SIEM Kibana "all" privileges
  • [job] [logs] Jest Tests #8 / useAlertsPrivileges returns "hasKibanaREAD" as false if user does not have at least SIEM Kibana "read" privileges
  • [job] [logs] FTR Configs #60 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #63 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #70 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #63 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #70 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #60 / Visualizations - Group 2 lens app - Agg based Vis Open in Lens Pie should hide the "Convert to Lens" menu item if no split slices were defined
  • [job] [logs] FTR Configs #65 / Visualizations - Group 3 lens app - TSVB Open in Lens Metric should show the "Convert to Lens" menu item
  • [job] [logs] FTR Configs #82 / Visualizations - Group 3 lens app - TSVB Open in Lens Metric should show the "Convert to Lens" menu item
  • [job] [logs] FTR Configs #92 / Visualizations - Group 3 lens app - TSVB Open in Lens Metric should show the "Convert to Lens" menu item
  • [job] [logs] FTR Configs #82 / Visualizations - Group 3 lens app - TSVB Open in Lens Metric should show the "Convert to Lens" menu item
  • [job] [logs] FTR Configs #92 / Visualizations - Group 3 lens app - TSVB Open in Lens Metric should show the "Convert to Lens" menu item
  • [job] [logs] FTR Configs #35 / visualize app - group1 data table with index without time filter filters should add to dashboard and allow filtering
  • [job] [logs] FTR Configs #57 / visualize app Add to Dashboard adding a new metric to a new dashboard by value
  • [job] [logs] FTR Configs #95 / visualize app visual builder Time Series basics Clicking on the chart should create a filter
  • [job] [logs] FTR Configs #16 / Visualize smoke telemetry tests "before all" hook for "should trigger render event for "agg based" legacy_metric visualization"
  • [job] [logs] FTR Configs #83 / X-Pack Accessibility Tests - Group 1 Dashboard controls a11y tests Controls main menu panel
  • [job] [logs] FTR Configs #79 / X-Pack Accessibility Tests - Group 3 machine learning embeddables anomaly charts Accessibility with multi metric job can open job selection flyout

History

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

cc @Zacqary

@justinkambic
Copy link
Contributor

@justinkambic Synthetics is fixed, there was an enhancers field defined as an empty array which is a deprecated pattern in 5.x. Also had to upgrade redux-saga to fix a type error with the middleware, this is a minor release though so it shouldn't break anything.

Ok I will smoke test this for you soon and if Synthetics is un-busted I'll approve for my team.

Copy link
Contributor

@justinkambic justinkambic left a comment

Choose a reason for hiding this comment

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

Synthetics changes LGTM

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

@elastic/kibana-management changes lgtm

Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

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

doing some smoke testing and I'm finding a few issues:

https://github.com/elastic/kibana/assets/17276605/e7105b12-0db7-4054-b701-86cf0c14af0c
I'm also unfamiliar with this code, so maybe @logeekal will be able to help?

  • finally I see hundreds (thousands) of these warnings while navigating the app.
Screenshot 2024-03-27 at 9 04 52 AM While these are just warnings, they're going to be extremely annoying for developers who want to `console.log` things, as they're going to be buried under the amount of warnings...

I need to continue smoke testing the app as I'm afraid there might be a lot of these happening...

I'm not sure what's the path we should take here. Do you want us (by us I mean Threat Hunting Investigations team) to help out and contribute to this PR by pushing commits fixing some of these things?

@kqualters-elastic
Copy link
Contributor

@PhilippeOberti I think at least some of that is mentioned (along with the fix) in the immer 10.0 release notes breaking changes bit, specifically this part:

Replace all default imports: Replace import produce from "immer" with import {produce} from "immer"

https://github.com/immerjs/immer/releases/tag/v10.0.0
we do that here https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/resolver/store/helpers.ts#L9 and a few other places as well, https://github.com/elastic/kibana/blob/main/x-pack/plugins/osquery/public/saved_queries/form/use_saved_query_form.tsx#L11 for example. Also the warnings are related to immer as well, perhaps fixing the import issues resolves this, as I'm not sure how it would behave without importing the right thing for produce, but if not they refer to having to mutate the state object in a specific way to be compatible with immer, if for some reason we weren't using immer with a redux store and we are now, that can require lots of code changes to fix fully. main...kqualters-elastic:kibana:redux-toolkit-epic was an attempt at doing so in security solution, but never quite finished it, and it's diverged too much at this point, but the reducer changes are an example of what I mean.

Copy link
Contributor

@kqualters-elastic kqualters-elastic left a comment

Choose a reason for hiding this comment

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

More possible issues than I thought at first

@Zacqary
Copy link
Contributor Author

Zacqary commented Mar 28, 2024

@kqualters-elastic

Do you want us (by us I mean Threat Hunting Investigations team) to help out and contribute to this PR by pushing commits fixing some of these things?

That would be a big help, thank you. I was hoping this upgrade would be a simpler process based on consumers of Redux Toolkit, but a total KIbana Redux v4-v5 migration is a larger task that's difficult for me to do in parallel with ResponseOps's new Redux project.

@kqualters-elastic
Copy link
Contributor

@Zacqary are there specific features y'all need in v5, or can you get started using v4, and just be mindful of breaking changes and work around any of those possibly?

@kqualters-elastic
Copy link
Contributor

Not only do we need the app to run, but we should probably verify that upgrading reselect didn't introduce a memory leak in all of the places that make use of that library. This line in the release notes linked above 👀 : "Also, note that an "infinite cache size" from one point of view can be considered a "memory leak" for another point of view" ha. And the fun part about reselect is, if somewhere in kibana we are using a selector wrong and nothing is actually being memoized, calling it again and again will return the desired value still, and there's no apparent logic error. Before that would just be waste that gets eventually garbage collected I think, but now it's a memory leak 🥲 we recently fixed a few selectors in security solution that were failing open like this.

@Zacqary
Copy link
Contributor Author

Zacqary commented Apr 1, 2024

@kqualters-elastic We can absolutely get started in v4, this PR is primarily to deal with the tech debt of being behind. We're using Redux primarily because it's a highly documented architecture with best practices that we don't have to write and maintain in-house, so we're concerned about being a version behind the most easily accessible docs.

@kqualters-elastic
Copy link
Contributor

Before we upgrade any of this, I think we need to do the following: https://redux.js.org/usage/migrating-to-modern-redux

@mbondyra mbondyra removed their request for review May 8, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.14.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet