diff --git a/.github/workflows/dashboards-reports-test-and-build-workflow.yml b/.github/workflows/dashboards-reports-test-and-build-workflow.yml index 45afba29..bb70b0eb 100644 --- a/.github/workflows/dashboards-reports-test-and-build-workflow.yml +++ b/.github/workflows/dashboards-reports-test-and-build-workflow.yml @@ -6,7 +6,7 @@ env: PLUGIN_NAME: reportsDashboards ARTIFACT_NAME: reports-dashboards OPENSEARCH_VERSION: '1.3' - OPENSEARCH_PLUGIN_VERSION: 1.3.4.0 + OPENSEARCH_PLUGIN_VERSION: 1.3.7.0 jobs: build: diff --git a/.github/workflows/draft-release-notes-workflow.yml b/.github/workflows/draft-release-notes-workflow.yml index 23ff3682..e2d8bca5 100644 --- a/.github/workflows/draft-release-notes-workflow.yml +++ b/.github/workflows/draft-release-notes-workflow.yml @@ -16,6 +16,6 @@ jobs: with: config-name: draft-release-notes-config.yml tag: (None) - version: 1.3.4.0 + version: 1.3.7.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/reports-scheduler-test-and-build-workflow.yml b/.github/workflows/reports-scheduler-test-and-build-workflow.yml index d8a7f862..ba1ca593 100644 --- a/.github/workflows/reports-scheduler-test-and-build-workflow.yml +++ b/.github/workflows/reports-scheduler-test-and-build-workflow.yml @@ -3,7 +3,7 @@ name: Test and Build Reports Scheduler on: [push, pull_request] env: - OPENSEARCH_VERSION: '1.3.4-SNAPSHOT' + OPENSEARCH_VERSION: '1.3.5-SNAPSHOT' jobs: build: @@ -31,7 +31,6 @@ jobs: echo "Running backwards compatibility tests ..." ./gradlew bwcTestSuite - - name: Build with Gradle run: | cd reports-scheduler diff --git a/dashboards-reports/opensearch_dashboards.json b/dashboards-reports/opensearch_dashboards.json index 28820b8d..a8f72359 100644 --- a/dashboards-reports/opensearch_dashboards.json +++ b/dashboards-reports/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "reportsDashboards", - "version": "1.3.4.0", - "opensearchDashboardsVersion": "1.3.4", + "version": "1.3.7.0", + "opensearchDashboardsVersion": "1.3.7", "requiredPlugins": ["navigation", "data", "opensearchDashboardsUtils"], "optionalPlugins": ["share"], "server": true, diff --git a/dashboards-reports/package.json b/dashboards-reports/package.json index 47fbf630..fa4b4245 100644 --- a/dashboards-reports/package.json +++ b/dashboards-reports/package.json @@ -1,6 +1,6 @@ { "name": "reports-dashboards", - "version": "1.3.4.0", + "version": "1.3.7.0", "description": "OpenSearch Dashboards Reports Plugin", "license": "Apache-2.0", "main": "index.ts", @@ -45,7 +45,6 @@ "@types/enzyme-adapter-react-16": "^1.0.6", "@types/jsdom": "^16.2.3", "@types/puppeteer-core": "^5.4.0", - "@types/react": "^16.9.36", "@types/react-addons-test-utils": "^0.14.25", "@types/react-dom": "^16.9.8", "@types/react-test-renderer": "^16.9.1", diff --git a/dashboards-reports/yarn.lock b/dashboards-reports/yarn.lock index a210507f..d5e1278f 100644 --- a/dashboards-reports/yarn.lock +++ b/dashboards-reports/yarn.lock @@ -696,7 +696,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^16.9.36": +"@types/react@*": version "16.9.49" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.49.tgz#09db021cf8089aba0cdb12a49f8021a69cce4872" integrity sha512-DtLFjSj0OYAdVLBbyjhuV9CdGVHCkHn2R+xr3XkBvK2rS1Y1tkc14XSGjYgm5Fjjr90AxH9tiSzc1pCFMGO06g== diff --git a/reports-scheduler/build.gradle b/reports-scheduler/build.gradle index 017fe1a6..13a90fd0 100644 --- a/reports-scheduler/build.gradle +++ b/reports-scheduler/build.gradle @@ -10,7 +10,7 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask buildscript { ext { opensearch_group = "org.opensearch" - opensearch_version = System.getProperty("opensearch.version", "1.3.4-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "1.3.7-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) @@ -241,6 +241,8 @@ Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin"); integTest.dependsOn(bundle) integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))} +String jobSchedulerURL = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_version.replace("-SNAPSHOT", "") + "/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-job-scheduler-" + opensearch_build.replace("-SNAPSHOT", "") + ".zip" + testClusters.integTest { testDistribution = "INTEG_TEST" // need to install job-scheduler first, need to assemble job-scheduler first @@ -250,6 +252,14 @@ testClusters.integTest { return new RegularFile() { @Override File getAsFile() { + File dir = new File("src/test/resources/job-scheduler") + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-job-scheduler-" + opensearch_build + ".zip") + if (!file.exists()) { + new URL(jobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } return fileTree("src/test/resources/job-scheduler").getSingleFile() } } @@ -271,16 +281,18 @@ testClusters.integTest { setting 'path.repo', repo.absolutePath } -// For job-scheduler and reports-scheduler, the latest opendistro releases appear to be 1.13.0.0. -String bwcVersion = "1.13.0.0" +// For job-scheduler and reports-scheduler, the latest opensearch releases appear to be 1.1.0.0. +String bwcVersion = "1.1.0.0" String baseName = "reportsSchedulerBwcCluster" String bwcFilePath = "src/test/resources/bwc" +String bwcJobSchedulerURL = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/opensearch-job-scheduler-1.1.0.0.zip" +String bwcReportsSchedulerURL = "https://ci.opensearch.org/ci/dbc/bundle-build/1.1.0/20210930/linux/x64/builds/opensearch/plugins/opensearch-reports-scheduler-1.1.0.0.zip" 2.times {i -> testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2","1.3.4-SNAPSHOT"] + versions = ["1.1.0", opensearch_version] numberOfNodes = 3 plugin(provider(new Callable(){ @Override @@ -288,6 +300,14 @@ String bwcFilePath = "src/test/resources/bwc" return new RegularFile() { @Override File getAsFile() { + File dir = new File(bwcFilePath + "/job-scheduler/" + bwcVersion) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-job-scheduler-" + bwcVersion + ".zip") + if (!file.exists()) { + new URL(bwcJobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } return fileTree(bwcFilePath + "/job-scheduler/" + bwcVersion).getSingleFile() } } @@ -299,6 +319,14 @@ String bwcFilePath = "src/test/resources/bwc" return new RegularFile() { @Override File getAsFile() { + File dir = new File(bwcFilePath + "/reports-scheduler/" + bwcVersion) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-reports-scheduler-" + bwcVersion + ".zip") + if (!file.exists()) { + new URL(bwcReportsSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } return fileTree(bwcFilePath + "/reports-scheduler/" + bwcVersion).getSingleFile() } } @@ -323,6 +351,14 @@ task prepareBwcTests { return new RegularFile() { @Override File getAsFile() { + File dir = new File(bwcFilePath + "/job-scheduler/" + project.version) + if (!dir.exists()) { + dir.mkdirs() + } + File file = new File(dir, "opensearch-reports-scheduler-" + project.version + ".zip") + if (!file.exists()) { + new URL(jobSchedulerURL).withInputStream{ ins -> file.withOutputStream{ it << ins }} + } return fileTree(bwcFilePath + "/job-scheduler/" + project.version).getSingleFile() } } diff --git a/reports-scheduler/scripts/build.sh b/reports-scheduler/scripts/build.sh new file mode 100755 index 00000000..5cf85406 --- /dev/null +++ b/reports-scheduler/scripts/build.sh @@ -0,0 +1,79 @@ +#!/bin/bash + +# 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. + +set -ex + +function usage() { + echo "Usage: $0 [args]" + echo "" + echo "Arguments:" + echo -e "-v VERSION\t[Required] OpenSearch version." + echo -e "-q QUALIFIER\t[Optional] Version qualifier." + echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'." + echo -e "-p PLATFORM\t[Optional] Platform, ignored." + echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored." + echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'." + echo -e "-h help" +} + +while getopts ":h:v:q:s:o:p:a:" arg; do + case $arg in + h) + usage + exit 1 + ;; + v) + VERSION=$OPTARG + ;; + q) + QUALIFIER=$OPTARG + ;; + s) + SNAPSHOT=$OPTARG + ;; + o) + OUTPUT=$OPTARG + ;; + p) + PLATFORM=$OPTARG + ;; + a) + ARCHITECTURE=$OPTARG + ;; + :) + echo "Error: -${OPTARG} requires an argument" + usage + exit 1 + ;; + ?) + echo "Invalid option: -${arg}" + exit 1 + ;; + esac +done + +if [ -z "$VERSION" ]; then + echo "Error: You must specify the OpenSearch version" + usage + exit 1 +fi + +[[ ! -z "$QUALIFIER" ]] && VERSION=$VERSION-$QUALIFIER +[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT +[ -z "$OUTPUT" ] && OUTPUT=artifacts + +mkdir -p $OUTPUT + +./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER + +zipPath=$(find . -path \*build/distributions/*.zip) +distributions="$(dirname "${zipPath}")" + +echo "COPY ${distributions}/*.zip" +mkdir -p $OUTPUT/plugins +cp ${distributions}/*.zip ./$OUTPUT/plugins diff --git a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt index c37a396f..78605ff6 100644 --- a/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt +++ b/reports-scheduler/src/test/kotlin/org/opensearch/integTest/bwc/ReportsSchedulerBackwardsCompatibilityIT.kt @@ -50,8 +50,8 @@ class ReportsSchedulerBackwardsCompatibilityIT : PluginRestTestCase() { val pluginNames = plugins.map { plugin -> plugin["name"] }.toSet() when (CLUSTER_TYPE) { ClusterType.OLD -> { - assertTrue(pluginNames.contains("opendistro-reports-scheduler")) - assertTrue(pluginNames.contains("opendistro-job-scheduler")) + assertTrue(pluginNames.contains("opensearch-reports-scheduler")) + assertTrue(pluginNames.contains("opensearch-job-scheduler")) createBasicReportDefinition() } ClusterType.MIXED -> { diff --git a/reports-scheduler/src/test/resources/bwc/job-scheduler/.gitignore b/reports-scheduler/src/test/resources/bwc/job-scheduler/.gitignore new file mode 100644 index 00000000..99f6ad50 --- /dev/null +++ b/reports-scheduler/src/test/resources/bwc/job-scheduler/.gitignore @@ -0,0 +1,4 @@ +# ignore artifacts in this directory +* +*/ +!.gitignore diff --git a/reports-scheduler/src/test/resources/bwc/reports-scheduler/.gitignore b/reports-scheduler/src/test/resources/bwc/reports-scheduler/.gitignore new file mode 100644 index 00000000..99f6ad50 --- /dev/null +++ b/reports-scheduler/src/test/resources/bwc/reports-scheduler/.gitignore @@ -0,0 +1,4 @@ +# ignore artifacts in this directory +* +*/ +!.gitignore diff --git a/reports-scheduler/src/test/resources/job-scheduler/.gitignore b/reports-scheduler/src/test/resources/job-scheduler/.gitignore new file mode 100644 index 00000000..99f6ad50 --- /dev/null +++ b/reports-scheduler/src/test/resources/job-scheduler/.gitignore @@ -0,0 +1,4 @@ +# ignore artifacts in this directory +* +*/ +!.gitignore diff --git a/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.3.4.0-SNAPSHOT.zip b/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.3.4.0-SNAPSHOT.zip deleted file mode 100644 index e222cea8..00000000 Binary files a/reports-scheduler/src/test/resources/job-scheduler/opensearch-job-scheduler-1.3.4.0-SNAPSHOT.zip and /dev/null differ