So you want to contribute code to this project? Excellent! We're glad you're here. Here's what you need to do.
- Git clone OpenSearch-Dashboard for the version that matches the version you want to use OpenSearch-Dashboards
- Change your node version to the version specified in
.node-versioninside the OpenSearch Dashboards root directory. (using nvm can help for that) - Change directory into
OpenSearch-Dashboardsand git clone dashboards-search-relevance into theplugins/directory. - Run
yarn osd bootstrapinsideOpenSearch-Dashboards.
Ultimately, your directory structure should look like this:
.
├── OpenSearch-Dashboards
│ └── plugins
│ └── dashboards-search-relevanceTo build the plugin's distributable zip simply run yarn build.
The output file : ./build/searchRelevanceDashboards-?.?.?.zip (?.?.? stands for the version number)
Cd back to OpenSearch-Dashboards directory and run yarn start to start OpenSearch Dashboards including this plugin. OpenSearch Dashboards will be available on localhost:5601.
See CONTRIBUTING.
Integration tests live in the opensearch-dashboards-functional-test repo under cypress/integration/plugins/search-relevance-dashboards/. These are the same tests triggered by the CI workflow in .github/workflows/remote-integ-tests-workflow.yml.
Before submitting a PR, ensure all integration tests pass locally:
- Start OpenSearch and OpenSearch Dashboards (with the plugin installed) on
localhost:5601. - From the
opensearch-dashboards-functional-testrepo, run:
yarn cypress:run-without-security --config "baseUrl=http://localhost:5601" --spec "cypress/integration/plugins/search-relevance-dashboards/*.js"All tests must pass before merging.
The Github workflow in backport.yml creates backport PRs automatically when the original PR
with an appropriate label backport <backport-branch-name> is merged to main with the backport workflow run successfully on the
PR. For example, if a PR on main needs to be backported to 1.x branch, add a label backport 1.x to the PR and make sure the
backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR
to the 1.x branch.
This plugin comes with some dashboards that are installed into OpenSearch Dashboards as Saved Objects.
To update the default dashboards that ship with the plugin, you need to export the raw dashboards and patterns as JSON and update the file ./public/components/common_utils/dashboards_data.ts that holds the data.
You need to pick from the export tool each of the top level items.
This is the current list of Dashboards that ship with SRW:
- Variants Comparison
- Experiment Deep Dive
- Pointwise Daily Scheduled Runs
This is the index pattern that ship with SRW:
- search-relevance-evaluation-result*
Once you have exported the data you can convert it to the escaped version that we store in the const escapedDashboardsData using the below sed command:
Escape quotes using: sed 's/\\/\\\\/g' export.ndjson > escaped_output.txt