-
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
[Synonyms UI] Synonyms UI base plugin #203284
Conversation
7db5d71
to
ba7c1f4
Compare
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.
It would be good to also add enabling the feature flag in this serverless config.feature_flags.ts and adding some very light FTRs with these changes as well. Just something that checks for the page to render or the link in the side nav that would give a place to build from.
You'll also want to add the app id to the apps list in the serverless FTR config.
And we would need to do the same in x-pack/test/functional/config.base.js when we want to add FTRs functional_search.
core: CoreSetup<AppPluginStartDependencies, SearchSynonymsPluginStart>, | ||
_: AppPluginSetupDependencies | ||
): SearchSynonymsPluginSetup { | ||
if (!this.config.ui?.enabled && !core.uiSettings.get<boolean>(SYNONYMS_UI_FLAG, false)) { |
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.
I'm not sure we need the config.ui
for this plugin. Those were added for the other plugins to share backend without sharing the frontend. Now that these plugins should always use both I think we can leave this out.
|
||
defineRoutes({ router, logger: this.logger }); | ||
|
||
plugins.features.registerKibanaFeature({ |
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.
❤️
privileges: { | ||
all: { | ||
app: ['kibana', PLUGIN_ID], | ||
api: [], |
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.
we should have privileges for the APIs as well as the UI since we're handling the KibanaFeature
from creation.
}, | ||
ui: [], | ||
}, | ||
read: { |
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.
We should implement read privileges with the feature so that we don't have to add it later. We should be able to follow other plugin (not search) for examples.
This will mean that you'll need to setup APIs with correct privileges as well for read vs all.
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.
I experimented a bit on this, I will update these with the next PR where I actually use them otherwise it will complicate. Also will include a cluster permission registration as well since we need those for the APIs.
Do you think changing these freely until we release the feature would cause a problem ? @TattdCodeMonkey
|
||
const configSchema = schema.object({ | ||
enabled: schema.boolean({ defaultValue: true }), | ||
ui: schema.object({ |
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.
see other comment, I think we can ditch this config value.
deepLinks: [ | ||
{ | ||
id: 'synonyms', | ||
path: PLUGIN_PATH, |
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.
PLUGIN_PATH = '/synonyms'
so the full URL path is going to be /app/elasticsearch/synonyms/synonyms
should that be /app/elasticsearch/synonyms/list
or something else? the double /synonyms
seems like it could be better.
@@ -18,6 +18,7 @@ export const SERVERLESS_ES_CONNECTORS_ID = 'serverlessConnectors'; | |||
export const SERVERLESS_ES_WEB_CRAWLERS_ID = 'serverlessWebCrawlers'; | |||
export const ES_SEARCH_PLAYGROUND_ID = 'searchPlayground'; | |||
export const SERVERLESS_ES_SEARCH_INFERENCE_ENDPOINTS_ID = 'searchInferenceEndpoints'; | |||
export const SERVERLESS_ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; |
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.
I think we can drop SERVERLESS_
since this app id/deep link will be used in both serverless and stack.
export const SERVERLESS_ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; | |
export const ES_SEARCH_SYNONYMS_ID = 'searchSynonyms'; |
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.
Core changes LGTM
@elasticmachine merge upstream |
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.
Overall, LGTM, but there are a number of rough edges that I think we might want to polish before merging this. Sorry if some of the suggestions feel like nitpicking, but adding a new plugin is a rare opportunity for the platform team to share knowledge and best practices with the rest of the Kibana contributors.
Thanks!
"requiredPlugins": [ | ||
"licensing", | ||
"features", | ||
], | ||
"optionalPlugins": [ | ||
"cloud", | ||
"console", | ||
"usageCollection", | ||
"searchNavigation", | ||
], | ||
"requiredBundles": [ | ||
"kibanaReact", | ||
] |
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.
Caution
Let's only add dependencies when we know we need them.
"requiredPlugins": [ | |
"licensing", | |
"features", | |
], | |
"optionalPlugins": [ | |
"cloud", | |
"console", | |
"usageCollection", | |
"searchNavigation", | |
], | |
"requiredBundles": [ | |
"kibanaReact", | |
] | |
"requiredPlugins": [ | |
"features" | |
], | |
"optionalPlugins": [ | |
"searchNavigation" | |
], | |
"requiredBundles": [ | |
"kibanaReact" | |
] |
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.
I updated this, and left the console in, as I will use it in the next PR same as the permissions conversation above. TBH eventually I will use (almost) all of the above but it is a good habit to not include unless using it, I understand your point.
x-pack/test_serverless/functional/test_suites/search/config.feature_flags.ts
Outdated
Show resolved
Hide resolved
… into synonyms-ui-base-plugin
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.
LGTM. Thanks for addressing my comments!
My pleasure <3 |
@elasticmachine merge upstream |
Starting backport for target branches: 8.x |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
|
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
## Summary Creates a plugin for Synonyms UI implementation. It is hidden under the UI flag and config option which is off by default. ``` POST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled {"value": true} ``` Serverless Search: <img width="379" alt="Screenshot 2024-12-17 at 13 18 02" src="https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7" /> Stack Search <img width="293" alt="Screenshot 2024-12-17 at 13 21 43" src="https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324" /> ### Checklist Check the PR satisfies following conditions. Reviewers should verify this PR satisfies this list as well. - [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/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 - [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. - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [[Synonyms UI] Synonyms UI base plugin (#203284)](#203284) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Efe Gürkan YALAMAN","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-06T19:15:19Z","message":"[Synonyms UI] Synonyms UI base plugin (#203284)\n\n## Summary\r\n\r\nCreates a plugin for Synonyms UI implementation. It is hidden under the\r\nUI flag and config option which is off by default.\r\n```\r\nPOST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled\r\n{\"value\": true}\r\n```\r\n\r\nServerless Search:\r\n<img width=\"379\" alt=\"Screenshot 2024-12-17 at 13 18 02\"\r\nsrc=\"https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7\"\r\n/>\r\n\r\nStack Search\r\n<img width=\"293\" alt=\"Screenshot 2024-12-17 at 13 21 43\"\r\nsrc=\"https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324\"\r\n/>\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"e542fd2370c8b247beb938f337602f60bb6c0573","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:EnterpriseSearch","backport:version","v8.18.0"],"number":203284,"url":"https://github.com/elastic/kibana/pull/203284","mergeCommit":{"message":"[Synonyms UI] Synonyms UI base plugin (#203284)\n\n## Summary\r\n\r\nCreates a plugin for Synonyms UI implementation. It is hidden under the\r\nUI flag and config option which is off by default.\r\n```\r\nPOST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled\r\n{\"value\": true}\r\n```\r\n\r\nServerless Search:\r\n<img width=\"379\" alt=\"Screenshot 2024-12-17 at 13 18 02\"\r\nsrc=\"https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7\"\r\n/>\r\n\r\nStack Search\r\n<img width=\"293\" alt=\"Screenshot 2024-12-17 at 13 21 43\"\r\nsrc=\"https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324\"\r\n/>\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"e542fd2370c8b247beb938f337602f60bb6c0573"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/203284","number":203284,"mergeCommit":{"message":"[Synonyms UI] Synonyms UI base plugin (#203284)\n\n## Summary\r\n\r\nCreates a plugin for Synonyms UI implementation. It is hidden under the\r\nUI flag and config option which is off by default.\r\n```\r\nPOST kbn:/internal/kibana/settings/searchSynonyms:synonymsEnabled\r\n{\"value\": true}\r\n```\r\n\r\nServerless Search:\r\n<img width=\"379\" alt=\"Screenshot 2024-12-17 at 13 18 02\"\r\nsrc=\"https://github.com/user-attachments/assets/8c2cb6f0-ce2a-4be6-8605-4f994adeefd7\"\r\n/>\r\n\r\nStack Search\r\n<img width=\"293\" alt=\"Screenshot 2024-12-17 at 13 21 43\"\r\nsrc=\"https://github.com/user-attachments/assets/0d61de0e-2cd3-46a6-990f-1f1a70843324\"\r\n/>\r\n\r\n\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following conditions. \r\n\r\nReviewers should verify this PR satisfies this list as well.\r\n\r\n- [x] Any text added follows [EUI's writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing), uses\r\nsentence case text and includes [i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n- [ ]\r\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\r\nwas added for features that require explanation or tutorials\r\n- [ ] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios\r\n- [x] This was checked for breaking HTTP API changes, and any breaking\r\nchanges have been approved by the breaking-change committee. The\r\n`release_note:breaking` label should be applied in these situations.\r\n- [ ] [Flaky Test\r\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was\r\nused on any tests changed\r\n- [x] The PR description includes the appropriate Release Notes section,\r\nand the correct `release_note:*` label is applied per the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"e542fd2370c8b247beb938f337602f60bb6c0573"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Summary
Creates a plugin for Synonyms UI implementation. It is hidden under the UI flag and config option which is off by default.
Serverless Search:
Stack Search
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breaking
label should be applied in these situations.release_note:*
label is applied per the guidelines