So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do.
Fork this repository on GitHub, and clone locally with git clone
.
You will need to install node.js, nvm, and yarn in your environment to properly pull down dependencies to build and bootstrap the plugin.
-
Download OpenSearch for the version that matches the OpenSearch Dashboard version specified in package.json.
-
Download and install the appropriate OpenSearch ML Commons plugin.
-
Download the OpenSearch-Dashboards source code for the version specified in package.json you want to set up.
See the OpenSearch Dashboards developer guide for more instructions on setting up your development environment.
-
Change your node version to the version specified in
.node-version
inside the OpenSearch-Dashboards root directory. -
cd into the
plugins
directory of the OpenSearch-Dashboards source code directory. -
Check out this package from version control into the
plugins
directory. -
Set
assistant.chat.enabled
totrue
inopensearch_dashboards.yml
if you want to enable the chat feature. -
Run
yarn osd bootstrap
insideOpensearch-Dashboards/plugins/dashboards-assistant
.
Ultimately, your directory structure should look like this:
.
├── OpenSearch-Dashboards
│ └── plugins
│ └── dashboards-assistant
To build the plugin's distributable zip simply run yarn build
.
Example output: ./build/assistantDashboards-2.11.0.zip
-
yarn start
- Starts OpenSearch-Dashboards and includes this plugin. OpenSearch-Dashboards will be available on
localhost:5601
. - Please run in the OpenSearch-Dashboards root directory
- You must have OpenSearch running with the ML Commons plugin
- Starts OpenSearch-Dashboards and includes this plugin. OpenSearch-Dashboards will be available on
There are unit/stubbed integration tests.
-
yarn test
- Runs the plugin unit tests.
This codebase uses Prettier as our code formatter. All new code that is added has to be reformatted using the Prettier version listed in package.json
. In order to keep consistent formatting across the project developers should only use the prettier CLI to reformat their code using the following command:
yarn lint --fix
NOTE: There also exists prettier plugins on several editors that allow for automatic reformatting on saving the file. However using this is discouraged as you must ensure that the plugin uses the correct version of prettier (listed in
package.json
) before using such a plugin.