diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index 5aa5201d..d3d00bf8 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -3,9 +3,10 @@ name: Test and Build Reports Scheduler on: [push, pull_request] env: - OPENSEARCH_VERSION: '1.0.0' - COMMON_UTILS_VERSION: '1.0' - JOB_SCHEDULER_VERSION: '1.0' + OPENSEARCH_VERSION: '1.1.0-SNAPSHOT' + OPENSEARCH_BRANCH: '1.x' + COMMON_UTILS_BRANCH: 'main' + JOB_SCHEDULER_BRANCH: 'main' jobs: build: @@ -23,17 +24,17 @@ jobs: with: repository: 'opensearch-project/OpenSearch' path: OpenSearch - ref: ${{ env.OPENSEARCH_VERSION }} + ref: ${{ env.OPENSEARCH_BRANCH }} - name: Build OpenSearch working-directory: ./OpenSearch - run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false + run: ./gradlew publishToMavenLocal # dependencies: common-utils - name: Checkout common-utils uses: actions/checkout@v2 with: repository: 'opensearch-project/common-utils' - ref: ${{ env.COMMON_UTILS_VERSION }} + ref: ${{ env.COMMON_UTILS_BRANCH }} path: common-utils - name: Build common-utils working-directory: ./common-utils @@ -44,11 +45,11 @@ jobs: uses: actions/checkout@v2 with: repository: 'opensearch-project/job-scheduler' - ref: ${{ env.JOB_SCHEDULER_VERSION }} + ref: ${{ env.JOB_SCHEDULER_BRANCH }} path: job-scheduler - name: Build job-scheduler working-directory: ./job-scheduler - run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} -Dbuild.snapshot=false + run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} # reports-scheduler - name: Checkout Reports Scheduler diff --git a/dashboards-reports/opensearch_dashboards.json b/dashboards-reports/opensearch_dashboards.json index 8dae5038..b746bd64 100644 --- a/dashboards-reports/opensearch_dashboards.json +++ b/dashboards-reports/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "reportsDashboards", - "version": "1.0.1.0", - "opensearchDashboardsVersion": "1.0.0", + "version": "1.1.0.0", + "opensearchDashboardsVersion": "1.1.0", "requiredPlugins": ["navigation", "data", "opensearchDashboardsUtils"], "optionalPlugins": ["share"], "server": true, diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 800bf860..06e8eb1e 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -1,11 +1,11 @@ { "name": "reports-dashboards", - "version": "1.0.1.0", + "version": "1.1.0.0", "description": "OpenSearch Dashboards Reports Plugin", "license": "Apache-2.0", "main": "index.ts", "opensearchDashboards": { - "version": "1.0.0", + "version": "1.1.0", "templateVersion": "1.0.0" }, "scripts": { diff --git a/dashboards-reports/public/components/context_menu/context_menu.js b/dashboards-reports/public/components/context_menu/context_menu.js index 52fa76bc..109a3d17 100644 --- a/dashboards-reports/public/components/context_menu/context_menu.js +++ b/dashboards-reports/public/components/context_menu/context_menu.js @@ -66,11 +66,11 @@ const generateInContextReport = async ( } let reportSource = ''; - if (baseUrl.includes('dashboard')) { + if (/\/app\/dashboards/.test(baseUrl)) { reportSource = 'Dashboard'; - } else if (baseUrl.includes('visualize')) { + } else if (/\/app\/visualize/.test(baseUrl)) { reportSource = 'Visualization'; - } else if (baseUrl.includes('discover')) { + } else if (/\/app\/discover/.test(baseUrl)) { reportSource = 'Saved search'; } diff --git a/dashboards-reports/public/components/context_menu/context_menu_helpers.js b/dashboards-reports/public/components/context_menu/context_menu_helpers.js index abd828c7..1c89007b 100644 --- a/dashboards-reports/public/components/context_menu/context_menu_helpers.js +++ b/dashboards-reports/public/components/context_menu/context_menu_helpers.js @@ -71,11 +71,11 @@ export const contextMenuCreateReportDefinition = (baseURI) => { const timeRanges = getTimeFieldsFromUrl(); // check report source - if (baseURI.includes('dashboard')) { + if (/\/app\/dashboards/.test(baseURI)) { reportSource = 'dashboard:'; - } else if (baseURI.includes('visualize')) { + } else if (/\/app\/visualize/.test(baseURI)) { reportSource = 'visualize:'; - } else if (baseURI.includes('discover')) { + } else if (/\/app\/discover/.test(baseURI)) { reportSource = 'discover:'; } reportSource += reportSourceId.toString(); diff --git a/dashboards-reports/server/utils/validationHelper.ts b/dashboards-reports/server/utils/validationHelper.ts index b0aa38fa..705c8cd0 100644 --- a/dashboards-reports/server/utils/validationHelper.ts +++ b/dashboards-reports/server/utils/validationHelper.ts @@ -55,7 +55,7 @@ export const isValidRelativeUrl = (relativeUrl: string) => { export const regexDuration = /^(-?)P(?=\d|T\d)(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)([DW]))?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+(?:\.\d+)?)S)?)?$/; export const regexEmailAddress = /\S+@\S+\.\S+/; export const regexReportName = /^[\w\-\s\(\)\[\]\,\_\-+]+$/; -export const regexRelativeUrl = /^\/(_dashboards\/app|app)\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/; +export const regexRelativeUrl = /^\/(_plugin\/kibana\/|_dashboards\/)?app\/(dashboards|visualize|discover|notebooks-dashboards\?view=output_only)([?&]security_tenant=.+|)#\/(view\/|edit\/)?[^\/]+$/; export const validateReport = async ( client: ILegacyScopedClusterClient, diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index f1d457d5..9ff0b036 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -30,10 +30,12 @@ import java.util.concurrent.Callable buildscript { ext { opensearch_group = "org.opensearch" - opensearch_version = System.getProperty("opensearch.version", "1.0.0") + opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT") + // 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT + opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2') + common_utils_version = System.getProperty("common_utils.version", opensearch_build) + job_scheduler_version = System.getProperty("job_scheduler.version", opensearch_build) kotlin_version = System.getProperty("kotlin.version", "1.4.0") - common_utils_version = "1.0.0.0" - job_scheduler_version = "1.0.0.0" } repositories { @@ -109,11 +111,6 @@ ext { licenseFile = rootProject.file('LICENSE.txt') noticeFile = rootProject.file('NOTICE.txt') isSnapshot = "true" == System.getProperty("build.snapshot", "true") - opensearchVersion = "${version}.0" -} - -if (isSnapshot) { - version += "-SNAPSHOT" } plugins.withId('java') { @@ -126,7 +123,10 @@ plugins.withId('org.jetbrains.kotlin.jvm') { allprojects { group = "org.opensearch" - version = "${opensearchVersion}" + version = "${opensearch_version}" - "-SNAPSHOT" + ".0" + if (isSnapshot) { + version += "-SNAPSHOT" + } plugins.withId('java') { sourceCompatibility = targetCompatibility = "1.8" } diff --git a/reports-scheduler/gradle.properties b/reports-scheduler/gradle.properties deleted file mode 100644 index a9141c94..00000000 --- a/reports-scheduler/gradle.properties +++ /dev/null @@ -1,28 +0,0 @@ -## -# SPDX-License-Identifier: Apache-2.0 -# -# The OpenSearch Contributors require contributions made to -# this file be licensed under the Apache-2.0 license or a -# compatible open source license. -# -# Modifications Copyright OpenSearch Contributors. See -# GitHub history for details. -## - -## -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). -# You may not use this file except in compliance with the License. -# A copy of the License is located at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# or in the "license" file accompanying this file. This file is distributed -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either -# express or implied. See the License for the specific language governing -# permissions and limitations under the License. -# -## - -version = 1.0.0 diff --git a/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.0.0.0-SNAPSHOT.zip b/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.0.0.0-SNAPSHOT.zip deleted file mode 100644 index a8b822cf..00000000 Binary files a/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.0.0.0-SNAPSHOT.zip and /dev/null differ diff --git a/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.1.0.0-SNAPSHOT.zip b/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.1.0.0-SNAPSHOT.zip new file mode 100644 index 00000000..285f4424 Binary files /dev/null and b/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.1.0.0-SNAPSHOT.zip differ