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

IDM: Migrates kbn_server to a dev-only package #145785

Merged

Conversation

TinaHeiligers
Copy link
Contributor

fix #145193

Migrates core/server/test-helpers/kbn_server to a package
Updates imports across repo

Checklist

Delete any items that are not applicable to this PR.

@TinaHeiligers TinaHeiligers added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.7.0 labels Nov 19, 2022
@TinaHeiligers TinaHeiligers force-pushed the kbn-145193-core-kbn_server-as-package branch from 13eb625 to 0ea735c Compare November 19, 2022 02:03
@TinaHeiligers TinaHeiligers marked this pull request as ready for review November 19, 2022 17:45
@TinaHeiligers TinaHeiligers requested review from a team as code owners November 19, 2022 17:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Nov 19, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@@ -10,7 +10,12 @@ import Path from 'path';
import { range } from 'lodash';

import type { ISavedObjectsRepository } from '@kbn/core/server';
import * as kbnTestServer from '@kbn/core/test_helpers/kbn_server';
import type { TestElasticsearchUtils, createRoot } from '@kbn/core-test-helpers-kbn-server';
Copy link
Contributor Author

@TinaHeiligers TinaHeiligers Nov 20, 2022

Choose a reason for hiding this comment

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

@elastic/fleet I split the imports out into separate methods and/or types after migrating the kbn_server utilities to a package.

@@ -8,10 +8,11 @@
import Boom from '@hapi/boom';

// @ts-ignore
import type { createRoot } from '@kbn/core-test-helpers-kbn-server';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elastic/kibana-security I split the imports out into separate methods and/or types after migrating the kbn_server utilities to a package.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could technically also have done this to the same effect:

import {
  type createRoot,
  request as kbnTestServerRequest
} from '@kbn/core-test-helpers-kbn-server';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. Done

Comment on lines 9 to 10
import type { createRoot } from '@kbn/core-test-helpers-kbn-server';
import { request } from '@kbn/core-test-helpers-kbn-server';
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing here if you like:

Suggested change
import type { createRoot } from '@kbn/core-test-helpers-kbn-server';
import { request } from '@kbn/core-test-helpers-kbn-server';
import { type createRoot, request } from '@kbn/core-test-helpers-kbn-server';

Copy link
Contributor

@watson watson left a comment

Choose a reason for hiding this comment

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

Kibana Platform Security changes LGTM 👍

I added a few comments about how to combine the imports into one, but it's not important

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Fleet changes 🚀

@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@rshen91 rshen91 left a comment

Choose a reason for hiding this comment

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

Changes LGTM! thanks for migrating!

@TinaHeiligers
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 16 to 17
import type { TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server';
import { createTestServers } from '@kbn/core-test-helpers-kbn-server';
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: (multiple occurrences)

import { createTestServers, type TestElasticsearchUtils } from '@kbn/core-test-helpers-kbn-server';

@TinaHeiligers TinaHeiligers enabled auto-merge (squash) November 23, 2022 19:49
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

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/core-test-helpers-kbn-server - 46 +46

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/core-test-helpers-kbn-server - 1 +1

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
@kbn/config 8 9 +1
Unknown metric groups

API count

id before after diff
@kbn/core-test-helpers-kbn-server - 52 +52

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 443 449 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 520 526 +6
total +21

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@TinaHeiligers TinaHeiligers merged commit 25c6535 into elastic:main Nov 23, 2022
tylersmalley added a commit that referenced this pull request Nov 23, 2022
tylersmalley pushed a commit that referenced this pull request Nov 23, 2022
@tylersmalley
Copy link
Contributor

Sorry @TinaHeiligers, I had to revert this - there were multiple failures due to incompatible merges

CI job on main: https://buildkite.com/elastic/kibana-on-merge/builds/24078#0184a659-17eb-4c09-ad88-440364ca64eb

main: 8e55ec5

tylersmalley pushed a commit that referenced this pull request Nov 23, 2022
tylersmalley pushed a commit that referenced this pull request Nov 24, 2022
redo of: #145785 due to failures
when it hit main resulting in a revert.

fix #145193

Migrates `core/server/test-helpers/kbn_server` to a package
Updates imports across repo

### Checklist

Delete any items that are not applicable to this PR.

- [X] [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

Co-authored-by: Christiane (Tina) Heiligers <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Fleet Team label for Observability Data Collection Fleet team v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IDM: Migrate kbn_server to packages
9 participants