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

Support multi data source in Region map #6654

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

junqiu-lei
Copy link
Member

@junqiu-lei junqiu-lei commented Apr 26, 2024

Description

This PR adds the ability to use multi data source in Region maps. In API level, this PR contains updates for:

POST api/geospatial/_indices
POST api/geospatial/_search
POST api/geospatial/_mappings

Issues Resolved

Part of opensearch-project/dashboards-maps#584

Screenshot

Screen.Recording.2024-04-26.at.8.14.06.AM.mov

Testing the changes

Tests will be added in functional test repo in another PR

Changelog

  • skip

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

Copy link
Contributor

ℹ️ Manual Changeset Creation Reminder

Please ensure manual commit for changeset file 6654.yml under folder changelogs/fragments to complete this PR.

If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link.

For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool.

Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Copy link
Contributor

❌ Changeset File Not Added Yet

Please ensure manual commit for changeset file 6654.yml under folder changelogs/fragments to complete this PR. File still missing.

1 similar comment
Copy link
Contributor

❌ Changeset File Not Added Yet

Please ensure manual commit for changeset file 6654.yml under folder changelogs/fragments to complete this PR. File still missing.

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.77%. Comparing base (857f8cb) to head (a9bf162).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6654      +/-   ##
==========================================
- Coverage   67.79%   67.77%   -0.03%     
==========================================
  Files        3413     3413              
  Lines       66755    66755              
  Branches    10861    10861              
==========================================
- Hits        45256    45240      -16     
- Misses      18856    18871      +15     
- Partials     2643     2644       +1     
Flag Coverage Δ
Linux_1 33.18% <ø> (ø)
Linux_2 55.63% <ø> (ø)
Linux_3 ?
Linux_4 34.91% <ø> (ø)
Windows_1 ?
Windows_2 55.59% <ø> (ø)
Windows_3 45.25% <ø> (-0.02%) ⬇️
Windows_4 34.91% <ø> (ø)

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.

Copy link
Collaborator

@BionIT BionIT left a comment

Choose a reason for hiding this comment

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

Do we have unit/integ tests for the changes?

@junqiu-lei
Copy link
Member Author

Do we have unit/integ tests for the changes?

Will add integ tests in functional test repo.

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Apr 26, 2024
@BionIT BionIT added the v2.14.0 label Apr 26, 2024
@BionIT BionIT merged commit fea8202 into opensearch-project:main Apr 26, 2024
72 of 74 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 26, 2024
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit fea8202)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
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.

left some comments

@@ -14,20 +14,28 @@ export function registerGeospatialRoutes(router: IRouter) {
body: schema.object({
index: schema.string(),
}),
query: schema.maybe(schema.object({}, { unknowns: 'allow' })),
Copy link
Member

Choose a reason for hiding this comment

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

why we use { unknowns: 'allow' } here? isn't dataSourceId the only parameter allowed?

Comment on lines +76 to +81
if (!req.query.dataSourceId) {
client = context.core.opensearch.client.asCurrentUser;
} else {
// @ts-ignore
client = await context.dataSource.opensearch.getClient(req.query.dataSourceId);
}
Copy link
Member

Choose a reason for hiding this comment

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

can we extract this to be a util function for reuse? I saw 3 places are uses this

BionIT pushed a commit that referenced this pull request Apr 26, 2024
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
(cherry picked from commit fea8202)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
Signed-off-by: Junqiu Lei <junqiu@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x repeat-contributor Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants