Skip to content

[Search] Move ConnectorDefinition types and consts#197676

Merged
navarone-feekery merged 16 commits intoelastic:mainfrom
navarone-feekery:move-connector-definition
Nov 6, 2024
Merged

[Search] Move ConnectorDefinition types and consts#197676
navarone-feekery merged 16 commits intoelastic:mainfrom
navarone-feekery:move-connector-definition

Conversation

@navarone-feekery
Copy link
Contributor

@navarone-feekery navarone-feekery commented Oct 24, 2024

Summary

  • Move types and consts for ConnectorClientSideDefinition and ConnectorServerSideDefinition to the shared kbn-search-connectors package
  • Update ESS references to these values to use it from the package
  • Remove them from the connectors plugin

This is necessary to allow the improved connector flow from ESS to be usable in ES3, as the components will live in this shared package and cannot access the ConnectorDefinition types.

This PR does not change how Serverless accesses the types, which is still done through importing getConnectorTypes function from x-pack/plugins/search_connectors/common/lib/connector_types.ts, which is unchanged.
I will update serverless in another PR.

@navarone-feekery
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@sphilipse sphilipse left a comment

Choose a reason for hiding this comment

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

Overall code looks good but we probably should just rename the keys rather than delete the translations outright

@navarone-feekery
Copy link
Contributor Author

@elasticmachine merge upstream

@navarone-feekery navarone-feekery requested a review from a team as a code owner November 6, 2024 13:53
@navarone-feekery
Copy link
Contributor Author

This PR moves a lot of search-connector plugin code to a shared search-connectors package. That code has to be re-imported into search-connectors plugin, which increased the bundle size.

I tried to reduce the package size through optimizing the largest offender native_connectors.ts: 00eae12
This reduced the package size from 85KB to 65KB, but it still wasn't enough to reduce the package size to below the previous limit (30KB). In the end I also increased the limit.
Other packages are around this limit so I don't think it's a problem. If there is anything else I can optimize to fix this let me know.

@navarone-feekery navarone-feekery enabled auto-merge (squash) November 6, 2024 14:24
@navarone-feekery navarone-feekery merged commit 8ed8cc9 into elastic:main Nov 6, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.15, 8.16, 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 2317 2321 +4
searchConnectors 8 74 +66
serverlessSearch 286 290 +4
total +74

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
@kbn/search-connectors 3929 3948 +19
searchConnectors 19 7 -12
total +7

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 +2.5KB
serverlessSearch 336.3KB 338.5KB +2.3KB
total +4.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
searchConnectors 3 0 -3

Page load bundle

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

id before after diff
searchConnectors 24.5KB 61.5KB +36.9KB
Unknown metric groups

API count

id before after diff
@kbn/search-connectors 3929 3948 +19
searchConnectors 19 7 -12
total +7

History

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
## Summary

- Move types and consts for `ConnectorClientSideDefinition` and
`ConnectorServerSideDefinition` to the shared `kbn-search-connectors`
package
- Update ESS references to these values to use it from the package
- Remove them from the connectors plugin

(cherry picked from commit 8ed8cc9)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
## Summary

- Move types and consts for `ConnectorClientSideDefinition` and
`ConnectorServerSideDefinition` to the shared `kbn-search-connectors`
package
- Update ESS references to these values to use it from the package
- Remove them from the connectors plugin

(cherry picked from commit 8ed8cc9)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

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

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 197676

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 8, 2024
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

kibanamachine added a commit that referenced this pull request Nov 8, 2024
…197676) (#199167)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Search] Move `ConnectorDefinition` types and consts
(#197676)](#197676)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Navarone
Feekery","email":"13634519+navarone-feekery@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-06T15:45:22Z","message":"[Search]
Move `ConnectorDefinition` types and consts (#197676)\n\n##
Summary\r\n\r\n- Move types and consts for
`ConnectorClientSideDefinition` and\r\n`ConnectorServerSideDefinition`
to the shared `kbn-search-connectors`\r\npackage\r\n- Update ESS
references to these values to use it from the package\r\n- Remove them
from the connectors
plugin","sha":"8ed8cc964e2ec557ea7173cc8cecf17b7f69d0d3","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Search","backport:prev-major","v8.17.0"],"title":"[Search]
Move `ConnectorDefinition` types and
consts","number":197676,"url":"https://github.com/elastic/kibana/pull/197676","mergeCommit":{"message":"[Search]
Move `ConnectorDefinition` types and consts (#197676)\n\n##
Summary\r\n\r\n- Move types and consts for
`ConnectorClientSideDefinition` and\r\n`ConnectorServerSideDefinition`
to the shared `kbn-search-connectors`\r\npackage\r\n- Update ESS
references to these values to use it from the package\r\n- Remove them
from the connectors
plugin","sha":"8ed8cc964e2ec557ea7173cc8cecf17b7f69d0d3"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197676","number":197676,"mergeCommit":{"message":"[Search]
Move `ConnectorDefinition` types and consts (#197676)\n\n##
Summary\r\n\r\n- Move types and consts for
`ConnectorClientSideDefinition` and\r\n`ConnectorServerSideDefinition`
to the shared `kbn-search-connectors`\r\npackage\r\n- Update ESS
references to these values to use it from the package\r\n- Remove them
from the connectors
plugin","sha":"8ed8cc964e2ec557ea7173cc8cecf17b7f69d0d3"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Navarone Feekery <13634519+navarone-feekery@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Search v8.17.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants