Skip to content

Commit

Permalink
Merge branch '2.x' into backport/backport-1618-to-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wanglam authored Jan 13, 2025
2 parents f6e7e3e + e2921c7 commit 9586464
Show file tree
Hide file tree
Showing 37 changed files with 2,941 additions and 931 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @tianleh @kavilla @ohltyler @CCongWang @ashwin-pc @peterzhuamazon @ananzh @prudhvigodithi @xluo-aws @Hailong-am @SuZhou-Joe @ruanyl @wanglam @raintygao
* @tianleh @kavilla @ohltyler @CCongWang @ashwin-pc @peterzhuamazon @ananzh @prudhvigodithi @xluo-aws @Hailong-am @SuZhou-Joe @ruanyl @wanglam @raintygao @zhongnansu @yujin-emma @yubonluo
2 changes: 2 additions & 0 deletions .github/workflows/cypress-workflow-bundle-snapshot-based.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
test-name: Core Dashboards using Bundle Snapshot
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-with-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true --usageCollection.uiMetric.enabled=true
artifact-name-suffix: '-with-security'

tests-without-security:
uses: ./.github/workflows/release-e2e-workflow-template.yml
Expand All @@ -28,3 +29,4 @@ jobs:
test-command: env CYPRESS_NO_COMMAND_LOG=1 CYPRESS_ML_COMMONS_DASHBOARDS_ENABLED=true CYPRESS_VISBUILDER_ENABLED=true CYPRESS_UIMETRIC_ENABLED=true CYPRESS_DATASOURCE_MANAGEMENT_ENABLED=true yarn cypress:run-without-security --browser chromium --spec 'cypress/integration/core-opensearch-dashboards/opensearch-dashboards/**/*.js'
osd-serve-args: --data_source.enabled=true --data_source.ssl.verificationMode=none --vis_builder.enabled=true --ml_commons_dashboards.enabled=true --usageCollection.uiMetric.enabled=true
security-enabled: false
artifact-name-suffix: '-without-security'
3 changes: 3 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
| Yulong Ruan | [ruanyl](https://github.com/ruanyl) | Amazon |
| Lin Wang | [wanglam](https://github.com/wanglam) | Amazon |
| Tianyu Gao | [raintygao](https://github.com/raintygao) | Amazon |
| Zhongnan Su | [zhongnansu](https://github.com/zhongnansu) | Amazon |
| Emma Jin | [yujin-emma](https://github.com/yujin-emma) | Amazon |
| Yubo Luo | [yubonluo](https://github.com/yubonluo) | Amazon |

## Emeritus

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"cluster_permissions": ["*"],
"index_permissions": [
{
"index_patterns": ["*"],
"fls": [],
"masked_fields": [],
"allowed_actions": ["*"]
}
],
"tenant_permissions": [
{
"tenant_patterns": ["*"],
"allowed_actions": ["kibana_all_write"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"users": ["workspace-test"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"password": "testUserPassword123"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ const testFixtureHandler = new TestFixtureHandler(
Cypress.env('openSearchUrl')
);

const indexSet = [
'logstash-2015.09.22',
'logstash-2015.09.21',
'logstash-2015.09.20',
];

describe('query enhancement queries', { scrollBehavior: false }, () => {
before(() => {
CURRENT_TENANT.newTenant = 'global';
Expand Down Expand Up @@ -108,7 +102,7 @@ describe('query enhancement queries', { scrollBehavior: false }, () => {
`source = timestamp-*`
);
cy.waitForSearch();
cy.getElementByTestId('queryResultCompleteMsg').click();
cy.getElementByTestId(`queryResultCompleteMsg`).should('be.visible');
cy.get('[class="euiText euiText--small"]').then((text) => cy.log(text));
cy.verifyHitCount(4);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { WorkspaceACLTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_acl.cases';

WorkspaceACLTestCases();
Original file line number Diff line number Diff line change
Expand Up @@ -3,149 +3,6 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { MiscUtils } from '@opensearch-dashboards-test/opensearch-dashboards-test-library';
import { WorkspaceAnalyticsOverviewTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_analytics_overviews.cases';

const miscUtils = new MiscUtils(cy);
const workspaceName = `test_workspace_analytics_${Math.random()
.toString(36)
.substring(7)}`;
let workspaceDescription = 'This is a analytics workspace description.';
let workspaceId;
let datasourceId;
let workspaceFeatures = ['use-case-all'];

const MDSEnabled = Cypress.env('DATASOURCE_MANAGEMENT_ENABLED');

if (Cypress.env('WORKSPACE_ENABLED')) {
const createWorkspace = (dsId) => {
cy.createWorkspace({
name: workspaceName,
description: workspaceDescription,
features: workspaceFeatures,
settings: {
permissions: {
library_write: { users: ['%me%'] },
write: { users: ['%me%'] },
},
...(dsId ? { dataSources: [dsId] } : {}),
},
}).then((value) => {
workspaceId = value;
// load sample data
cy.loadSampleDataForWorkspace('ecommerce', value, dsId);
});
};

describe('Analytics workspace overview', () => {
before(() => {
cy.deleteWorkspaceByName(workspaceName);
if (MDSEnabled) {
cy.deleteAllDataSources();
cy.createDataSourceNoAuth().then((result) => {
datasourceId = result[0];
expect(datasourceId).to.be.a('string').that.is.not.empty;
createWorkspace(datasourceId);
});
} else {
createWorkspace();
}
});

after(() => {
if (workspaceId) {
cy.removeSampleDataForWorkspace('ecommerce', workspaceId, datasourceId);
cy.deleteWorkspaceById(workspaceId);
}
cy.deleteAllDataSources();
});

beforeEach(() => {
// Visit workspace update page
miscUtils.visitPage(`w/${workspaceId}/app/all_overview`);
// wait for page load
cy.contains('h1', 'Overview');
});

it('should display get started sections', () => {
cy.get('.euiCard__footer').contains('Observability').should('be.visible');
// this is depends on observability plugin been installed
// cy.url().should('include', 'app/observability-overview');

cy.get('.euiCard__footer')
.contains('Security Analytics')
.should('be.visible');
// this is depends on security analytics plugin been installed
// cy.url().should('include', 'app/sa_overview');

cy.get('.euiCard__footer')
.contains('Search')
.should('be.visible')
.click();
cy.url().should('include', 'app/search_overview');
});

it('should display asset section correctly', () => {
// no recently view assets
cy.contains('No assets to display');

// recentlyCard
cy.contains('Recently updated').should('be.visible').click();
// should have 6 elements
cy.getElementByTestId('recentlyCard').should('have.length', 6);

// filter by dashboard
cy.getElementByTestId('comboBoxInput').click();
cy.get('span.euiComboBoxOption__content').contains('dashboard').click();

// click dashboard card
cy.getElementByTestId('recentlyCard').first().click();

// verify url has /app/dashboards
cy.url().should('include', 'app/dashboards');

cy.go('back');

// view all
cy.contains('View all').click();
// verify url has /app/objects
cy.url().should('include', 'app/objects');
});

// Alerts and threat Alerts cards are depends on plugins

it('should display OpenSearch Documentation panel', () => {
cy.contains('OpenSearch Documentation').should('be.visible');
cy.get('.euiLink')
.contains('Quickstart guide')
.should('be.visible')
.and(
'have.attr',
'href',
'https://opensearch.org/docs/latest/dashboards/quickstart/'
);
cy.get('.euiLink')
.contains('Building data visualizations')
.should('be.visible')
.and(
'have.attr',
'href',
'https://opensearch.org/docs/latest/dashboards/visualize/viz-index/'
);
cy.get('.euiLink')
.contains('Creating dashboards')
.should('be.visible')
.and(
'have.attr',
'href',
'https://opensearch.org/docs/latest/dashboards/dashboard/index/'
);
cy.contains('Learn more in Documentation')
.should('be.visible')
.and(
'have.attr',
'href',
'https://opensearch.org/docs/latest/dashboards/index/'
);
});
});
}
WorkspaceAnalyticsOverviewTestCases();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { WorkspaceAssetsTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_assets.cases';

WorkspaceAssetsTestCases();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { WorkspaceAssociationTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_association.cases';

WorkspaceAssociationTestCases();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { WorkspaceBreadcrumbsTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_breadcrumbs.cases';

WorkspaceBreadcrumbsTestCases();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import { WorkspaceCollaboratorsTestCases } from '../../../../utils/dashboards/workspace-plugin/test-cases/mds_workspace_collaborators.cases';

WorkspaceCollaboratorsTestCases();
Loading

0 comments on commit 9586464

Please sign in to comment.