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

[Canvas] Move workpad api routes to New Platform #51116

Merged
merged 7 commits into from
Nov 26, 2019

Conversation

crob611
Copy link
Contributor

@crob611 crob611 commented Nov 19, 2019

Summary

This PR creates the Canvas plugin that will be loaded via the New Platform.

Also adds all of the routes for the workpads api to this new plugin and removes them from the canvas legacy plugin. Important note here is this also adds validation to all of the params or bodys of those requests, so please test whatever ways you can think of that these routes might be called to ensure they are never called in an incorrect way with params that will fail validation.

Summarize your PR. If it involves visual changes include a screenshot or gif.

Checklist

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

For maintainers

@crob611 crob611 added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.0.0 release_note:skip Skip the PR/issue when compiling release notes impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Feature:NP Migration v7.6.0 labels Nov 19, 2019
@crob611 crob611 requested a review from a team as a code owner November 19, 2019 20:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas (Team:Canvas)

@crob611 crob611 requested a review from joshdover November 19, 2019 20:57
Copy link
Contributor

@joshdover joshdover left a comment

Choose a reason for hiding this comment

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

Since you already have a server-side shim, any reason not to keep these routes in that shimmed plugin (but still using the New Platform router)?

By keeping it in the shimmed legacy plugin you'll be able to move the entire legacy server code over at once which may make the final migration step a bit easier.

}

public stop() {
this.initializerContext.logger.get().debug('Stopping Canvas plugin');
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, Core already logs messages for each plugin lifecycle method, so these may be superfluous.

*/

import sinon from 'sinon';
import Sinon from 'sinon';
Copy link
Contributor

Choose a reason for hiding this comment

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

Two sinons?

statusCode: error.output.statusCode,
});
}
return response.badRequest({ body: error });
Copy link
Contributor

Choose a reason for hiding this comment

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

If it's an unexpected error, I think we should use response.internalError for a 500 error.

*/

import sinon from 'sinon';
import Sinon from 'sinon';
Copy link
Contributor

Choose a reason for hiding this comment

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

More double sinons :)

/**
* Represents Code Plugin instance that will be managed by the Kibana plugin system.
*/
export class CanvasPlugin {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should import and implement the Plugin interface from src/core/server here.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@crob611 crob611 added the review label Nov 25, 2019
Copy link
Contributor

@poffdeluxe poffdeluxe left a comment

Choose a reason for hiding this comment

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

lgtm -- tested on sample workpad data and it worked great

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@crob611 crob611 merged commit f529629 into elastic:master Nov 26, 2019
crob611 pushed a commit to crob611/kibana that referenced this pull request Dec 5, 2019
* Move workpad api routes to New Platform

* Cleanup

* Clean up/Pr Feedback

* Adding missing dependency to tests

* Fix typecheck

* Loosen workpad schema restrictions
crob611 pushed a commit that referenced this pull request Dec 6, 2019
* Move workpad api routes to New Platform

* Cleanup

* Clean up/Pr Feedback

* Adding missing dependency to tests

* Fix typecheck

* Loosen workpad schema restrictions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. release_note:skip Skip the PR/issue when compiling release notes review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants