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

Fixes an issue when loading unknown datasource causes page to crash #1947

Closed

Conversation

DarshitChanpura
Copy link
Member

@DarshitChanpura DarshitChanpura commented May 10, 2024

Description

Fixes an issue when entering an invalid dataSource id causes page to crash.

UnknownDataSourcePage component only displays when opensearch_security.multitenancy.enable_aggregation_view is set to true.
When this setting is set to false, the page automatically reloads to the default dataSource.

Category

Bug Fix

Why these changes are required?

  • To prevent application from breaking when unknown/undefined dataSource is passed in the url.

Issues Resolved

Testing

  • Manual : with aggregation view disabled
Screen.Recording.2024-05-10.at.5.53.48.PM.mov
  • Manual: with aggregation view enabled
Screen.Recording.2024-05-10.at.6.48.37.PM.mov

Check List

  • New functionality includes testing
  • New functionality has been documented
  • 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.

package.json Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 11, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.07%. Comparing base (5fbc14e) to head (86c0b27).

Files Patch % Lines
.../apps/configuration/panels/auth-view/auth-view.tsx 80.00% 1 Missing ⚠️
public/apps/configuration/unknown-datasource.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1947      +/-   ##
==========================================
+ Coverage   70.61%   71.07%   +0.46%     
==========================================
  Files          97       98       +1     
  Lines        2600     2631      +31     
  Branches      380      393      +13     
==========================================
+ Hits         1836     1870      +34     
+ Misses        668      665       -3     
  Partials       96       96              

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

Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

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

Hi @DarshitChanpura, thanks for taking this on.

@DarshitChanpura
Copy link
Member Author

@kgcreative Would you mind giving this a look?

The proposed design of adding a button to switch to default cluster is not required in this case since the page auto-reloads to default cluster when aggregation view is disabled.

In the case where aggregation view is enabled, the user needs permissions to be able to read all data-source connections. Two possible outcomes in this case:

  1. If user has required read permission the page auto-reloads to default data-source connection in case of unknown data-source.
  2. If user doesn't have the required read permission, the following page appears:
    Screenshot 2024-05-14 at 11 01 18 AM

This is the new file that was introduced. Please let me know if any language needs to be changed.

@derek-ho
Copy link
Collaborator

I would maybe suggest:

The likely cause is that the aggregation view setting
            `opensearch_security.multitenancy.enable_aggregation_view` is enabled.
            Please contact your administrator to grant you access to global tenant to be able to
            view the data-sources or turn this feature off.

@derek-ho
Copy link
Collaborator

Can we move this into a panel, WDYT @kgcreative ? @cwperks what is the relative usage of this feature flag/ I know it is marked as experimental so maybe not high? Is it still worth it to add this?

@cwperks
Copy link
Member

cwperks commented May 20, 2024

@cwperks what is the relative usage of this feature flag/ I know it is marked as experimental so maybe not high? Is it still worth it to add this?

@derek-ho there is no active work on the feature flag. This was intended to simplify sharing amongst tenants, but is now* being supplanted by workspaces. The feature flag is not supported and IMO can be removed.

@derek-ho
Copy link
Collaborator

Most of the relevant code bits have been moved to the latest PR: #1964 I would be in favor of closing this down if the setting is deprecated

@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented May 30, 2024

I agree if the feature flag is not relevant anymore this can be closed in favor of #1964, since all the important changes from this PR are present over there.

@DarshitChanpura
Copy link
Member Author

Closing as this is not needed since aggregation view is an experimental feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] [MDS] No available datasources or illegal datasource crashes the plugin
4 participants