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

Change workbench version to 1.0.0, change api to _opensearch #17

Merged
merged 4 commits into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/sql-workbench-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
PLUGIN_NAME: queryWorkbenchDashboards
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:

Expand All @@ -31,8 +31,7 @@ jobs:
uses: actions/checkout@v1
with:
repository: opensearch-project/Opensearch-Dashboards
ref: 1.x
token: ${{secrets.OD_ACCESS}}
ref: main
path: sql/OpenSearch-Dashboards

- name: Setup Node
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/sql-workbench-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [pull_request, push]

env:
PLUGIN_NAME: queryWorkbenchDashboards
OD_VERSION: 1.15.0.0
OD_VERSION: 1.0.0.0

jobs:

Expand All @@ -15,34 +15,41 @@ jobs:
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
repository: opensearch-project/Opensearch-Dashboards
ref: 1.x
ref: main
path: sql/OpenSearch-Dashboards

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.23.1'

- name: Move Workbench to Plugins Dir
run: |
mv workbench OpenSearch-Dashboards/plugins

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 60
max_attempts: 3
command: cd OpenSearch-Dashboards/plugins/workbench; yarn osd bootstrap

- name: Test
run: |
cd OpenSearch-Dashboards/plugins/workbench
yarn test:jest

- name: Build Artifact
run: |
cd OpenSearch-Dashboards/plugins/workbench
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip

- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions workbench/.cypress/integration/ui.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ describe('Test and verify SQL downloads', () => {
url: url,
headers: {
'content-type': 'application/json;charset=UTF-8',
'osd-version': '7.10.2',
'osd-xsrf': true,
},
body: {
'query': 'select * from accounts where balance > 49500'
}
}).then((response) => {
if (title === 'Download and verify CSV') {
if (title === 'Download and verify CSV' || title === 'Download and verify Text') {
expect(response.body.data.body).to.have.string(files[file]);
}
else {
Expand Down
18 changes: 9 additions & 9 deletions workbench/.cypress/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ export const files = {
803,Marissa,963 Highland Avenue,49567,M,Bloomington,Centregy,MS,25,[email protected],Spears
248,West,717 Hendrickson Place,49989,M,Maury,Obliq,WA,36,[email protected],England`,
TextFile:
`842|Meagan|F|Craig|49587|Biospan|TX|[email protected]|833 Bushwick Court|Buckner|23
854|Jimenez|F|Moscow|49795|Verton|AL|jimenezbarry@verton.com|603 Cooper Street|Barry|25
97|Karen|F|Fredericktown|49671|Tsunamia|MO|karentrujillo@tsunamia.com|512 Cumberland Walk|Trujillo|40
168|Carissa|M|Neibert|49568|Zillacom|IL|carissasimon@zillacom.com|975 Flatbush Avenue|Simon|20
240|Oconnor|F|Kilbourne|49741|Franscene|NH|oconnorclay@franscene.com|659 Highland Boulevard|Clay|35
803|Marissa|M|Bloomington|49567|Centregy|MS|marissaspears@centregy.com|963 Highland Avenue|Spears|25
248|West|M|Maury|49989|Obliq|WA|westengland@obliq.com|717 Hendrickson Place|England|36
`,
};
`account_number|firstname|address|balance|gender|city|employer|state|age|email|lastname
842|Meagan|833 Bushwick Court|49587|F|Craig|Biospan|TX|23|meaganbuckner@biospan.com|Buckner
854|Jimenez|603 Cooper Street|49795|F|Moscow|Verton|AL|25|jimenezbarry@verton.com|Barry
97|Karen|512 Cumberland Walk|49671|F|Fredericktown|Tsunamia|MO|40|karentrujillo@tsunamia.com|Trujillo
168|Carissa|975 Flatbush Avenue|49568|M|Neibert|Zillacom|IL|20|carissasimon@zillacom.com|Simon
240|Oconnor|659 Highland Boulevard|49741|F|Kilbourne|Franscene|NH|35|oconnorclay@franscene.com|Clay
803|Marissa|963 Highland Avenue|49567|M|Bloomington|Centregy|MS|25|marissaspears@centregy.com|Spears
248|West|717 Hendrickson Place|49989|M|Maury|Obliq|WA|36|[email protected]|England`,
};
4 changes: 2 additions & 2 deletions workbench/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "queryWorkbenchDashboards",
"version": "1.15.0.0",
"opensearchDashboardsVersion": "7.10.2",
"version": "1.0.0.0",
"opensearchDashboardsVersion": "1.0.0",
"server": true,
"ui": true,
"requiredPlugins": ["navigation"],
Expand Down
6 changes: 3 additions & 3 deletions workbench/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "opensearch-query-workbench",
"version": "1.15.0.0",
"version": "1.0.0.0",
"description": "Query Workbench",
"main": "index.js",
"license": "Apache-2.0",
"homepage": "https://github.com/opensearch-project/sql/tree/main/workbench",
"opensearchDashboards": {
"version": "7.10.2",
"version": "1.0.0",
"templateVersion": "6.3.3"
},
"repository": {
Expand Down Expand Up @@ -59,4 +59,4 @@
"eslint-utils": "^2.0.0",
"**/@types/react": "16.3.14"
}
}
}
2 changes: 1 addition & 1 deletion workbench/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class WorkbenchPlugin implements Plugin<WorkbenchPluginSetup, WorkbenchPl
title: PLUGIN_NAME,
category: {
id: 'odfe',
label: 'OpenSearch',
label: 'OpenSearch Plugins',
order: 2000,
},
order: 1000,
Expand Down
10 changes: 5 additions & 5 deletions workbench/server/services/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@

import { ParsedUrlQuery } from 'querystring';

export const SQL_TRANSLATE_ROUTE = `/_opendistro/_sql/_explain`;
export const PPL_TRANSLATE_ROUTE = `/_opendistro/_ppl/_explain`;
export const SQL_QUERY_ROUTE = `/_opendistro/_sql`;
export const PPL_QUERY_ROUTE = `/_opendistro/_ppl`;
export const SQL_TRANSLATE_ROUTE = `/_opensearch/_sql/_explain`;
export const PPL_TRANSLATE_ROUTE = `/_opensearch/_ppl/_explain`;
export const SQL_QUERY_ROUTE = `/_opensearch/_sql`;
export const PPL_QUERY_ROUTE = `/_opensearch/_ppl`;
export const FORMAT_CSV = `format=csv`;
export const FORMAT_JSON = `format=json`;
export const FORMAT_TEXT = `format=raw`;
Expand All @@ -42,6 +42,6 @@ export const DEFAULT_HEADERS = {

export const CLUSTER = {
ADMIN: 'admin',
SQL: 'opendistro_sql',
SQL: 'opensearch-sql',
DATA: 'data',
};