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

Fix search request missing a slash when no indices are given #471

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

Jakob3xD
Copy link
Collaborator

Description

Add missing / for search requests when not searching specific indices.

Issues Resolved

Closes #470

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.

@Jakob3xD
Copy link
Collaborator Author

Draft as I am waiting for a reply on the issue to maybe adjust the integration tests.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.29%. Comparing base (609bfef) to head (427bb04).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #471   +/-   ##
=======================================
  Coverage   57.29%   57.29%           
=======================================
  Files         315      315           
  Lines        9823     9823           
=======================================
  Hits         5628     5628           
  Misses       2902     2902           
  Partials     1293     1293           
Flag Coverage Δ
integration 50.83% <100.00%> (ø)
unit 12.84% <0.00%> (ø)

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

Files Coverage Δ
opensearchapi/api_search.go 100.00% <100.00%> (ø)

@dblock
Copy link
Member

dblock commented Feb 14, 2024

Definitely needs tests! Thanks for fixing this.

@dblock
Copy link
Member

dblock commented Mar 26, 2024

@Jakob3xD Want to finish this?

@Jakob3xD
Copy link
Collaborator Author

Jakob3xD commented Apr 2, 2024

@Jakob3xD Want to finish this?

Well, I can mark it as ready but I have no idea for testing this in a useful way for all endpoints.
We could add a unit test for each endpoint creating a requests and calling the GetRequest() function and check the URL if it stats with a /. But I am not sure this works.

@dblock
Copy link
Member

dblock commented Apr 2, 2024

@Jakob3xD Want to finish this?

Well, I can mark it as ready but I have no idea for testing this in a useful way for all endpoints. We could add a unit test for each endpoint creating a requests and calling the GetRequest() function and check the URL if it stats with a /. But I am not sure this works.

I would at a minimum add a test for this specific endpoint (this bug). But something that iterates over all APIs would be better.

dblock
dblock previously approved these changes Apr 3, 2024
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
Signed-off-by: Jakob Hahn <jakob.hahn@hetzner.com>
@dblock dblock merged commit 06a6dc8 into opensearch-project:main Apr 6, 2024
54 checks passed
@Jakob3xD Jakob3xD deleted the jh-fix-search branch April 7, 2024 09:14
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] The Search API (in Version 3.0.0) is not working without setting an Index
2 participants