Skip to content

Latest commit

 

History

History
71 lines (45 loc) · 2.92 KB

DEVELOPER_GUIDE.md

File metadata and controls

71 lines (45 loc) · 2.92 KB

Developer guide

So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do.

Forking and Cloning

Fork this repository on GitHub, and clone locally with git clone.

Install Prerequisites

You will need to install node.js, nvm, and yarn in your environment to properly pull down dependencies to build and bootstrap the plugin.

Environment Setup

  1. Download OpenSearch for the version that matches the OpenSearch Dashboards version specified in package.json.

  2. Download and install the appropriate Anomaly Detection OpenSearch Plugin.

  3. Download the OpenSearch Dashboards source code for the version specified in package.json you want to set up.

    See the OpenSearch Dashboards contributing guide and developer guide for more instructions on setting up your development environment.

  4. Change your node version to the version specified in .node-version inside the OpenSearch Dashboards root directory (this can be done with the nvm use command).

  5. Create a plugins directory inside the OpenSearch Dashboards source code directory, if plugins directory doesn't exist.

  6. Check out this package from version control into the plugins directory.

  7. Run yarn osd bootstrap inside OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin.

Ultimately, your directory structure should look like this:

.
├── OpenSearch-Dashboards
│   └──plugins
│      └── anomaly-detection-dashboards-plugin

Build

To build the plugin's distributable zip simply run yarn build.

Example output: ./build/anomaly-detection-dashboards-1.0.0.0.zip

Run

In the base OpenSearch Dashboards directory, run

  • yarn start --no-base-path

    Starts OpenSearch Dashboards and includes this plugin. OpenSearch Dashboards will be available on localhost:5601.

Test

  • yarn test:jest

    Runs the plugin unit tests.

  • yarn test:e2e

    Start OpenSearch Dashboards, wait for it to be available on localhost:5601, and runs end-to-end tests.

  • yarn cy:run

    Runs end-to-end tests on a currently running OpenSearch Dashboards server. Defaults to run the tests on localhost:5601, although you can change this to run on any OpenSearch Dashboards server with the command yarn cy:run --config baseUrl=<your-custom-URL>