-
Notifications
You must be signed in to change notification settings - Fork 174
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
Adds Multiple Datasources Support for Security Dashboards Plugin #1888
Adds Multiple Datasources Support for Security Dashboards Plugin #1888
Conversation
…1818) Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Signed-off-by: Derek Ho <dxho@amazon.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com>
* Add multi datasource support for internal users tab Signed-off-by: Derek Ho <dxho@amazon.com> * Add test coverage for front end and backend Signed-off-by: Derek Ho <dxho@amazon.com> * Push cypress test for users Signed-off-by: Derek Ho <dxho@amazon.com> * Remove extra click Signed-off-by: Derek Ho <dxho@amazon.com> * Consume changes in core Signed-off-by: Derek Ho <dxho@amazon.com> * Don't rely on public export for type Signed-off-by: Derek Ho <dxho@amazon.com> * Consume list changes, fix cypress test unskips auth test Signed-off-by: Derek Ho <dxho@amazon.com> * Fix cypress test Signed-off-by: Derek Ho <dxho@amazon.com> * Fix test Signed-off-by: Derek Ho <dxho@amazon.com> * Test fix Signed-off-by: Derek Ho <dxho@amazon.com> * Add timeout as well Signed-off-by: Derek Ho <dxho@amazon.com> * Try different way to select the option Signed-off-by: Derek Ho <dxho@amazon.com> * Fix test Signed-off-by: Derek Ho <dxho@amazon.com> * Use data test subj for more consistency Signed-off-by: Derek Ho <dxho@amazon.com> --------- Signed-off-by: Derek Ho <dxho@amazon.com>
--------- Signed-off-by: Derek Ho <dxho@amazon.com>
* Adds datasource picker to Permissions tab Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Finalizes changes for Permissions tab dataSource picker Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Fixes Unit tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Adds integration tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Adds cypress test for Permission tab with remote data source Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Completes cypress test for Permissions tab, fixes cypress test for Users tab and fixes a spelling error Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Updates unit tests and reverts a change in cypress test Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Addresses nits to make tests more robust Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Fixes unit tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> --------- Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Add multi datasource support for the tenanct and audit log tabs Signed-off-by: Derek Ho <dxho@amazon.com> * Add integraiton tests for audit log with and without multi datasource Signed-off-by: Derek Ho <dxho@amazon.com> * Add cypress test support for tenancy and audit log Signed-off-by: Derek Ho <dxho@amazon.com> * Add toast support and assert existance of page element to make test unflaky Signed-off-by: Derek Ho <dxho@amazon.com> --------- Signed-off-by: Derek Ho <dxho@amazon.com>
* Adds datasource picker for Roles tab and its sub-tabs Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Fixes jest:ui task Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Adds integration test for roles datasource picker Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Adds cypress test for roles tab Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * fixFix ResizeObserver loop error Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Makes query param required Signed-off-by: Darshit Chanpura <dchanp@amazon.com> --------- Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Add selector on service accounts page Signed-off-by: Derek Ho <dxho@amazon.com> * Lint Signed-off-by: Derek Ho <dxho@amazon.com> * Fix test for service accounts Signed-off-by: Derek Ho <dxho@amazon.com> --------- Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
* Add cluster info to toasts Signed-off-by: Derek Ho <dxho@amazon.com> * Add URL support Signed-off-by: Derek Ho <dxho@amazon.com> * Initial work to read/write from url Signed-off-by: Derek Ho <dxho@amazon.com> * Consume changes from core Signed-off-by: Derek Ho <dxho@amazon.com> * Lint and remove unused imports Signed-off-by: Derek Ho <dxho@amazon.com> * Fix edge case and test Signed-off-by: Derek Ho <dxho@amazon.com> * Refactors tests to accomodate changes to dataSource value consumption from URL Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Try in headless mode Signed-off-by: Derek Ho <dxho@amazon.com> * Make closeToast better and revert to admin password for matrix going back to 2.4 Signed-off-by: Derek Ho <dxho@amazon.com> * Try experimental memory management Signed-off-by: Derek Ho <dxho@amazon.com> * Try to fix closeToast Signed-off-by: Derek Ho <dxho@amazon.com> * Fix for close toast Signed-off-by: Derek Ho <dxho@amazon.com> * Find by warning Signed-off-by: Derek Ho <dxho@amazon.com> * Fix by warning Signed-off-by: Derek Ho <dxho@amazon.com> * Fix tenancy test from main Signed-off-by: Derek Ho <dxho@amazon.com> * Fix auth test and be explicit about local datasource Signed-off-by: Derek Ho <dxho@amazon.com> * Test fixes Signed-off-by: Derek Ho <dxho@amazon.com> * Fix role flaky test Signed-off-by: Derek Ho <dxho@amazon.com> * Nit Signed-off-by: Derek Ho <dxho@amazon.com> * Makes github cypress run headless Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Enabled experimentalMemoryManagement for chromium based cypress tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> --------- Signed-off-by: Derek Ho <dxho@amazon.com> Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com>
…rds-plugin into HEAD Signed-off-by: Derek Ho <dxho@amazon.com>
Signed-off-by: Derek Ho <dxho@amazon.com>
@derek-ho Can you please fill out the description of this PR? What is remaining before it is flipped from Draft? |
@cwperks working on cypress test stability - see draft PR: #1894. Cypress tests consistently working on @DarshitChanpura and I's local, but failing on github runner due to space issues, we are seeing if we can find the root case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some initial comments.
Would it be possible to capture a recording of the cypress tests that are run that test the MDS functionality?
public/apps/configuration/panels/audit-logging/audit-logging-edit-settings.tsx
Outdated
Show resolved
Hide resolved
* Fix some state issues and try to use electron browser Signed-off-by: Derek Ho <dxho@amazon.com> * Try modifying numtestskeptinmemory Signed-off-by: Derek Ho <dxho@amazon.com> * Remove closetoast Signed-off-by: Derek Ho <dxho@amazon.com> * Fix flaky cypress test Signed-off-by: Derek Ho <dxho@amazon.com> * Run 10x Signed-off-by: Derek Ho <dxho@amazon.com> * Fix test Signed-off-by: Derek Ho <dxho@amazon.com> * Fix permissions test Signed-off-by: Derek Ho <dxho@amazon.com> * Move management to correct section Signed-off-by: Derek Ho <dxho@amazon.com> * Push up fixes for audit logs and roles Signed-off-by: Derek Ho <dxho@amazon.com> * Remove local cluster checks to cut length and increase stability Signed-off-by: Derek Ho <dxho@amazon.com> * Improves before and after handling Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Temporarily disable permissions and roles tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * adds delete datasource call to beforeEach Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Unskip permissions test Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Absorb changes from core Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Fixes tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Skips legacy browser warning Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Refactor audit logs tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Force page reload post creation Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Unskip auth and roles, and skip audit logs Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Skip roles tab Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Changes data source url Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Fix lint issues Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Chrome Signed-off-by: Derek Ho <dxho@amazon.com> * Skip users and permissions tab Signed-off-by: Derek Ho <dxho@amazon.com> * Revert cypress settings Signed-off-by: Derek Ho <dxho@amazon.com> * Modify test to make cypress request instead of UI Signed-off-by: Derek Ho <dxho@amazon.com> * Lint Signed-off-by: Derek Ho <dxho@amazon.com> * Add fix for get started and rewrite users test Signed-off-by: Derek Ho <dxho@amazon.com> * use tostring to be more consistent with the actual behavior Signed-off-by: Derek Ho <dxho@amazon.com> * Try to fix flaky tests Signed-off-by: Derek Ho <dxho@amazon.com> * Revert to beforeeach and aftereach Signed-off-by: Derek Ho <dxho@amazon.com> * Fix test Signed-off-by: Derek Ho <dxho@amazon.com> * Fix lint Signed-off-by: Derek Ho <dxho@amazon.com> * Fix roles and enable Signed-off-by: Derek Ho <dxho@amazon.com> * Adds retry mechanism to cypress tests Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Increases retries to 5 Signed-off-by: Darshit Chanpura <dchanp@amazon.com> * Reverts CI runs to 1 Signed-off-by: Darshit Chanpura <dchanp@amazon.com> --------- Signed-off-by: Derek Ho <dxho@amazon.com> Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: Derek Ho <dxho@amazon.com>
.github/workflows/cypress-test-multidatasources-enabled-e2e.yml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a second pass. This looks very close. Thanks for fixing the issues with the tests!
public/apps/configuration/panels/audit-logging/audit-logging-edit-settings.tsx
Outdated
Show resolved
Hide resolved
public/apps/configuration/panels/audit-logging/audit-logging-edit-settings.tsx
Show resolved
Hide resolved
public/apps/configuration/panels/audit-logging/audit-logging-edit-settings.tsx
Show resolved
Hide resolved
public/apps/configuration/panels/internal-user-edit/internal-user-edit.tsx
Show resolved
Hide resolved
Cypress test failures resolved by: opensearch-project/opensearch-dashboards-functional-test#1239 |
@derek-ho Is this blocked until opensearch-project/opensearch-dashboards-functional-test#1239 is merged? |
Signed-off-by: Derek Ho <dxho@amazon.com>
It was merged, and I also updated some of the datasource specific tests to incorporate upstream core changes, CI is green now, and ready for re-review 👍 |
Signed-off-by: Derek Ho <dxho@amazon.com>
9d60f4f
Signed-off-by: Derek Ho <dxho@amazon.com>
ec0d269
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1888-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 154a3ba08828b36a8dae684651f25c8d72f584be
# Push it to GitHub
git push --set-upstream origin backport/backport-1888-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
…nsearch-project#1888) Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Signed-off-by: Derek Ho <dxho@amazon.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com> (cherry picked from commit 154a3ba) Signed-off-by: Derek Ho <dxho@amazon.com>
Description
This PR merges the feature branch feature/supporting-multiple-datasources to main. It adds support for multiple datasources within the security dashboards plugin. This means that for each page (minus tenancy and service accounts which are both locked to the local cluster), users can choose between different clusters that they added as a datasource and perform CRUD operations on that cluster's security backend plugin. If multi datasources is not enabled, then the security dashboards plugin will behave in the same way as before.
Category
New feature
Why these changes are required?
To support multiple datasources in the security dashboards plugin.
What is the old behavior before changes and new behavior after changes?
Old behavior: no support for multiple datasources (all CRUD operations done on local cluster)
New behavior: support for multiple datasources (users can choose which cluster to do CRUD operations on)
Video of security plugin with these changes, with/without multi datasources feature enabled:
Screen.Recording.2024-04-22.at.5.03.07.PM.mov
Issues Resolved
Close: #1794
Testing
Adds unit tests where appropriate, adds cypress tests (currently flaky), adds integration tests against a matrix of prior versions of OpenSearch to ensure compatibility with linux and windows.
Check List
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.