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

Add ContextService to server #42395

Merged
merged 7 commits into from
Aug 6, 2019

Conversation

joshdover
Copy link
Contributor

@joshdover joshdover commented Jul 31, 2019

Summary

This ports the ContextService (#41251) over to the Server side as well. No significant differences here, though the changes to the server-side PluginsService is slightly different, due to the way the backend does plugin discovery.

I split this into two commits.

  • The first just moves the ContextContainer implementation over to the utils directory. This still doesn't feel like quite the right place, so I'm open to suggestions on this.
  • The second commit adds a ContextService to the server side and adds the PluginOpaqueId to the PluginsService.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@joshdover joshdover force-pushed the np/context-service-server branch 2 times, most recently from dfb5a90 to 0d62cd1 Compare July 31, 2019 22:26
@elasticmachine
Copy link
Contributor

💔 Build Failed

@joshdover joshdover force-pushed the np/context-service-server branch 3 times, most recently from bd171bb to 46226a6 Compare August 1, 2019 17:34
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joshdover joshdover added Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.4.0 labels Aug 1, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@joshdover joshdover requested a review from a team August 1, 2019 18:40
@joshdover joshdover marked this pull request as ready for review August 1, 2019 18:40
@joshdover joshdover added this to Code review in kibana-core [DEPRECATED] Aug 1, 2019
@joshdover joshdover added the release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. label Aug 1, 2019
Copy link
Contributor

@eliperelman eliperelman left a comment

Choose a reason for hiding this comment

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

Looks great!

src/core/public/index.ts Outdated Show resolved Hide resolved
src/core/server/plugins/types.ts Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

* mandatory JSON manifest file.
* @internal
*/
export interface PluginManifest {
Copy link
Contributor

@mshustov mshustov Aug 2, 2019

Choose a reason for hiding this comment

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

what is the main purpose of this file? as I understand it's to share types between client and server. PluginManifest exists on the server-side only, doesn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right I made it for sharing types, but I figured I'd place all types for the plugins service in here for consistency.

Copy link
Contributor

Choose a reason for hiding this comment

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

I figured I'd place all types for the plugins service in here for consistency.

ok. Although I'd rather keep them closer to the usage place. It helps us to track unused types and dependencies between different modules/files.

@@ -18,7 +18,7 @@
*/

import { ContextContainer } from './context';
import { PluginOpaqueId } from '../plugins';
import { PluginOpaqueId } from '../server';
Copy link
Contributor

@mshustov mshustov Aug 2, 2019

Choose a reason for hiding this comment

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

the problem of sharing server and client code popped up several times in this PR and in #39891
I'm wondering why we encourage domain-focus folder structure for plugins in favor of technology-focus but do not follow the same convention in the core? why not similarly structure core services?

- core
|__ context
  |__ public
  |  |__ index.ts
  |__ server
  |  |__ index.ts
  |__ common/utils/ whatever you want

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not a bad idea. It could complicate some of the bundling / building logic, but I'd be interested in exploring that (in a separate PR / issue) if it helps alleviate this problem.

Copy link
Contributor

Choose a reason for hiding this comment

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

could your create a separate issue to investigate this approach? we have to address problem of importing context from utils eventually.

src/core/server/server.ts Show resolved Hide resolved
src/core/server/context/context_service.ts Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@joshdover joshdover merged commit 5192dac into elastic:master Aug 6, 2019
kibana-core [DEPRECATED] automation moved this from Code review to Needs Backport Aug 6, 2019
@joshdover joshdover deleted the np/context-service-server branch August 6, 2019 17:24
rudolf pushed a commit that referenced this pull request Aug 6, 2019
@joshdover joshdover moved this from Needs Backport to Done (this week) in kibana-core [DEPRECATED] Aug 6, 2019
@joshdover joshdover added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. labels Sep 4, 2019
@joshdover
Copy link
Contributor Author

Removing dev_docs label to avoid duplicating the docs in #41251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform 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 v7.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants