Skip to content

[Code] migrate Code config/logging/feature service to new platform#46664

Merged
mw-ding merged 12 commits intoelastic:masterfrom
mw-ding:np-migration-backend
Oct 3, 2019
Merged

[Code] migrate Code config/logging/feature service to new platform#46664
mw-ding merged 12 commits intoelastic:masterfrom
mw-ding:np-migration-backend

Conversation

@mw-ding
Copy link
Contributor

@mw-ding mw-ding commented Sep 26, 2019

Summary

Finish the config, logging and feature service items in https://github.com/elastic/code/issues/1596

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@elasticmachine
Copy link
Contributor

Pinging @elastic/code

@elasticmachine
Copy link
Contributor

💔 Build Failed

@mw-ding mw-ding requested a review from joshdover September 27, 2019 20:05
@elasticmachine
Copy link
Contributor

💔 Build Failed

@mw-ding mw-ding requested a review from mshustov September 27, 2019 22:18
@elasticmachine
Copy link
Contributor

💔 Build Failed

@mw-ding mw-ding added v7.5.0 v8.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Sep 27, 2019
@mw-ding mw-ding changed the title [Code] code backend NP migration [Code] migrate Code config and logging service to new platform Sep 27, 2019
@mw-ding mw-ding marked this pull request as ready for review September 27, 2019 23:12
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

Choose a reason for hiding this comment

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

optional: as a common convention we don't import legacy platform in the new platform, but we encourage to do the other way around. can we move some definitions to the new platform plugin and import them from legacy platform?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a TODO here. These paths anyway will break when moving all the plugins here. The error will enforce the update or the path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see my previous comment regarding this issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see the problem that we have to pass LoggerFactory down the tree. Hopefully, we can improve this in #39695

Copy link
Contributor Author

@mw-ding mw-ding left a comment

Choose a reason for hiding this comment

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

@restrry another question here is how to access the shared config like path.data

https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/code/server/server_options.ts#L41

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a TODO here. These paths anyway will break when moving all the plugins here. The error will enforce the update or the path.

@mw-ding
Copy link
Contributor Author

mw-ding commented Sep 30, 2019

@restrry another question here is how to access the shared config like path.data

https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/code/server/server_options.ts#L41

chatted with @joshdover offline that for the shared config item like path.data, I will leave them as they are right now and migrate the way to access the config later.

@elasticmachine
Copy link
Contributor

💔 Build Failed

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 leave the enabled flag in both here and the config in the new place with default value true. However, the code app is disabled by default without puting xpack.code.enabled in the kibana.yml. Any idea on how to fix this? @restrry @joshdover

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use? enabled: Joi.boolean().default(false)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

why do we want to have false by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

the code app is disabled by default

because it's disabled by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So this is how it works now. We keep Code enabled on master and 7.x, but disabled on the release branch. Even in the release branch, we set the xpack.code.ui.enabled to false to disable, but still keep xpack.code.enabled to be true.

Copy link
Contributor

Choose a reason for hiding this comment

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

We keep Code enabled on master and 7.x, but disabled on the release branch

how do you achieve that? changing default values in legacy platform config?

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine

This comment has been minimized.

Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to add a comment to revisit after #41990
The issue already has a high priority

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this comment is intended for the same purpose

Copy link
Contributor

Choose a reason for hiding this comment

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

LspOptions typings are not full. there is no info about available languages and typings are broken due to https://github.com/elastic/kibana/pull/46664/files#r329619654

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a legacy issue for the LspOptions specifically. I will defer to @spacedragon to fix this later. In short, I think let's focus more on the major NP service migration in this PR.

@mw-ding mw-ding changed the title [Code] migrate Code config and logging service to new platform [Code] migrate Code config/logging/feature service to new platform Oct 2, 2019
@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@mw-ding
Copy link
Contributor Author

mw-ding commented Oct 2, 2019

cc @fantapsody @spacedragon @zfy0701 to be aware of the config service change.

@mw-ding mw-ding requested a review from mshustov October 2, 2019 20:11
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@mshustov mshustov left a comment

Choose a reason for hiding this comment

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

let's disable the app by default to keep the current behaviour and feel free to merge after

@mw-ding mw-ding merged commit 8bdb20a into elastic:master Oct 3, 2019
mw-ding added a commit that referenced this pull request Oct 3, 2019
…46664) (#47253)

* [Code] code backend NP migration

* Move code plugin config to NP config service

* Move code plugin logger to NP logger service

* minor type error

* remove joi config

* addressing comments

* fix unit tests

* Migrate to xpack feature service for NP

* minor comments

* fix code mocha test scripts

* fix type

* fix i18nrc.json for code
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 v7.5.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants