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

[Synonyms UI] Synonyms UI base plugin #203284

Merged
merged 23 commits into from
Jan 6, 2025

Conversation

efegurkan
Copy link
Member

@efegurkan efegurkan commented Dec 6, 2024

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:
Screenshot 2024-12-17 at 13 18 02

Stack Search
Screenshot 2024-12-17 at 13 21 43

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • 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 was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

@efegurkan efegurkan force-pushed the synonyms-ui-base-plugin branch from 7db5d71 to ba7c1f4 Compare December 17, 2024 14:21
@efegurkan efegurkan added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 v8.17.0 Team:EnterpriseSearch labels Dec 17, 2024
@efegurkan efegurkan changed the title [Synonyms UI]Synonyms UI base plugin [Synonyms UI] Synonyms UI base plugin Dec 17, 2024
@efegurkan efegurkan marked this pull request as ready for review December 17, 2024 14:23
@efegurkan efegurkan requested review from a team as code owners December 17, 2024 14:23
@efegurkan efegurkan added backport:version Backport to applied version labels v8.18.0 and removed v8.17.0 labels Dec 17, 2024
Copy link
Contributor

@TattdCodeMonkey TattdCodeMonkey left a 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)) {
Copy link
Contributor

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({
Copy link
Contributor

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: [],
Copy link
Contributor

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: {
Copy link
Contributor

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.

Copy link
Member Author

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({
Copy link
Contributor

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,
Copy link
Contributor

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';
Copy link
Contributor

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.

Suggested change
export const SERVERLESS_ES_SEARCH_SYNONYMS_ID = 'searchSynonyms';
export const ES_SEARCH_SYNONYMS_ID = 'searchSynonyms';

Copy link
Member

@afharo afharo left a comment

Choose a reason for hiding this comment

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

Core changes LGTM

@azasypkin azasypkin self-requested a review December 20, 2024 14:36
@efegurkan
Copy link
Member Author

@elasticmachine merge upstream

Copy link
Member

@azasypkin azasypkin left a 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!

config/serverless.es.yml Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/README.md Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/server/config.ts Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/server/plugin.ts Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/server/plugin.ts Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/public/plugin.ts Outdated Show resolved Hide resolved
Comment on lines 15 to 27
"requiredPlugins": [
"licensing",
"features",
],
"optionalPlugins": [
"cloud",
"console",
"usageCollection",
"searchNavigation",
],
"requiredBundles": [
"kibanaReact",
]
Copy link
Member

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.

Suggested change
"requiredPlugins": [
"licensing",
"features",
],
"optionalPlugins": [
"cloud",
"console",
"usageCollection",
"searchNavigation",
],
"requiredBundles": [
"kibanaReact",
]
"requiredPlugins": [
"features"
],
"optionalPlugins": [
"searchNavigation"
],
"requiredBundles": [
"kibanaReact"
]

Copy link
Member Author

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/plugins/search_synonyms/public/types.ts Outdated Show resolved Hide resolved
x-pack/plugins/search_synonyms/public/types.ts Outdated Show resolved Hide resolved
@efegurkan efegurkan requested a review from azasypkin January 2, 2025 16:13
@efegurkan efegurkan disabled auto-merge January 2, 2025 16:14
Copy link
Member

@azasypkin azasypkin left a 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!

@efegurkan
Copy link
Member Author

My pleasure <3

@efegurkan efegurkan enabled auto-merge (squash) January 6, 2025 10:13
@efegurkan
Copy link
Member Author

@elasticmachine merge upstream

@efegurkan efegurkan merged commit e542fd2 into elastic:main Jan 6, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #60 / serverless observability UI Dataset Quality Dataset quality summary shows poor, degraded and good count as 0 and all dataset as healthy

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
searchSynonyms - 7 +7

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
searchSynonyms - 5 +5

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.6MB 2.6MB +297.0B
searchSynonyms - 790.0B +790.0B
total +1.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
searchSynonyms - 3.8KB +3.8KB
serverlessSearch 22.8KB 22.9KB +150.0B
total +3.9KB
Unknown metric groups

API count

id before after diff
searchSynonyms - 5 +5

async chunk count

id before after diff
searchSynonyms - 1 +1

ESLint disabled line counts

id before after diff
searchSynonyms - 3 +3

Total ESLint disabled count

id before after diff
searchSynonyms - 3 +3

History

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 203284

Questions ?

Please refer to the Backport tool documentation

kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Jan 7, 2025
## 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]>
@efegurkan
Copy link
Member Author

💚 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

@efegurkan
Copy link
Member Author

💚 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

efegurkan added a commit that referenced this pull request Jan 8, 2025
# 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-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:EnterpriseSearch v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants