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

Index operation #489

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9bb3643
Feature/index operation (#295)
SuZhou-Joe Oct 25, 2022
3e79127
Feature/index detail (#312): Enable delete action & edit action for i…
SuZhou-Joe Oct 27, 2022
0fd3fad
feat: enable inheritting from template function when creating index (…
SuZhou-Joe Oct 28, 2022
48f5ecb
refractor: move api calls from components to containers (#322)
SuZhou-Joe Oct 29, 2022
c781432
feature: Add form generator & advanced settings to speed up developme…
SuZhou-Joe Nov 2, 2022
5ec13c7
feat: add diff confirm modal in create wizard (#323)
SuZhou-Joe Nov 3, 2022
e2edd70
Feature/unit test (#339)
SuZhou-Joe Nov 7, 2022
5acd123
Feature/extra status (#353)
SuZhou-Joe Nov 8, 2022
8c9edb2
Add open&close&shrink action to indices page (#355)
gaobinlong Nov 9, 2022
8fc90d0
Reindex operation (#363)
Hailong-am Nov 10, 2022
ee5d5fb
Feature/optimize mappings (#356)
SuZhou-Joe Nov 10, 2022
9474258
Index operation (#373)
xluo-aws Nov 10, 2022
7e717cf
feat: finish the index configuration component (#372)
SuZhou-Joe Nov 10, 2022
e93d5f9
Refractor for spirint1 (#375)
SuZhou-Joe Nov 14, 2022
933e1e7
Index operation (#378)
xluo-aws Nov 18, 2022
824938d
feat: add notification component (#377)
SuZhou-Joe Nov 21, 2022
2fa838c
Refractor: Implement fields & validation (#384)
SuZhou-Joe Nov 22, 2022
8205abd
Refactor Shrink&Open&Close index operations (#386)
gaobinlong Nov 22, 2022
7560eb0
Index operation (#391)
xluo-aws Nov 24, 2022
8c61ffb
Refactor reindex page (#395)
Hailong-am Nov 24, 2022
110fd06
Add replica parameter and shard number option list (#406)
xluo-aws Nov 28, 2022
6c2c2be
Add more test case for reindex (#404)
Hailong-am Nov 28, 2022
82b07e3
add open index button & aliases to ShrinkIndexFlyout (#407)
gaobinlong Nov 28, 2022
c21ee9a
Feature: Alias management (#405)
SuZhou-Joe Nov 29, 2022
db86bf2
Feature/optimization (#409)
SuZhou-Joe Nov 29, 2022
2254787
Fix a bug caused by wrong element name in function test (#411)
xluo-aws Nov 29, 2022
93ef69a
Feature/20221129 typo (#410)
SuZhou-Joe Dec 2, 2022
e7239ce
feat: update unit test (#418)
SuZhou-Joe Dec 2, 2022
3d7225b
Disable shrink action if a data_stream is selected in indices page (#…
gaobinlong Dec 2, 2022
5a510ba
support reindex from single data stream index (#426)
Hailong-am Dec 4, 2022
ae94609
Disable Split link for data stream index (#434)
xluo-aws Dec 7, 2022
c802247
Feature: Add notification toast (#425)
SuZhou-Joe Dec 8, 2022
f94bc70
feat: use BetterTooltip (#453)
SuZhou-Joe Dec 8, 2022
f1506d9
Feature/20221206 opt (#442)
SuZhou-Joe Dec 9, 2022
b850cbf
Fix bug for shrink&close operation (#452)
gaobinlong Dec 9, 2022
9a292b6
Remove unnecessary logic when calculating split shard options. Fix wa…
xluo-aws Dec 9, 2022
0000f11
bug fix of reindex and UT warning cleanup (#454)
Hailong-am Dec 9, 2022
87a0b9d
feat: add templates page (#414)
SuZhou-Joe Dec 12, 2022
11d1215
Clean all the unit test warnings (#459)
SuZhou-Joe Dec 13, 2022
ce168a4
wording change (#458)
Hailong-am Dec 15, 2022
54f6e41
Fix all the UI tickets for index-operation (#457)
SuZhou-Joe Dec 16, 2022
7159d29
SplitIndex flyout change to page (#474)
xluo-aws Dec 17, 2022
ee619cb
hidden duplicate indices (#471)
Hailong-am Dec 17, 2022
9e9f03c
wording and breadcrumbs update (#477)
Hailong-am Dec 19, 2022
f385e96
Index operation (#475)
xluo-aws Dec 19, 2022
a36ab02
Change shrinkIndexFlyout to page (#476)
gaobinlong Dec 19, 2022
5703a9d
Index operation (#480)
xluo-aws Dec 20, 2022
b5c362a
enable fullwidth for JSON editor (#479)
Hailong-am Dec 20, 2022
8494e35
Some fixs after internal demo review (#472)
SuZhou-Joe Dec 20, 2022
0de5894
fix some wording issue (#482)
gaobinlong Dec 20, 2022
3868fdf
Merge feature branch with 2.x (#493)
SuZhou-Joe Dec 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
OPENSEARCH_DASHBOARDS_VERSION: '2.4'
OPENSEARCH_VERSION: '2.4.0-SNAPSHOT'
jobs:
tests:
Expand Down
24 changes: 14 additions & 10 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,19 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
OPENSEARCH_DASHBOARDS_VERSION: '2.4'
jobs:
tests:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, mac-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Index Management Dashboards plugin
uses: actions/checkout@v2
with:
path: index-management-dashboards-plugin
# Enable longer filenames for windows
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true
- name: Checkout OpenSearch-Dashboards
uses: actions/checkout@v2
with:
Expand All @@ -38,17 +41,18 @@ jobs:
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}
- name: Checkout Index Management Dashboards plugin
uses: actions/checkout@v2
with:
path: OpenSearch-Dashboards/plugins/index-management-dashboards-plugin
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
mkdir -p OpenSearch-Dashboards/plugins
mv index-management-dashboards-plugin OpenSearch-Dashboards/plugins
cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin
yarn osd bootstrap
- name: Run tests
run: |
cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin
yarn run test:jest --coverage
- name: Uploads coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
"viewportHeight": 900,
"viewportWidth": 1440,
"defaultCommandTimeout": 10000,
"nodeVersion": "system",
"env": {
"opensearch_url": "localhost:9200",
"opensearch_dashboards": "http://localhost:5601",
"security_enabled": false,
"username": "admin",
"password": "admin"
}
}
}
119 changes: 119 additions & 0 deletions cypress/integration/aliases.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import { PLUGIN_NAME } from "../support/constants";

const SAMPLE_INDEX_PREFIX = "index-for-alias-test";
const SAMPLE_ALIAS_PREFIX = "alias-for-test";
const CREATE_ALIAS = "create-alias";
const EDIT_INDEX = "index-edit-index-for-alias-test";

describe("Aliases", () => {
before(() => {
// Set welcome screen tracking to false
localStorage.setItem("home:welcome:show", "false");
cy.deleteAllIndices();
for (let i = 0; i < 11; i++) {
cy.createIndex(`${SAMPLE_INDEX_PREFIX}-${i}`, null);
}
cy.createIndex(EDIT_INDEX, null);
for (let i = 0; i < 30; i++) {
cy.addAlias(`${SAMPLE_ALIAS_PREFIX}-${i}`, `${SAMPLE_INDEX_PREFIX}-${i % 11}`);
}
cy.removeAlias(`${SAMPLE_ALIAS_PREFIX}-0`);
cy.addAlias(`${SAMPLE_ALIAS_PREFIX}-0`, `${SAMPLE_INDEX_PREFIX}-*`);
});

beforeEach(() => {
// Visit ISM OSD
cy.visit(`${Cypress.env("opensearch_dashboards")}/app/${PLUGIN_NAME}#/aliases`);

// Common text to wait for to confirm page loaded, give up to 60 seconds for initial load
cy.contains("Rows per page", { timeout: 60000 });
});

describe("can be searched / sorted / paginated", () => {
it("successfully", () => {
cy.get('[data-test-subj="pagination-button-1"]').should("exist");
cy.get('[placeholder="Search..."]').type("alias-for-test-0{enter}");
cy.contains("alias-for-test-0");
cy.get(".euiTableRow").should("have.length", 1);
cy.get('[data-test-subj="comboBoxSearchInput"]').type("closed{enter}");

cy.contains("You have no aliases.");
});
});

describe("shows more flyout", () => {
it("successfully", () => {
cy.get('[placeholder="Search..."]').type("alias-for-test-0{enter}");
cy.contains("alias-for-test-0");
cy.get(".euiTableRow").should("have.length", 1);
cy.get('.euiTableRowCell [data-test-subj="8 more"]')
.click()
.get('[data-test-subj="indices-table"] .euiTableRow')
.should("have.length", 10);
});
});

describe("can create a alias with wildcard and specific name", () => {
it("successfully", () => {
cy.get('[data-test-subj="Create AliasButton"]').click();
cy.get('[data-test-subj="form-name-alias"]').type(CREATE_ALIAS);
cy.get('[data-test-subj="form-name-indexArray"] [data-test-subj="comboBoxSearchInput"]').type(
`${EDIT_INDEX}{enter}${SAMPLE_INDEX_PREFIX}-*{enter}`
);
cy.get(".euiFlyoutFooter .euiButton--fill").click().get('[data-test-subj="9 more"]').should("exist");
});
});

describe("can edit / delete a alias", () => {
it("successfully", () => {
cy.get('[placeholder="Search..."]').type(`${SAMPLE_ALIAS_PREFIX}-0{enter}`);
cy.contains(`${SAMPLE_ALIAS_PREFIX}-0`);
cy.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="editAction"]')
.should("be.disabled")
.get(`#_selection_column_${SAMPLE_ALIAS_PREFIX}-0-checkbox`)
.click()
.get('[data-test-subj="moreAction"] button')
.click()
.get('[data-test-subj="editAction"]')
.click()
.get('[data-test-subj="form-name-indexArray"] [data-test-subj="comboBoxInput"]')
.click()
.type(`${EDIT_INDEX}{enter}`)
.get(`[title="${SAMPLE_INDEX_PREFIX}-0"] button`)
.click()
.get(`[title="${SAMPLE_INDEX_PREFIX}-1"] button`)
.click()
.get(".euiFlyoutFooter .euiButton--fill")
.click()
.end();

cy.get('[data-test-subj="7 more"]').should("exist");

cy.get('[data-test-subj="moreAction"] button').click().get('[data-test-subj="deleteAction"]').click();
// The confirm button should be disabled
cy.get('[data-test-subj="deleteConfirmButton"]').should("be.disabled");
// type delete
cy.wait(500).get('[data-test-subj="deleteInput"]').type("delete");
cy.get('[data-test-subj="deleteConfirmButton"]').should("not.be.disabled");
// click to delete
cy.get('[data-test-subj="deleteConfirmButton"]').click();
// the alias should not exist
cy.wait(500);
cy.get(`#_selection_column_${SAMPLE_ALIAS_PREFIX}-0-checkbox`).should("not.exist");
});
});

after(() => {
cy.deleteAllIndices();
for (let i = 0; i < 30; i++) {
cy.removeAlias(`${SAMPLE_ALIAS_PREFIX}-${i}`);
}
cy.removeAlias(CREATE_ALIAS);
});
});
Loading