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

[BUG] fix default data source bug #6908

Merged
merged 3 commits into from
Jun 5, 2024

Conversation

BionIT
Copy link
Collaborator

@BionIT BionIT commented Jun 4, 2024

Description

In https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6237/files, we introduced default data source, and expect that if default data source is not set, the get call to uisettings would return null, which is not always the case. See in the recordings that for cases that a default data source is accidentally removed from UI, the data source id is empty string from api/opensearch-dashboards/settings API call. Thus instead of checking if the returned value is exactly null, we need to check if it is not blank/empty.

Issues Resolved

fixes #6835

Screenshot

fixdefault.mp4

Testing the changes

In the recording, the following steps were performed:

  • enable data source

before change:

  • check the api/opensearch-dashboards/settings which has empty string for the default data source
  • creating data source will not make it default data source

after change:

  • check the api/opensearch-dashboards/settings which has empty string for the default data source
  • creating data source will make it default data source

Changelog

  • fix: fix not setting the default data source when creating data source bug

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Signed-off-by: Lu Yu <nluyu@amazon.com>
Copy link
Member

@zhongnansu zhongnansu left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.40%. Comparing base (016dcfd) to head (14b4e42).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6908   +/-   ##
=======================================
  Coverage   67.39%   67.40%           
=======================================
  Files        3444     3444           
  Lines       67847    67847           
  Branches    11035    11035           
=======================================
+ Hits        45727    45733    +6     
+ Misses      19452    19448    -4     
+ Partials     2668     2666    -2     
Flag Coverage Δ
Linux_1 33.08% <ø> (ø)
Linux_2 55.12% <ø> (ø)
Linux_3 45.25% <100.00%> (ø)
Linux_4 34.82% <0.00%> (ø)
Windows_1 ?
Windows_2 55.09% <ø> (ø)
Windows_3 45.26% <100.00%> (?)
Windows_4 34.82% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@zhyuanqi
Copy link
Collaborator

zhyuanqi commented Jun 4, 2024

Hi Lu. Thanks for fixing the issue. For cases that a default data source is accidentally removed from UI, you mean that customer delete the datasource?

@BionIT BionIT merged commit b2ff7de into opensearch-project:main Jun 5, 2024
67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 5, 2024
* fix default data source bug

Signed-off-by: Lu Yu <nluyu@amazon.com>

* Changeset file for PR #6908 created/updated

---------

Signed-off-by: Lu Yu <nluyu@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit b2ff7de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
BionIT pushed a commit that referenced this pull request Jun 5, 2024
* fix default data source bug



* Changeset file for PR #6908 created/updated

---------



(cherry picked from commit b2ff7de)

Signed-off-by: Lu Yu <nluyu@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
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.

[BUG] Set default data source unstable issue
4 participants