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

Removed default integtest.sh (1.1). #159

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on: [pull_request, push]
env:
PLUGIN_NAME: reportsDashboards
ARTIFACT_NAME: reports-dashboards
OPENSEARCH_VERSION: '1.0'
OPENSEARCH_PLUGIN_VERSION: 1.0.0.0
OPENSEARCH_VERSION: '1.x'
OPENSEARCH_PLUGIN_VERSION: 1.1.0.0

jobs:
build:
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ name: Test and Build Reports Scheduler
on: [push, pull_request]

env:
OPENSEARCH_VERSION: '1.0'
COMMON_UTILS_VERSION: '1.0'
JOB_SCHEDULER_VERSION: '1.0'
OPENSEARCH_VERSION: '1.1.0-SNAPSHOT'
OPENSEARCH_BRANCH: '1.1'
COMMON_UTILS_BRANCH: 'main'
JOB_SCHEDULER_BRANCH: 'main'

jobs:
build:
Expand All @@ -23,32 +24,32 @@ 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
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

# dependencies: job-scheduler
- name: Checkout job-scheduler
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 }}.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

# reports-scheduler
- name: Checkout Reports Scheduler
Expand All @@ -57,7 +58,7 @@ jobs:
- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}.0
./gradlew build -Dopensearch.version=${{ env.OPENSEARCH_VERSION }}

- name: Upload coverage
uses: codecov/codecov-action@v1
Expand All @@ -76,4 +77,4 @@ jobs:
with:
name: reports-scheduler
path: reports-scheduler-builds

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ We welcome you to get involved in development, documentation, testing the OpenSe

## Setup & Build

Complete OpenSearch Dashboards Report feature is composed of 2 plugins. Refer to README in each plugin folder for more details.
Complete OpenSearch Dashboards Report feature is composed of 2 plugins.

- [OpenSearch Dashboards reports plugin](./dashboards-reports/README.md)
- [OpenSearch Reports scheduler plugin](./reports-scheduler/README.md)(TODO)
- OpenSearch Reports scheduler plugin

## Notifications Integration

Expand All @@ -54,7 +54,7 @@ If you discover a potential security issue in this project we ask that you notif

## License

See the [LICENSE](./LICENSE.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
See the [LICENSE](./LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

## Copyright

Expand Down
39 changes: 38 additions & 1 deletion dashboards-reports/.cypress/integration/01-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
* permissions and limitations under the License.
*/

describe('Adding sample data', () => {
it('Adds sample data', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardflights"]').contains(/(Add|View) data/).click();
cy.wait(3000);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardecommerce"]').contains(/(Add|View) data/).click();
cy.wait(3000);
cy.visit(`${Cypress.env('opensearchDashboards')}/app/home#/tutorial_directory/sampleData`);
cy.get('div[data-test-subj="sampleDataSetCardlogs"]').contains(/(Add|View) data/).click();
cy.wait(3000);
});
});

describe('Cypress', () => {
it('Visits Reporting homepage', () => {
cy.visit(`${Cypress.env('opensearchDashboards')}/app/reports-dashboards#/`);
Expand Down Expand Up @@ -59,10 +73,20 @@ describe('Cypress', () => {
cy.get('#reportSettingsDescription').type('Description for cypress test');

// select a report source
cy.get('.euiComboBox').click({ force: true });
cy.get('[data-test-subj="comboBoxInput"]').eq(0).click({ force: true });

// select drop-down option in report source list
cy.contains('[Logs] Web Traffic').click();

cy.wait(500);

// create an on-demand report definition
cy.get('#createNewReportDefinition').click({ force: true });

cy.wait(12500);

// check that re-direct to
cy.get('#reportDefinitionDetailsLink').should('exist');
});

it('Create a new scheduled report definition', () => {
Expand All @@ -80,6 +104,14 @@ describe('Cypress', () => {
// enter a report description
cy.get('#reportSettingsDescription').type('Description for cypress test');

// select a report source
cy.get('[data-test-subj="comboBoxInput"]').eq(0).click({ force: true });

// select drop-down option in report source list
cy.contains('[Logs] Web Traffic').click();

cy.wait(500);

// set report trigger to Schedule option
cy.get('[type="radio"]').check({ force: true });

Expand All @@ -88,5 +120,10 @@ describe('Cypress', () => {

// create scheduled report definition
cy.get('#createNewReportDefinition').click({ force: true });

cy.wait(12500);

// check that re-direct to
cy.get('#reportDefinitionDetailsLink').should('exist');
});
});
5 changes: 4 additions & 1 deletion dashboards-reports/cypress.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"video": false,
"video": true,
"fixturesFolder": ".cypress/fixtures",
"integrationFolder": ".cypress/integration",
"pluginsFile": ".cypress/plugins/index.js",
"screenshotsFolder": ".cypress/screenshots",
"supportFile": ".cypress/support/index.js",
"videosFolder": ".cypress/videos",
"requestTimeout": 60000,
"responseTimeout": 60000,
"defaultCommandTimeout": 60000,
"env": {
"opensearch": "localhost:9200",
"opensearchDashboards": "localhost:5601",
Expand Down
4 changes: 2 additions & 2 deletions dashboards-reports/opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "reportsDashboards",
"version": "1.0.0.0",
"opensearchDashboardsVersion": "1.0.0",
"version": "1.1.0.0",
"opensearchDashboardsVersion": "1.1.0",
"requiredPlugins": ["navigation", "data", "opensearchDashboardsUtils"],
"optionalPlugins": ["share"],
"server": true,
Expand Down
4 changes: 2 additions & 2 deletions dashboards-reports/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "reports-dashboards",
"version": "1.0.0.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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion dashboards-reports/server/utils/validationHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = /^\/(_plugin\/kibana\/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,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Version 1.0.1.0 Release Notes

Compatible with OpenSearch 1.0.1

### Bug Fixes
* Bump version and add notebooks context menu fix for 1.0.1.0 patch ([#142](https://github.com/opensearch-project/dashboards-reports/pull/142))

### Documentation
* Add release notes for 1.0.1 release ([#143](https://github.com/opensearch-project/dashboards-reports/pull/143))
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Version 1.1.0.0 Release Notes

Compatible with OpenSearch 1.1.0

### Bug Fixes
* Fix url validation ([#132](https://github.com/opensearch-project/dashboards-reports/pull/132))
* Fix url validation for context menu ([#134](https://github.com/opensearch-project/dashboards-reports/pull/134))

### Infrastructure
* Bump opensearch ref to 1.1 in CI ([#155](https://github.com/opensearch-project/dashboards-reports/pull/155))

### Infrastructure
* Fix snapshot build and upgrade to OpenSearch 1.1 ([#140](https://github.com/opensearch-project/dashboards-reports/pull/140))
* Bump version for Opensearch 1.1.0 release ([#149](https://github.com/opensearch-project/dashboards-reports/pull/149))
24 changes: 14 additions & 10 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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') {
Expand All @@ -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"
}
Expand Down Expand Up @@ -236,14 +236,18 @@ integTest {
if (System.getProperty("test.debug") != null) {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=8000'
}

if (System.getProperty("tests.clustername") != null) {
exclude 'org/opensearch/reportsscheduler/ReportsSchedulerPluginIT.class'
}
}

Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin");
integTest.dependsOn(bundle)
integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))}

testClusters.integTest {
testDistribution = "INTEG_TEST"
testDistribution = "ARCHIVE"
// need to install job-scheduler first, need to assemble job-scheduler first
plugin(provider(new Callable<RegularFile>(){
@Override
Expand Down
28 changes: 0 additions & 28 deletions reports-scheduler/gradle.properties

This file was deleted.

Binary file not shown.
Binary file not shown.