opensearch-project / security-dashboards-plugin

🔐 Manage your internal users, roles, access control, and audit logs from OpenSearch Dashboards
https://opensearch.org/docs/latest/security-plugin/index/
Apache License 2.0
66 stars 148 forks source link

Remove tenant tab when disabled via yaml #1960

Closed derek-ho closed 1 month ago

derek-ho commented 1 month ago

Description

Removes tenant tab from showing up in the left nav, and also doesn't register it as a page at /tenants if tenancy is turned off/not enabled via yaml. Since workspaces is coming and no active development being done on the tenancy feature, this is appropriate. Also gets rid of a few "ghost" routes and UI components related to different tenancy tabs (manage vs configure), since these were not connected to any UI component and would only be hit unexpectedly or if people know the exact route to put in the URL.

Category

Enhancement

Why these changes are required?

Fix: https://github.com/opensearch-project/security-dashboards-plugin/issues/1959

What is the old behavior before changes and new behavior after changes?

New behavior: when multi tenancy is turned off via dashboards yaml, tenancy does not show up in the left nav, explicitly navigating to '/tenants' does not do anything

Issues Resolved

Fix: https://github.com/opensearch-project/security-dashboards-plugin/issues/1959

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

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.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 45.83333% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 69.91%. Comparing base (37c2695) to head (9404930).

Files Patch % Lines
public/apps/configuration/app-router.tsx 57.89% 7 Missing and 1 partial :warning:
public/apps/configuration/panels/get-started.tsx 0.00% 4 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1960 +/- ## ======================================= Coverage 69.91% 69.91% ======================================= Files 97 96 -1 Lines 2506 2513 +7 Branches 336 339 +3 ======================================= + Hits 1752 1757 +5 Misses 673 673 - Partials 81 83 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

derek-ho commented 1 month ago

Failing cypress test case should be changed to instead assert that tenancy tab does not show up on the left nav menu. That test is not being run at release time, will move that over in a separate PR

derek-ho commented 1 month ago

Test fix is within this PR: https://github.com/opensearch-project/opensearch-dashboards-functional-test/pull/1276

opensearch-trigger-bot[bot] commented 1 month ago

The backport to 2.x failed:

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

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-1960-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a202d4875ae42729994b64fb38090af6b7f1ae7a
# Push it to GitHub
git push --set-upstream origin backport/backport-1960-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 base branch is 2.x and the compare/head branch is backport/backport-1960-to-2.x.

DarshitChanpura commented 1 month ago

@derek-ho Could you create a manual backport?