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

Migrate server-side usageData service to packages #139844

Merged
merged 8 commits into from
Sep 5, 2022

Conversation

pgayvallet
Copy link
Contributor

@pgayvallet pgayvallet commented Aug 31, 2022

Summary

Fix #135840

The public type and internal base package were already created in #139305

Create the following packages:

  • @kbn/core-usage-data-server-internal
  • @kbn/core-usage-data-server-mocks

@pgayvallet pgayvallet 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 v8.5.0 labels Sep 1, 2022
Copy link
Contributor Author

@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.

self-review

*/

export { CoreUsageDataService, CoreUsageStatsClient } from './src';
export type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Re-exporting the internal contract type from the base package for consistency, given all other domains allow to import the service impl and the associated contracts from the same package.

@@ -43,7 +43,7 @@ import type { SavedObjectTypeRegistry } from '@kbn/core-saved-objects-base-serve
import type { SavedObjectsServiceStart } from '@kbn/core-saved-objects-server';

import { isConfigured } from './is_configured';
import { coreUsageStatsType } from './core_usage_stats';
import { coreUsageStatsType } from './saved_objects';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the stats SO type to a saved_objects subfolder, as that's our recommended approach

Comment on lines -75 to -79
// Because of #79265 we need to explicitly import, then export these types for
// scripts/telemetry_check.js to work as expected
import {
CoreUsageStats,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No longer required given we had to duplicate the types for #139389

@pgayvallet pgayvallet marked this pull request as ready for review September 1, 2022 05:59
@pgayvallet pgayvallet requested a review from a team as a code owner September 1, 2022 05:59
@elasticmachine
Copy link
Contributor

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

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.

LGTM! Just one tiny NIT

Comment on lines 9 to 10
export { CoreUsageDataService, CoreUsageStatsClient } from './src';
export type { InternalCoreUsageDataSetup } from '@kbn/core-usage-data-base-server-internal';
Copy link
Member

Choose a reason for hiding this comment

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

nit: external exports/imports first?

@pgayvallet pgayvallet enabled auto-merge (squash) September 5, 2022 11:12
@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-usage-data-server-internal - 8 +8
@kbn/core-usage-data-server-mocks - 7 +7
total +15

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/core-usage-data-server-internal - 2 +2
Unknown metric groups

API count

id before after diff
@kbn/core-usage-data-server-internal - 8 +8
@kbn/core-usage-data-server-mocks - 7 +7
total +15

ESLint disabled line counts

id before after diff
@kbn/core-usage-data-server-internal - 1 +1
core 20 19 -1
total -0

References to deprecated APIs

id before after diff
@kbn/core-usage-data-server-internal - 3 +3

Total ESLint disabled count

id before after diff
@kbn/core-usage-data-server-internal - 1 +1
core 22 21 -1
total -0

History

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

@pgayvallet pgayvallet merged commit 4d15bb1 into elastic:main Sep 5, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 5, 2022
Mpdreamz pushed a commit to Mpdreamz/kibana that referenced this pull request Sep 6, 2022
* create empty packages

* moving the files

* adapt usages

* fix more usages

* address NIT
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 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate core domain services to packages: Server-side CoreUsageData service
5 participants