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

[MDS] Fix sample data to use datasources for TSVB visualizations #6940

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

huyaboo
Copy link
Member

@huyaboo huyaboo commented Jun 6, 2024

Description

This PR adds TSVB support for "Add Sample Data" when MDS is enabled

Issues Resolved

Closes #6936

Screenshot

Navigating when MDS is disabled

Screen.Recording.2024-06-05.at.5.25.01.PM.mov

Navigating when MDS is enabled

Screen.Recording.2024-06-05.at.5.20.01.PM.mov

Testing the changes

$ yarn test:jest src/plugins/home/server/services/sample_data/data_sets/util.test.ts
yarn run v1.22.22
$ scripts/use_node scripts/jest src/plugins/home/server/services/sample_data/data_sets/util.test.ts
ciGroups []
jest-haste-map: duplicate manual mock found: index
  The following files share their name; please delete one of them:
    * <rootDir>/src/plugins/vis_type_vega/public/expressions/__mocks__/index.ts
    * <rootDir>/src/core/server/saved_objects/import/__mocks__/index.ts

 PASS  src/plugins/home/server/services/sample_data/data_sets/util.test.ts
  getSavedObjectsWithDataSource()
    ✓ when processing Vega Visualization saved objects, it should attach data_source_name to each OpenSearch query (8 ms)
    ✓ should processing timeline saved object and add datasource name in the end (1 ms)
    ✓ should update index-pattern id and references with given data source
    ✓ when processing TSVB Visualization saved objects, it should attach data_source_id to the visState and add datasource reference (1 ms)
  getFinalSavedObjects()
    ✓ should return consistent saved object id and title when workspace id and data source provided (1 ms)
    ✓ should return consistent saved object id when workspace id
    ✓ should return consistent saved object id and title when data source id and title (1 ms)
    ✓ should return original saved objects when no workspace and data source provided

Test Suites: 1 passed, 1 total
Tests:       8 passed, 8 total
Snapshots:   0 total
Time:        3.287 s

When MDS is disabled

  • DataSourceSelector component should not be visible
  • TSVB should render data both in the visualization edit view and dashboard view

When MDS is enabled

  • DataSourceSelector component should be visible
  • TSVB should render data from the correct data source both in the visualization edit view and dashboard view
  • The DataSourceSelector should have the correct datasource option selected on initial render

Changelog

  • fix: Add TSVB Support for adding sample data

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

huyaboo and others added 2 commits June 5, 2024 17:36
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.43%. Comparing base (48144c8) to head (863368f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6940      +/-   ##
==========================================
- Coverage   67.43%   67.43%   -0.01%     
==========================================
  Files        3443     3443              
  Lines       67806    67811       +5     
  Branches    11031    11032       +1     
==========================================
+ Hits        45727    45730       +3     
- Misses      19413    19414       +1     
- Partials     2666     2667       +1     
Flag Coverage Δ
Linux_1 33.09% <ø> (ø)
Linux_2 55.06% <ø> (ø)
Linux_3 45.20% <ø> (+<0.01%) ⬆️
Linux_4 34.89% <100.00%> (+<0.01%) ⬆️
Windows_1 33.11% <ø> (ø)
Windows_2 55.03% <ø> (ø)
Windows_3 45.21% <ø> (ø)
Windows_4 34.89% <100.00%> (+<0.01%) ⬆️

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.

@zhongnansu zhongnansu self-assigned this Jun 6, 2024
@BionIT BionIT merged commit 61e29b5 into opensearch-project:main Jun 6, 2024
72 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 6, 2024
* Fix sample data to use datasources for TSVB visualizations

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>

* Changeset file for PR #6940 created/updated

---------

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 61e29b5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Jun 6, 2024
…) (#6943)

* Fix sample data to use datasources for TSVB visualizations



* Changeset file for PR #6940 created/updated

---------



(cherry picked from commit 61e29b5)

Signed-off-by: Huy Nguyen <73027756+huyaboo@users.noreply.github.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>
@huyaboo huyaboo deleted the tsvb-install-sample-data branch June 6, 2024 16:32
@zhongnansu zhongnansu added the multiple datasource multiple datasource project label Jun 10, 2024
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] Sample TSVB visualization is not rendering data with data source
3 participants