Skip to content

Commit

Permalink
Merge branch '2.x' into backport/backport-208-to-2.x
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Wei <[email protected]>
  • Loading branch information
mengweieric authored Nov 6, 2023
2 parents 104a0f8 + 13bcce9 commit 9d4a719
Show file tree
Hide file tree
Showing 12 changed files with 222 additions and 395 deletions.
127 changes: 0 additions & 127 deletions .github/workflows/dashboards-reports-release-workflow.yml

This file was deleted.

59 changes: 28 additions & 31 deletions .github/workflows/dashboards-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,45 @@ env:


jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch-dashboards

linux-build:
needs: Get-CI-Image-Tag
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
repository: opensearch-project/Opensearch-Dashboards
ref: ${{ env.OPENSEARCH_VERSION }}
path: OpenSearch-Dashboards

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '../OpenSearch-Dashboards/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Install Yarn
# Need to use bash to avoid having a windows/linux specific step
shell: bash
run: |
YARN_VERSION=$(node -p "require('../OpenSearch-Dashboards/package.json').engines.yarn")
echo "Installing yarn@$YARN_VERSION"
npm i -g yarn@$YARN_VERSION
- run: node -v
- run: yarn -v

- name: Checkout Plugin
uses: actions/checkout@v1
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: yarn osd bootstrap

- name: Test
- name: OpenSearch Dashboards Plugin Bootstrap and test
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: yarn test --coverage
command: |
chown -R 1000:1000 `pwd`
cd ./OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/${{ env.PLUGIN_NAME }} &&
whoami && yarn osd bootstrap && yarn test --coverage"
- name: Upload coverage
uses: codecov/codecov-action@v1
Expand All @@ -65,14 +59,17 @@ jobs:

- name: Build Artifact
run: |
yarn build
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
chown -R 1000:1000 `pwd`
cd ./OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/${{ env.PLUGIN_NAME }} &&
whoami && yarn build && mv -v ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip"
- name: Upload Artifact For Linux
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-linux
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
path: ./OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

windows-build:
runs-on: windows-latest
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "reportsDashboards",
"version": "2.11.0.0",
"opensearchDashboardsVersion": "2.11.0",
"version": "2.12.0.0",
"opensearchDashboardsVersion": "2.12.0",
"requiredPlugins": [
"navigation",
"data",
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reports-dashboards",
"version": "2.11.0.0",
"version": "2.12.0.0",
"description": "OpenSearch Dashboards Reports Plugin",
"license": "Apache-2.0",
"main": "index.ts",
Expand Down Expand Up @@ -83,6 +83,8 @@
"tough-cookie": "^4.1.3",
"semver": "^7.5.2",
"word-wrap": "^1.2.4",
"@cypress/request": "^3.0.0"
"@cypress/request": "^3.0.0",
"@babel/traverse": "^7.23.2",
"debug": "^4.3.4"
}
}
2 changes: 1 addition & 1 deletion public/components/context_menu/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const checkURLParams = async () => {

const isDiscoverNavMenu = (navMenu) => {
return (
navMenu[0].children.length === 6 &&
navMenu[0].children.length === 5 &&
($('[data-test-subj="breadcrumb first"]').prop('title') === 'Discover' ||
$('[data-test-subj="breadcrumb first last"]').prop('title') ===
'Discover')
Expand Down
5 changes: 3 additions & 2 deletions public/components/context_menu/context_menu_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import {
} from './context_menu_ui';
import { timeRangeMatcher } from '../utils/utils';
import { unhashUrl } from '../../../../../src/plugins/opensearch_dashboards_utils/public';
import { PLUGIN_ID } from '../../../common';
import { applicationService } from '../utils/application_service';

const getReportSourceURL = (baseURI) => {
const url = baseURI.substr(0, baseURI.indexOf('?'));
const reportSourceId = url.substr(url.lastIndexOf('/') + 1, url.length);
return reportSourceId;
};

export const contextMenuViewReports = () =>
window.location.assign('reports-dashboards#/');
export const contextMenuViewReports = () => applicationService.getApplication().navigateToApp(PLUGIN_ID);

export const getTimeFieldsFromUrl = () => {
const url = unhashUrl(window.location.href);
Expand Down
15 changes: 15 additions & 0 deletions public/components/utils/application_service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { ApplicationStart} from '../../../../../src/core/public';

let application: ApplicationStart

export const applicationService = {
init: (applicationStart: ApplicationStart) => {
application = applicationStart
},
getApplication: () => application,
};
2 changes: 2 additions & 0 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { i18n } from '@osd/i18n';
import './components/context_menu/context_menu';
import { PLUGIN_ID, PLUGIN_NAME } from '../common';
import { uiSettingsService } from './components/utils/settings_service';
import { applicationService } from './components/utils/application_service';

export class ReportsDashboardsPlugin
implements Plugin<ReportsDashboardsPluginSetup, ReportsDashboardsPluginStart>
Expand Down Expand Up @@ -57,6 +58,7 @@ export class ReportsDashboardsPlugin
}

public start(core: CoreStart): ReportsDashboardsPluginStart {
applicationService.init(core.application);
return {};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Version 2.11.0.0 Release Notes

Compatible with OpenSearch and OpenSearch Dashboards Version 2.11.0

### Features

* Enable Reporting for new OSD Discover module ([#184](https://github.com/opensearch-project/dashboards-reporting/pull/184)) ([#190](https://github.com/opensearch-project/dashboards-reporting/pull/190)) ([#212](https://github.com/opensearch-project/dashboards-reporting/pull/212))

### Bug Fixes

* fix date-format in csv export ([#148](https://github.com/opensearch-project/dashboards-reporting/pull/148)) ([#211](https://github.com/opensearch-project/dashboards-reporting/pull/211))

### Maintenance

* upgrade debug and other deps ([#208](https://github.com/opensearch-project/dashboards-reporting/pull/208))
Loading

0 comments on commit 9d4a719

Please sign in to comment.