Skip to content

Commit 1cc931c

Browse files
authored
Merge pull request #6 from opensearch-project/opensearch/workbench
Migrate workbench to OpenSearch Dashboards
2 parents 13c022a + eb0b464 commit 1cc931c

23 files changed

+120
-2231
lines changed

.github/workflows/sql-workbench-release-workflow.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- 'v*'
77

88
env:
9-
PLUGIN_NAME: opendistroQueryWorkbenchKibana
10-
OD_VERSION: 1.13.0.0
9+
PLUGIN_NAME: queryWorkbenchDashboards
10+
OD_VERSION: 1.15.0.0
1111

1212
jobs:
1313

@@ -27,13 +27,13 @@ jobs:
2727
- name: Checkout Plugin
2828
uses: actions/checkout@v1
2929

30-
- name: Checkout Kibana
30+
- name: Checkout OpenSearch Dashboards
3131
uses: actions/checkout@v1
3232
with:
33-
repository: opendistro-for-elasticsearch/kibana-oss
34-
ref: 7.10.2
33+
repository: opensearch-project/Opensearch-Dashboards
34+
ref: 1.x
3535
token: ${{secrets.OD_ACCESS}}
36-
path: sql/kibana
36+
path: sql/OpenSearch-Dashboards
3737

3838
- name: Setup Node
3939
uses: actions/setup-node@v1
@@ -42,25 +42,25 @@ jobs:
4242

4343
- name: Move Workbench to Plugins Dir
4444
run: |
45-
mv workbench kibana/plugins
45+
mv workbench OpenSearch-Dashboards/plugins
4646
47-
- name: Kibana Plugin Bootstrap
47+
- name: OpenSearch Dashboards Plugin Bootstrap
4848
uses: nick-invision/retry@v1
4949
with:
5050
timeout_minutes: 60
5151
max_attempts: 3
52-
command: cd kibana/plugins/workbench; yarn kbn bootstrap
52+
command: cd OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap
5353

5454
- name: Build
5555
run: |
56-
cd kibana/plugins/workbench
56+
cd OpenSearch-Dashboards/plugins/workbench
5757
yarn build
5858
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
5959
6060
- name: Upload to S3
6161
shell: bash
6262
run: |
63-
cd kibana/plugins/workbench
63+
cd OpenSearch-Dashboards/plugins/workbench
6464
zip=`ls ./build/*.zip`
6565
6666
# Inject the build number before the suffix

.github/workflows/sql-workbench-test-and-build-workflow.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: SQL Workbench Test and Build
33
on: [pull_request, push]
44

55
env:
6-
PLUGIN_NAME: opendistroQueryWorkbenchKibana
7-
OD_VERSION: 1.13.0.0
6+
PLUGIN_NAME: queryWorkbenchDashboards
7+
OD_VERSION: 1.15.0.0
88

99
jobs:
1010

@@ -15,36 +15,36 @@ jobs:
1515
steps:
1616
- name: Checkout Plugin
1717
uses: actions/checkout@v1
18-
- name: Checkout Kibana
18+
- name: Checkout OpenSearch Dashboards
1919
uses: actions/checkout@v1
2020
with:
21-
repository: elastic/kibana
22-
ref: v7.10.2
23-
path: sql/kibana
21+
repository: opensearch-project/Opensearch-Dashboards
22+
ref: 1.x
23+
path: sql/OpenSearch-Dashboards
2424
- name: Setup Node
2525
uses: actions/setup-node@v1
2626
with:
2727
node-version: '10.23.1'
2828
- name: Move Workbench to Plugins Dir
2929
run: |
30-
mv workbench kibana/plugins
31-
- name: Kibana Plugin Bootstrap
30+
mv workbench OpenSearch-Dashboards/plugins
31+
- name: OpenSearch Dashboards Plugin Bootstrap
3232
uses: nick-invision/retry@v1
3333
with:
3434
timeout_minutes: 60
3535
max_attempts: 3
36-
command: cd kibana/plugins/workbench; yarn kbn bootstrap
36+
command: cd OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap
3737
- name: Test
3838
run: |
39-
cd kibana/plugins/workbench
39+
cd OpenSearch-Dashboards/plugins/workbench
4040
yarn test:jest
4141
- name: Build Artifact
4242
run: |
43-
cd kibana/plugins/workbench
43+
cd OpenSearch-Dashboards/plugins/workbench
4444
yarn build
4545
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
4646
- name: Upload Artifact
4747
uses: actions/upload-artifact@v1
4848
with:
4949
name: workbench
50-
path: kibana/plugins/workbench/build
50+
path: OpenSearch-Dashboards/plugins/workbench/build

workbench/.cypress/integration/ui.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ describe('Test and verify SQL downloads', () => {
169169
url: url,
170170
headers: {
171171
'content-type': 'application/json;charset=UTF-8',
172-
'kbn-version': '7.10.2',
172+
'osd-version': '7.10.2',
173173
},
174174
body: {
175175
'query': 'select * from accounts where balance > 49500'

workbench/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ information to effectively respond to your bug report or contribution.
1111

1212
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1313

14-
When filing an issue, please check [existing open](https://github.com/opendistro-for-elasticsearch/sql/issues?q=is%3Aissue+is%3Aclosed+label%3AWorkbench), or [recently closed](https://github.com/opendistro-for-elasticsearch/sql/issues?q=is%3Aissue+is%3Aclosed+label%3AWorkbench), issues to make sure somebody else hasn't already
14+
When filing an issue, please check [existing open](https://github.com/opensearch-project/sql/issues?q=is%3Aissue+is%3Aopen+workbench), or [recently closed](https://github.com/opensearch-project/sql/issues?q=is%3Aissue+workbench+is%3Aclosed+), issues to make sure somebody else hasn't already
1515
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616

1717
* A reproducible test case or series of steps

workbench/NOTICE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Open Distro for Elasticsearch SQL Kibana Plugin
1+
OpenSearch Dashboards SQL Plugin
22
Copyright 2018-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.

workbench/README.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Open Distro for Elasticsearch Query Workbench
1+
# OpenSearch Dashboards Query Workbench
22

3-
The Open Distro for Elasticsearch Query Workbench enables you to query your Elasticsearch data using either SQL or PPL syntax from a dedicated Kibana UI. You can download your query results data in JSON, JDBC, CSV and raw text formats.
3+
The OpenSearch Dashboards Query Workbench enables you to query your OpenSearch data using either SQL or PPL syntax from a dedicated OpenSearch Dashboards UI. You can download your query results data in JSON, JDBC, CSV and raw text formats.
44

55

66
## Documentation
@@ -10,29 +10,29 @@ Please see our technical [documentation](https://opendistro.github.io/for-elasti
1010

1111
## Setup
1212

13-
1. Download Elasticsearch for the version that matches the [Kibana version specified in package.json](./package.json#L8).
14-
1. Download and install the most recent version of [Open Distro for Elasticsearch SQL plugin](https://github.com/opendistro-for-elasticsearch/sql).
15-
1. Download the Kibana source code for the [version specified in package.json](./package.json#L8) you want to set up.
13+
1. Download OpenSearch for the version that matches the [OpenSearch Dashboards version specified in package.json](./package.json#L8).
14+
1. Download and install the most recent version of [OpenSearch SQL plugin](https://github.com/opensearch-project/sql#open-distro-for-elasticsearch-sql).
15+
1. Download the OpenSearch Dashboards source code for the [version specified in package.json](./package.json#L8) you want to set up.
1616

17-
See the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) for more instructions on setting up your development environment.
17+
See the [OpenSearch Dashboards contributing guide](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/CONTRIBUTING.md) to get started.
1818

19-
1. Change your node version to the version specified in `.node-version` inside the Kibana root directory.
20-
1. cd into the Kibana source code directory.
19+
1. Change your node version to the version specified in `.node-version` inside the OpenSearch Dashboards root directory.
20+
1. cd into the OpenSearch Dashboards source code directory.
2121
1. Check out this package from version control into the `plugins` directory.
2222
```
23-
git clone [email protected]:opendistro-for-elasticsearch/sql.git plugins --no-checkout
23+
git clone [email protected]:opensearch-project/sql.git plugins --no-checkout
2424
cd plugins
2525
echo 'workbench/*' >> .git/info/sparse-checkout
2626
git config core.sparseCheckout true
27-
git checkout master
27+
git checkout main
2828
```
29-
6. Run `yarn kbn bootstrap` inside `kibana/plugins/workbench`.
29+
6. Run `yarn osd bootstrap` inside `OpenSearch-Dashboards/plugins/workbench`.
3030

3131
Ultimately, your directory structure should look like this:
3232

3333
```md
3434
.
35-
├── kibana
35+
├── OpenSearch-Dashboards
3636
│ └── plugins
3737
│ └── workbench
3838
```
@@ -49,21 +49,21 @@ Example output: `./build/opendistro-query-workbench-*.zip`
4949

5050
- `yarn start`
5151

52-
Starts Kibana and includes this plugin. Kibana will be available on `localhost:5601`.
52+
Starts OpenSearch Dashboards and includes this plugin. OpenSearch Dashboards will be available on `localhost:5601`.
5353

5454
- `NODE_PATH=../../node_modules yarn test:jest`
5555

5656
Runs the plugin tests.
5757

5858

59-
## Contributing to Open Distro for Elasticsearch Query Workbench
59+
## Contributing to OpenSearch SQL Workbench
6060

6161
- Refer to [CONTRIBUTING.md](./CONTRIBUTING.md).
62-
- Since this is a workbench, it can be useful to review the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) alongside the documentation around [workbenchs](https://www.elastic.co/guide/en/kibana/master/kibana-plugins.html) and [plugin development](https://www.elastic.co/guide/en/kibana/master/plugin-development.html).
62+
- We welcome you to get involved in development, documentation, testing the OpenSearch SQL Workbench plugin. See our [CONTRIBUTING.md](./CONTRIBUTING.md) and join in.
6363

6464
## Bugs, Enhancements or Questions
6565

66-
Please file an issue to report any bugs you may find, enhancements you may need or questions you may have [here](https://github.com/opendistro-for-elasticsearch/sql/issues).
66+
Please file an issue to report any bugs you may find, enhancements you may need or questions you may have [here](https://github.com/opensearch-project/sql/issues).
6767

6868
## License
6969

workbench/kibana.json

-9
This file was deleted.

workbench/opensearch_dashboards.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"id": "queryWorkbenchDashboards",
3+
"version": "1.15.0.0",
4+
"opensearchDashboardsVersion": "7.10.2",
5+
"server": true,
6+
"ui": true,
7+
"requiredPlugins": ["navigation"],
8+
"optionalPlugins": []
9+
}

workbench/package.json

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
{
22
"name": "opendistro-query-workbench",
3-
"version": "1.13.0.0",
3+
"version": "1.15.0.0",
44
"description": "Query Workbench",
55
"main": "index.js",
66
"license": "Apache-2.0",
7-
"homepage": "https://github.com/opendistro-for-elasticsearch/sql/tree/master/workbench",
8-
"kibana": {
7+
"homepage": "https://github.com/opensearch-project/sql/tree/main/workbench",
8+
"opensearchDashboards": {
99
"version": "7.10.2",
1010
"templateVersion": "6.3.3"
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "https://github.com/opendistro-for-elasticsearch/sql/tree/master/workbench"
14+
"url": "https://github.com/opensearch-project/sql/tree/main/workbench"
1515
},
1616
"scripts": {
17-
"kbn": "node ../../scripts/kbn",
17+
"osd": "node ../../scripts/osd",
18+
"opensearch": "node ../../scripts/opensearch",
1819
"lint": "tslint .",
1920
"start": "plugin-helpers start",
2021
"test:server": "plugin-helpers test:server",
@@ -28,7 +29,6 @@
2829
"react-double-scrollbar": "^0.0.15"
2930
},
3031
"devDependencies": {
31-
"@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana",
3232
"@types/hapi-latest": "npm:@types/[email protected]",
3333
"@types/react-router-dom": "^5.1.5",
3434
"cypress": "^5.0.0",
@@ -57,8 +57,6 @@
5757
"**/@types/react-dom": "^16.0.5",
5858
"**/@types/react-router-dom": "^4.3.1",
5959
"eslint-utils": "^2.0.0",
60-
"**/@types/react": "16.3.14",
61-
"lodash": "^4.17.21",
62-
"ssri": "8.0.1"
60+
"**/@types/react": "16.3.14"
6361
}
6462
}

workbench/public/components/Main/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
Tree,
3030
} from '../../utils/utils';
3131
import { MESSAGE_TAB_LABEL } from '../../utils/constants';
32-
import { CoreStart } from 'kibana/public';
32+
import { CoreStart } from '../../../../../src/core/public';
3333

3434
interface ResponseData {
3535
ok: boolean;

workbench/public/components/app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
import React from 'react';
17-
import { I18nProvider } from '@kbn/i18n/react';
17+
import { I18nProvider } from '@osd/i18n/react';
1818
import { BrowserRouter as Router, Route } from 'react-router-dom';
1919

2020
import { EuiPage, EuiPageBody } from '@elastic/eui';

workbench/public/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import './index.scss';
1818
import { WorkbenchPlugin } from './plugin';
1919

2020
// This exports static code and TypeScript types,
21-
// as well as, Kibana Platform `plugin()` initializer.
21+
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.
2222
export function plugin() {
2323
return new WorkbenchPlugin();
2424
}

workbench/public/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ export class WorkbenchPlugin implements Plugin<WorkbenchPluginSetup, WorkbenchPl
2525
title: PLUGIN_NAME,
2626
category: {
2727
id: 'odfe',
28-
label: 'Open Distro for Elasticsearch',
28+
label: 'OpenSearch',
2929
order: 2000,
3030
},
3131
order: 1000,
3232
async mount(params: AppMountParameters) {
3333
// Load application bundle
3434
const { renderApp } = await import('./application');
35-
// Get start services as specified in kibana.json
35+
// Get start services as specified in opensearch_dashboards.json
3636
const [coreStart, depsStart] = await core.getStartServices();
3737
// Render the application
3838
return renderApp(coreStart, depsStart as AppPluginStartDependencies, params);

workbench/server/clusters/sql/createSqlCluster.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import sqlPlugin from './sqlPlugin';
1717
import { CLUSTER, DEFAULT_HEADERS } from '../../services/utils/constants';
1818

1919
export default function createSqlCluster(server) {
20-
const { customHeaders, ...rest } = server.config().get('elasticsearch');
21-
server.plugins.elasticsearch.createCluster(
20+
const { customHeaders, ...rest } = server.config().get('opensearch');
21+
server.plugins.opensearch.createCluster(
2222
CLUSTER.SQL,
2323
{
2424
plugins: [ sqlPlugin ],

workbench/server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { PluginInitializerContext } from '../../../src/core/server';
1717
import { WorkbenchPlugin } from './plugin';
1818

1919
// This exports static code and TypeScript types,
20-
// as well as, Kibana Platform `plugin()` initializer.
20+
// as well as, OpenSearch Dashboards Platform `plugin()` initializer.
2121

2222
export function plugin(initializerContext: PluginInitializerContext) {
2323
return new WorkbenchPlugin(initializerContext);

workbench/server/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424

2525
import { WorkbenchPluginSetup, WorkbenchPluginStart } from './types';
2626
import defineRoutes from './routes';
27-
import sqlPlugin from './clusters/sql/sqlPlugin';
27+
import sqlPlugin from './clusters/sql/sqlPlugin';
2828

2929

3030
export class WorkbenchPlugin implements Plugin<WorkbenchPluginSetup, WorkbenchPluginStart> {
@@ -37,7 +37,7 @@ export class WorkbenchPlugin implements Plugin<WorkbenchPluginSetup, WorkbenchPl
3737
public setup(core: CoreSetup) {
3838
this.logger.debug('opendistroQueryWorkbench: Setup');
3939
const router = core.http.createRouter();
40-
const client: ILegacyClusterClient = core.elasticsearch.legacy.createClient(
40+
const client: ILegacyClusterClient = core.opensearch.legacy.createClient(
4141
'query_workbench',
4242
{
4343
plugins: [sqlPlugin]

0 commit comments

Comments
 (0)