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

[workspace]remove * when calling find in data source association modal and in workspace list page #9409

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Qxisylolo
Copy link
Contributor

@Qxisylolo Qxisylolo commented Feb 18, 2025

Description

This pr remove * when calling find in data source association modal and in workspace list page

Issues Resolved

Screenshot

Inside a workspace, and we want to find all the data sources which belong to the current workspaces, here we remove the client base path
截屏2025-02-19 18 34 00

Inside a workspace and open data source association modal, we want to find all the data sources, here we remove the client base path
截屏2025-02-18 14 54 09

in workspace list page, we also remove the client base path
截屏2025-02-18 14 57 59

Testing the changes

Changelog

  • fix: remove * when calling find in data source association modal and in workspace list page

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

opensearch-changeset-bot bot added a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Feb 18, 2025
Copy link

codecov bot commented Feb 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.71%. Comparing base (6cf56f0) to head (e40df3a).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9409   +/-   ##
=======================================
  Coverage   61.71%   61.71%           
=======================================
  Files        3817     3817           
  Lines       91862    91862           
  Branches    14552    14552           
=======================================
  Hits        56697    56697           
  Misses      31509    31509           
  Partials     3656     3656           
Flag Coverage Δ
Linux_1 29.00% <75.00%> (ø)
Linux_2 56.46% <100.00%> (ø)
Linux_3 39.20% <0.00%> (-0.01%) ⬇️
Linux_4 28.90% <0.00%> (ø)
Windows_1 29.01% <75.00%> (ø)
Windows_2 56.41% <100.00%> (ø)
Windows_3 39.20% <0.00%> (-0.01%) ⬇️
Windows_4 28.90% <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.

Signed-off-by: Qxisylolo <[email protected]>
Copy link
Contributor

Choose a reason for hiding this comment

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

We still pass '' to getDataSourcesList in line 367 of this file. Can we remove the '' argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okok, I miss it, thanks for noticing

Signed-off-by: Qxisylolo <[email protected]>
Comment on lines 408 to 409
const prependOptions =
query.workspaces === undefined ? { withoutClientBasePath: true } : undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Actually not very comfortable with this line. I am thinking if we can pass prependOptions directly instead of detecting whether there is workspaces inside query.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my initial thought is to directly pass prependOptions and already tested it, it worked well when calling inside a workspace, but I'm not sure then. already update~

@wanglam
Copy link
Contributor

wanglam commented Feb 20, 2025

@Qxisylolo Is it safe to remove the * filtering logic in workspace id consumer wrapper? It was added to get all data sources. But it seems we don't pass * now.

@Qxisylolo
Copy link
Contributor Author

Qxisylolo commented Feb 20, 2025

@Qxisylolo Is it safe to remove the '' filtering logic in workspace id consumer wrapper? It was added to get all data sources. But it seems we don't pass '' now.

we don't use this function to filter * now. perhaps we could remove it in find

const request: ReturnType<SavedObjectsApi['find']> = this.savedObjectsFetch(path, {
method: 'GET',
query,
prependOptions: { withoutClientBasePath: true },
Copy link
Member

Choose a reason for hiding this comment

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

Actually I am thinking:

savedObjectsClient.find({ ...otherParams, workspaces: null }, { prependOptions: { withoutClientBasePath: true } })

We should let client to decide how to make the call instead of removing the clientBasePath in the find method directly. It is a service used by many modules.

Copy link
Contributor

@wanglam wanglam left a comment

Choose a reason for hiding this comment

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

@Qxisylolo DCO failed for the latest commit, could you help to fix it?

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.

4 participants