Skip to content

Commit

Permalink
Merge branch 'opensearch-project:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mengweieric authored Sep 26, 2023
2 parents 3da4593 + 6efa950 commit 0e0dd49
Show file tree
Hide file tree
Showing 66 changed files with 7,031 additions and 791 deletions.
20 changes: 20 additions & 0 deletions .cypress/integration/10_datasources.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

/// <reference types="cypress" />

const moveToDatasourcesHome = () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/dataconnections`);
};

describe('Basic sanity test for datasources plugin', () => {
it('Navigates to datasources plugin and expects the correct header', () => {
moveToDatasourcesHome();
cy.get('[data-test-subj="dataconnections-header"]').should('exist');
});
});



36 changes: 21 additions & 15 deletions .github/workflows/integration-tests-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Dashboards observability plugin E2E test
on: [pull_request, push]
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
PLUGIN_NAME: dashboards-observability
OPENSEARCH_DASHBOARDS_VERSION: 'main'
Expand Down Expand Up @@ -34,14 +37,18 @@ jobs:
java-version: '11'

- name: Download observability artifact
uses: peternied/download-file@v2
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.OPENSEARCH_VERSION }}/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-observability-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-observability&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip
target: plugin-artifacts/
filename: observability.zip

- name: Download SQL artifact
uses: peternied/download-file@v2
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${{ env.OPENSEARCH_VERSION }}/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-sql-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
url: https://aws.oss.sonatype.org/service/local/artifact/maven/redirect?r=snapshots&g=org.opensearch.plugin&a=opensearch-sql-plugin&v=${{ env.OPENSEARCH_PLUGIN_VERSION }}-SNAPSHOT&p=zip
target: plugin-artifacts/
filename: sql.zip

- name: Download OpenSearch
uses: peternied/download-file@v2
Expand All @@ -56,23 +63,18 @@ jobs:

- name: Install observability plugin
run: |
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch-plugin install file:$(pwd)/opensearch-observability-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip"
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch-plugin install file:$(pwd)/plugin-artifacts/observability.zip"
shell: bash

- name: Install linux SQL plugin
- name: Install SQL plugin
run: |
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch-plugin install file:$(pwd)/opensearch-sql-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip"
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch-plugin install file:$(pwd)/plugin-artifacts/sql.zip"
shell: bash

- name: Run OpenSearch
run: /bin/bash -c "./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/bin/opensearch &"
shell: bash

- name: Sleep while OpenSearch starts
uses: peternied/action-sleep@v1
with:
seconds: 30

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v2
with:
Expand All @@ -85,11 +87,15 @@ jobs:
with:
path: OpenSearch-Dashboards/plugins/dashboards-observability

# While bootstrap requires node >= 16.14.0, OSD hasn't yet updated their version number in
# package.json, so we need to hardcode it for now. When it's fixed, this line can dynamically
# pull the value:
# $(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")
- name: Get node and yarn versions
working-directory: ${{ env.WORKING_DIR }}
id: versions_step
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=node_version::16"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
- name: Setup node
Expand All @@ -113,7 +119,7 @@ jobs:
run: |
cd OpenSearch-Dashboards
yarn start --no-base-path --no-watch &
sleep 400
sleep 200
- name: Install Cypress
run: |
Expand Down
10 changes: 10 additions & 0 deletions common/constants/data_connections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const OPENSEARCH_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/data-connections/index';

export const QUERY_RESTRICTED = 'query-restricted';
export const QUERY_ALL = 'query-all';
11 changes: 10 additions & 1 deletion common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const DSL_CAT = '/cat.indices';
export const DSL_MAPPING = '/indices.getFieldMapping';
export const OBSERVABILITY_BASE = '/api/observability';
export const INTEGRATIONS_BASE = '/api/integrations';
export const DATACONNECTIONS_BASE = '/api/dataconnections';
export const EVENT_ANALYTICS = '/event_analytics';
export const SAVED_OBJECTS = '/saved_objects';
export const SAVED_QUERY = '/query';
Expand All @@ -23,6 +24,7 @@ export const SAVED_VISUALIZATION = '/vis';
export const PPL_ENDPOINT = '/_plugins/_ppl';
export const SQL_ENDPOINT = '/_plugins/_sql';
export const DSL_ENDPOINT = '/_plugins/_dsl';
export const DATACONNECTIONS_ENDPOINT = '/_plugins/_query/_datasources';

export const observabilityID = 'observability-logs';
export const observabilityTitle = 'Observability';
Expand Down Expand Up @@ -56,6 +58,10 @@ export const observabilityIntegrationsID = 'integrations';
export const observabilityIntegrationsTitle = 'Integrations';
export const observabilityIntegrationsPluginOrder = 9020;

export const observabilityDataConnectionsID = 'dataconnections';
export const observabilityDataConnectionsTitle = 'Data Connections';
export const observabilityDataConnectionsPluginOrder = 9030;

// Shared Constants
export const SQL_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/search-plugins/sql/index/';
export const PPL_DOCUMENTATION_URL =
Expand All @@ -74,10 +80,13 @@ export const PPL_NEWLINE_REGEX = /[\n\r]+/g;

// Observability plugin URI
const BASE_OBSERVABILITY_URI = '/_plugins/_observability';
const BASE_INTEGRATIONS_URI = '/_plugins/_integrations'; // Used later in front-end for routing
const BASE_DATACONNECTIONS_URI = '/_plugins/_query/_datasources';
export const OPENSEARCH_PANELS_API = {
OBJECT: `${BASE_OBSERVABILITY_URI}/object`,
};
export const OPENSEARCH_DATACONNECTIONS_API = {
DATACONNECTION: `${BASE_DATACONNECTIONS_URI}`,
};

// Saved Objects
export const SAVED_OBJECT = '/object';
Expand Down
10 changes: 10 additions & 0 deletions common/types/data_connections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export interface PermissionsConfigurationProps {
roles: Array<{ label: string }>;
selectedRoles: Array<{ label: string }>;
setSelectedRoles: React.Dispatch<React.SetStateAction<Array<{ label: string }>>>;
}
20 changes: 20 additions & 0 deletions common/types/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,3 +381,23 @@ export interface VisSpecificMetaData {
x_coordinate: string;
y_coordinate: string;
}

export type MOMENT_UNIT_OF_TIME =
| 'years'
| 'y'
| 'quarters'
| 'Q'
| 'months'
| 'M'
| 'weeks'
| 'w'
| 'days'
| 'd'
| 'hours'
| 'h'
| 'minutes'
| 'm'
| 'seconds'
| 's'
| 'milliseconds'
| 'ms';
5 changes: 3 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"uiActions",
"urlForwarding",
"visualizations"
]
}
],
"optionalPlugins": ["managementOverview"]
}
2 changes: 2 additions & 0 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { EventAnalytics } from './event_analytics';
import { Home as MetricsHome } from './metrics/index';
import { Main as NotebooksHome } from './notebooks/components/main';
import { Home as TraceAnalyticsHome } from './trace_analytics/home';
import { Home as DataConnectionsHome } from './data_connections/home';

interface ObservabilityAppDeps {
CoreStartProp: CoreStart;
Expand All @@ -44,6 +45,7 @@ const pages = {
notebooks: NotebooksHome,
dashboards: CustomPanelsHome,
integrations: IntegrationsHome,
dataconnections: DataConnectionsHome,
};

export const App = ({
Expand Down
Loading

0 comments on commit 0e0dd49

Please sign in to comment.