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

adding MDS support for ISM Pages: Indices, Aliases, DataStreams, Templates & Component Templates #1006

Merged
merged 14 commits into from
Mar 26, 2024

Conversation

RamakrishnaChilaka
Copy link
Collaborator

Description

This change adds multi data source selector (described in opensearch-project/OpenSearch-Dashboards#6035). This change adds MDS support to Indices, Aliases, Data streams, Templates & Component template pages. There will be a follow-up PR raised for the remaining pages.

Issues Resolved

#982 This issue will be solved partially through this PR.

Check List

  • [✅] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

public/pages/Indices/containers/Indices/Indices.test.tsx Outdated Show resolved Hide resolved
public/pages/Indices/containers/Indices/Indices.test.tsx Outdated Show resolved Hide resolved
public/pages/Indices/containers/Indices/Indices.tsx Outdated Show resolved Hide resolved
public/pages/Indices/containers/Indices/Indices.tsx Outdated Show resolved Hide resolved
public/services/CommonService.ts Outdated Show resolved Hide resolved
server/routes/aliases.ts Outdated Show resolved Hide resolved
Copy link
Member

@SuZhou-Joe SuZhou-Joe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better and thanks for the quick update.

Concerns left:

  1. Is it doable that we compute dataSourceLabel by using dataSourceList and dataSourceId?
  2. Can we keep one convention to pass dataSourceId across ISM?

public/services/DataSourceMenuContext.ts Show resolved Hide resolved
server/services/OpenSearchISMService.ts Outdated Show resolved Hide resolved
@RamakrishnaChilaka
Copy link
Collaborator Author

Concerns left:

Is it doable that we compute dataSourceLabel by using dataSourceList and dataSourceId?

I will confirm on this by syncing up with opensearch-core team once by the end of this week, as new features are being rolled out in the data source picker this week.

Can we keep one convention to pass dataSourceId across ISM?

I will work on this and try to come up with a convention for passing data source id across ISM..

@RamakrishnaChilaka
Copy link
Collaborator Author

RamakrishnaChilaka commented Mar 21, 2024

@SuZhou-Joe, if we use data source id to compute data source label, it will involve a database read call and ISM plugin needs to be aware of the schema of the index where these data source details are being stored and if this schema changes our code might break. Therefore, in my opinion, we should avoid computing this in the plugin if possible and abstract this functionality away to DataSourceMenu component in the core. I believe with the current implementation of DataSourceMenu in the core's main branch, we can avoid storing DataSourceLabel in our plugin's state. Pasting the GitHub issue where this is being discussed opensearch-project/OpenSearch-Dashboards#6035 (comment).

RamakrishnaChilaka and others added 13 commits March 26, 2024 11:32
…lates

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by:  Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
…rcelabel

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.43%. Comparing base (d516380) to head (bf5558d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1006      +/-   ##
==========================================
+ Coverage   63.37%   63.43%   +0.06%     
==========================================
  Files         341      344       +3     
  Lines       11554    11668     +114     
  Branches     2243     2260      +17     
==========================================
+ Hits         7322     7402      +80     
- Misses       3658     3689      +31     
- Partials      574      577       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
@Hailong-am Hailong-am merged commit b151b85 into opensearch-project:main Mar 26, 2024
11 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/index-management-dashboards-plugin/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/index-management-dashboards-plugin/backport-2.x
# Create a new branch
git switch --create backport/backport-1006-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b151b851ef06234196208bc4505737aba375e307
# Push it to GitHub
git push --set-upstream origin backport/backport-1006-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/index-management-dashboards-plugin/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1006-to-2.x.

RamakrishnaChilaka added a commit to RamakrishnaChilaka/index-management-dashboards-plugin that referenced this pull request Mar 26, 2024
…lates & Component Templates (opensearch-project#1006)

* adding MDS support for ISM Pages: Indices, Aliases, DataStreams, Templates

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* Reverting (not required) onCancel changes for forceMerge

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* force mounting IndexDetail page

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* force mounting template page

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* clearing indexdetail on datasource change

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* mounting data source menu as read only

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* integrating with readonly data source

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* re building services on page switches

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring to common hooks and MDSEnabledComponent

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* Update public/components/MDSEnabledComponent/MDSEnabledComponent.tsx

Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by:  Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring code for server & appending URL with datasourceId/datasourcelabel

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring types & fixing tests

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* resolving yarn.lock conflict

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* flaky test flush action aliases

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

---------

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit b151b85)
amsiglan pushed a commit that referenced this pull request Mar 26, 2024
…lates & Component Templates (#1006) (#1018)

* adding MDS support for ISM Pages: Indices, Aliases, DataStreams, Templates

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* Reverting (not required) onCancel changes for forceMerge

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* force mounting IndexDetail page

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* force mounting template page

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* clearing indexdetail on datasource change

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* mounting data source menu as read only

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* integrating with readonly data source

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* re building services on page switches

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring to common hooks and MDSEnabledComponent

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* Update public/components/MDSEnabledComponent/MDSEnabledComponent.tsx

Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by:  Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com>
Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring code for server & appending URL with datasourceId/datasourcelabel

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* refactoring types & fixing tests

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* resolving yarn.lock conflict

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

* flaky test flush action aliases

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>

---------

Signed-off-by: Ramakrishna Chilaka <ramachil@amazon.com>
Signed-off-by: Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit b151b85)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants