-
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
[Advanced Settings] Integrate new Settings application into stateful Kibana #175255
[Advanced Settings] Integrate new Settings application into stateful Kibana #175255
Conversation
/ci |
/ci |
/ci |
/ci |
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
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.
data discovery changes look good and work well
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @ElenaStoeva |
"kibanaReact", | ||
"kibanaUtils" |
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.
🥳
Forgive a potentially silly question on my part, but why is it that the usage collection switch saves without the bottom bar appearing and asking the user whether they wish to save or cancel their changes? I only ask from a consistency standpoint, as it seems that every other option in advanced settings utilizes that bottom bar approach. |
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.
Great changes, tested locally
Thanks for the review @MichaelMarcialis! The Advanced settings plugin has functionality that allows other plugins to add their own sections in the app and render their own components in these sections, with logic that is separate from the logic for the rest of the Advanced setting fields. The "Usage collection" section is an example - it is added by the Please keep in mind that this is not something that is added by this PR - this behaviour has been like this for a while. The PR only replaces the old Advanced settings codebase with a recently developed and improved code. The UI is not really affected in any way. Edit: There is actually one change in the UI but it is minor: before, the "Revert to default" link would be displayed once the setting changes are saved, and now it is displayed once any change is made in the setting fields. |
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.
Great work with the settings plugin, @ElenaStoeva!
I re-tested locally and it seems to be working correctly. I have 1 question about the access management: when a role has "read only" access to settings for all spaces, I was expecting to see both tabs in read only mode. But there is only 1 tab and the global settings are hidden, is this the intended UX?
Thanks for the review @yuliacech! Regarding your question, when you created the role, did you provide access to the Advanced settings feature only? If that's the case, the other Kibana features are disabled which seems to also disable the |
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.
Thanks a lot, @ElenaStoeva! The global settings are displayed for the read only role.
Ah, thanks for that context, @ElenaStoeva! Will give it a review now. |
…Kibana (elastic#175255) Closes elastic#172922 ## Summary This PR: - Integrates the new Settings application (`packages/kbn-management/settings/application`) into stateful Kibana and removes the old `management_app` from the `src/plugins/advanced_settings` plugin. - Adds support for section registry in the new Settings application, so that other plugins can add their own sections to the Advanced settings app. - Adds functionality for disabling saving of settings based on the provided capabilities of the current user. <img width="1352" alt="Screenshot 2024-01-23 at 16 46 03" src="https://github.com/elastic/kibana/assets/59341489/1f3b7088-58e2-46e8-a7dd-ae0fc346b4ba"> <br><br> "Usage collection" section in Global settings: <img width="1099" alt="Screenshot 2024-01-23 at 16 48 24" src="https://github.com/elastic/kibana/assets/59341489/ebc54ad5-348b-46dd-a047-b418ddc7ba4f"> ### How to test **Testing Advanced settings in stateful Kibana:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start` 2. Go to Stack Management -> Advanced Settings 3. Verify that the app functions correctly. Both tabs (for space and global settings) should be displayed, setting fields should be editable and saveable, etc. **Testing the section registry** Currently, `telemetry_management_section` is the only plugin that registers a section - the "Usage collection" section under the "Global settings" tab. This should work correctly in stateful Kibana. 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` 2. Go to Stack Management -> Advanced Settings and select the "Global settings" tab 3. Scroll down and verify that the "Usage collection" section is displayed and works as expected. **Testing with different capabilities:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start` 2. Go to Stack Management -> Roles 3. Create a role that has "Read" access to Advanced settings and one that doesn't have any access. 4. Create users with each of these two roles. 5. Log in with these users and verify that the user with "Read" access can see the app but cannot edit it, and the user with no privileges cannot access the app. **Testing Advanced settings in serverless Kibana:** The Advanced settings app in serverless shouldn't be affected by these changes. 1. Start Es with `yarn es serverless` and Kibana with `yarn serverless-{es/oblt/security}` 2. Go to Management -> Advanced Settings 3. Verify that the app functions correctly. There shouldn't be any tabs as there are no spaces. <!-- ### Checklist Delete any items that are not applicable to this PR. - [ ] 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/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --> --------- Co-authored-by: kibanamachine <[email protected]>
…Kibana (elastic#175255) Closes elastic#172922 ## Summary This PR: - Integrates the new Settings application (`packages/kbn-management/settings/application`) into stateful Kibana and removes the old `management_app` from the `src/plugins/advanced_settings` plugin. - Adds support for section registry in the new Settings application, so that other plugins can add their own sections to the Advanced settings app. - Adds functionality for disabling saving of settings based on the provided capabilities of the current user. <img width="1352" alt="Screenshot 2024-01-23 at 16 46 03" src="https://github.com/elastic/kibana/assets/59341489/1f3b7088-58e2-46e8-a7dd-ae0fc346b4ba"> <br><br> "Usage collection" section in Global settings: <img width="1099" alt="Screenshot 2024-01-23 at 16 48 24" src="https://github.com/elastic/kibana/assets/59341489/ebc54ad5-348b-46dd-a047-b418ddc7ba4f"> ### How to test **Testing Advanced settings in stateful Kibana:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start` 2. Go to Stack Management -> Advanced Settings 3. Verify that the app functions correctly. Both tabs (for space and global settings) should be displayed, setting fields should be editable and saveable, etc. **Testing the section registry** Currently, `telemetry_management_section` is the only plugin that registers a section - the "Usage collection" section under the "Global settings" tab. This should work correctly in stateful Kibana. 1. Start Es with `yarn es snapshot --license=trial` and Kibana with `yarn start` 2. Go to Stack Management -> Advanced Settings and select the "Global settings" tab 3. Scroll down and verify that the "Usage collection" section is displayed and works as expected. **Testing with different capabilities:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start` 2. Go to Stack Management -> Roles 3. Create a role that has "Read" access to Advanced settings and one that doesn't have any access. 4. Create users with each of these two roles. 5. Log in with these users and verify that the user with "Read" access can see the app but cannot edit it, and the user with no privileges cannot access the app. **Testing Advanced settings in serverless Kibana:** The Advanced settings app in serverless shouldn't be affected by these changes. 1. Start Es with `yarn es serverless` and Kibana with `yarn serverless-{es/oblt/security}` 2. Go to Management -> Advanced Settings 3. Verify that the app functions correctly. There shouldn't be any tabs as there are no spaces. <!-- ### Checklist Delete any items that are not applicable to this PR. - [ ] 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/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### Risk Matrix Delete this section if it is not applicable to this PR. Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release. When forming the risk matrix, consider some of the following examples and how they may potentially impact the change: | Risk | Probability | Severity | Mitigation/Notes | |---------------------------|-------------|----------|-------------------------| | Multiple Spaces—unexpected behavior in non-default Kibana Space. | Low | High | Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces. | | Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. | High | Low | Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure. | | Code should gracefully handle cases when feature X or plugin Y are disabled. | Medium | High | Unit tests will verify that any feature flag or plugin combination still results in our service operational. | | [See more potential risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) | ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --> --------- Co-authored-by: kibanamachine <[email protected]>
Contributes to: elastic#194817 Why I assigned them: Assigned advanced_settings due to elastic#175255 Assigned dashboard_controls due to elastic#190797 Assigned dashboard_links due to elastic#174772 Assigned dashboard_panel_options due to elastic#178596 Assigned grok_debugger due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/grokdebugger/kibana.jsonc#L4 Assigned helpers due to elastic#164341 (call site) Assigned home due to elastic#103192 Assigned index_lifecycle_management due to elastic#116207 Assigned ingest_node_pipelines due to elastic#113783 Assigned kibana_overview due to https://github.com/elastic/kibana/blob/f00ac7a8a21463e6bb4a2784c3a3884f36c62900/x-pack/plugins/grokdebugger/kibana.jsonc#L4 Assigned management due to elastic#165705 Assigned painless_lab due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/painless_lab/kibana.jsonc#L4 Assigned search_profiler due to elastic#195343 Assigned uptime due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/kibana.jsonc#L4 Assigned lens due to elastic#175893 Assigned ml_anomaly_detection due to elastic#162126 Assigned canvas due to elastic#164376 Assigned cc replication due to elastic#149069 Assigned enterpise search due to elastic#79359 Assigned graph to due elastic#190797 Assigned license_management due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/license_management/kibana.jsonc#L4 Assigned maps due to elastic#155161 Assigned observability due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/observability/kibana.jsonc#L4 Assigned remote clusters due to elastic#96989 Assigned reporting due to elastic#121435 Assigned rollup_jobs due to https://github.com/elastic/kibana/blob/d57bc9a5d7d64f86b550eff7997605a3090aee9a/x-pack/plugins/rollup/kibana.jsonc#L4 Assigned watcher due to elastic#119717
## Summary Assign files within `x-pack/test/accessibility/apps/group[1|2|3]` ### Why I assigned them: Assigned advanced_settings due to #175255 Assigned dashboard_controls due to #190797 Assigned dashboard_links due to #174772 Assigned dashboard_panel_options due to #178596 Assigned grok_debugger due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/grokdebugger/kibana.jsonc#L4 Assigned helpers due to #164341 (call site) Assigned home due to #103192 Assigned index_lifecycle_management due to #116207 Assigned ingest_node_pipelines due to #113783 Assigned kibana_overview due to https://github.com/elastic/kibana/blob/f00ac7a8a21463e6bb4a2784c3a3884f36c62900/x-pack/plugins/grokdebugger/kibana.jsonc#L4 Assigned management due to #165705 Assigned painless_lab due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/painless_lab/kibana.jsonc#L4 Assigned search_profiler due to #195343 Assigned uptime due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/uptime/kibana.jsonc#L4 Assigned lens due to #175893 Assigned ml_anomaly_detection due to #162126 Assigned canvas due to #164376 Assigned cc replication due to #149069 Assigned enterpise search due to #79359 Assigned graph to due #190797 Assigned license_management due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/license_management/kibana.jsonc#L4 Assigned maps due to #155161 Assigned observability due to https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability_solution/observability/kibana.jsonc#L4 Assigned remote clusters due to #96989 Assigned reporting due to #121435 Assigned rollup_jobs due to https://github.com/elastic/kibana/blob/d57bc9a5d7d64f86b550eff7997605a3090aee9a/x-pack/plugins/rollup/kibana.jsonc#L4 Assigned watcher due to #119717 Contributes to: #194817 --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Rodney Norris <[email protected]>
Closes #172922
Summary
This PR:
packages/kbn-management/settings/application
) into stateful Kibana and removes the oldmanagement_app
from thesrc/plugins/advanced_settings
plugin."Usage collection" section in Global settings:
How to test
Testing Advanced settings in stateful Kibana:
yarn es snapshot
and Kibana withyarn start
Testing the section registry
Currently,
telemetry_management_section
is the only plugin that registers a section - the "Usage collection" section under the "Global settings" tab. This should work correctly in stateful Kibana.yarn es snapshot --license=trial
and Kibana withyarn start
Testing with different capabilities:
yarn es snapshot
and Kibana withyarn start
Testing Advanced settings in serverless Kibana:
The Advanced settings app in serverless shouldn't be affected by these changes.
yarn es serverless
and Kibana withyarn serverless-{es/oblt/security}