[settings] Extract and fix Section Registry#163502
[settings] Extract and fix Section Registry#163502clintandrewhall merged 3 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
|
Pinging @elastic/appex-sharedux (Team:SharedUX) |
7a3278f to
8783dab
Compare
There was a problem hiding this comment.
I should probably delete this route, unless there are objections...?
vadimkibana
left a comment
There was a problem hiding this comment.
Code LGTM, also ran it locally LGTM.
One thing I'm not sure was fixed, is deterministic rendering order:
[..] so depending on the plugin load order, the render is not guaranteed.
but maybe I'm missing something.
ElenaStoeva
left a comment
There was a problem hiding this comment.
Code changes LGTM and tested the advanced settings app locally.
Thanks for working on this @clintandrewhall!
@vadimkibana You're right, this fix doesn't address that. I'm not sure how I would do it without adding a lot of complexity. Perhaps I'll leave it for a future fix, since we only have a single item being added at the moment. |
jloleysens
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up, I tested locally and it worked as expected for the telemetry section. Great job @clintandrewhall
[CI] Auto-commit changed files from 'node scripts/generate codeowners' Remove last bits from Spaces plugin. Update CODEOWNERS [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' Fix i18n keys Address NTS Fix test, translations Fix i18n variable to pass compatibility check.
Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
520aa91 to
e34e445
Compare
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
## Summary While working to extract various portions of the `advancedSettings` plugin into packages, I found the `ComponentRegistry` in the plugin to have a number of issues that contributed to a fairly bad UX: - the API allows for adding/overriding the title, subtitle and footer of the Advanced Settings page, but only the footer is rendered. - the API is available to all plugins, but only renders a single entry... so depending on the plugin load order, the render is not guaranteed. - filtering the footer in or out of the display is delegated to the component itself, so: - it only takes effect on render. - the count is only updated if you click on the page that contains it, but that logic is currently broken. - the error message is inaccurate.  This PR fixes those issues and more: - extracts the registry into its own package. - changes the API to allow for multiple sections from multiple plugins. - changes the API to filter these sections from the plugin, rather than from each individual component. - fixes state management to show sections, keep counts accurate, etc.  --------- Co-authored-by: Vadim Kibana <82822460+vadimkibana@users.noreply.github.com>
Addresses #160411 ## Summary This PR adds functionality for filtering out advanced settings that are not relevant for serverless. For context, we need to build an Advanced settings page in serverless which only contains a set of the existing settings. We will reuse the section registry (#163502) from the original Advanced settings plugin as well as its UI components which will also be extracted into a separate package. The app will be registered from inside the `serverless` plugin. In order to only display the settings that are relevant for serverless, we need to make some changes to the uiSettings service. The implementation in this PR leverages the existing `readonly` uiSettings param and adds the `setAllowlist()` method which is called by the serverless plugin to set an allowlist of setting keys. **Testing in serverless:** 1. Set `advanced_settings.enabled: true` to enable the Advanced settings app in serverless: https://github.com/elastic/kibana/blob/5b216c6ea94e739fea1f161f0bbce5a57ae44c02/config/serverless.yml#L53 2. Start Es with `yarn es serverless --ssl` and Kibana with `yarn serverless-{mode} --ssl` in any serverless mode. 3. Navigate to `app/management/kibana/settings` 4. Verify that the app only displays the settings from `packages/serverless/settings/common/index.ts` (these are the settings, relevant for all projects in serverless) as well as the settings from the corresponding project package `packages/serverless/settings/{mode}_project/index.ts`. 5. Verify that the app is functioning correctly. **Testing in self-managed:** 1. Start Es with `yarn es snapshot` and Kibana with `yarn start`. 2. Go to Stack Management > Advanced settings 3. Verify that all settings are displayed as usual. 4. Verify that the app is functioning correctly. If your team is a code owner of any of the serverless project plugins, please review the corresponding package `packages/serverless/settings/{search/observanility/security}_project/index.ts` where you've been added as an owner and test in the serverless solution accordingly. <!--- ### 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 - [ ] 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 <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Tiago Costa <tiago.costa@elastic.co>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
4 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |

Summary
While working to extract various portions of the
advancedSettingsplugin into packages, I found theComponentRegistryin the plugin to have a number of issues that contributed to a fairly bad UX:This PR fixes those issues and more: