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

Add validations from appsec #562

Merged

Conversation

HenryL27
Copy link
Contributor

@HenryL27 HenryL27 commented Jan 26, 2024

Description

Adding validation for parameters of re-ranker processor.

Issues Resolved

#555

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed as per the DCO using --signoff

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.

Copy link

codecov bot commented Jan 26, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (55e840f) 84.70% compared to head (75adcac) 84.43%.

Files Patch % Lines
...ssor/rerank/context/QueryContextSourceFetcher.java 53.33% 5 Missing and 2 partials ⚠️
...g/opensearch/neuralsearch/plugin/NeuralSearch.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##             feature/reranker     #562      +/-   ##
======================================================
- Coverage               84.70%   84.43%   -0.27%     
- Complexity                600      603       +3     
======================================================
  Files                      48       48              
  Lines                    1804     1825      +21     
  Branches                  272      275       +3     
======================================================
+ Hits                     1528     1541      +13     
- Misses                    155      161       +6     
- Partials                  121      123       +2     

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

@martin-gaievski martin-gaievski changed the title add validations from appsec Add validations from appsec Jan 29, 2024
@heemin32
Copy link
Collaborator

Could you add which validations is this PR added in the description?

public void textRerankContext_whenQueryTextPathIsExceeedinglyDeeplyNested_ThenFail() throws IOException {
setupParams(Map.of(QueryContextSourceFetcher.QUERY_TEXT_PATH_FIELD, "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.w.x.y.z"));
setupSearchResults();
@SuppressWarnings("unchecked")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need this annotation? I don't see ActionListener<Map<String, Object>> listener = mock(ActionListener.class); is causing any warning in my local.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

¯_(ツ)_/¯. I get a warning when I remove it. Makes sense since it's a typecast from generic action listener to action listener for that map thingy.

Co-authored-by: Heemin Kim <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
@martin-gaievski martin-gaievski added v2.12.0 Issues targeting release v2.12.0 skip-changelog labels Jan 31, 2024
@martin-gaievski martin-gaievski merged commit d21d838 into opensearch-project:feature/reranker Jan 31, 2024
57 of 59 checks passed
@HenryL27
Copy link
Contributor Author

@martin-gaievski do we need to backport this?

@martin-gaievski
Copy link
Member

Yes, it will be backported later, along with other PRs for this feature. Idea is that all changes go to feature branch, once all steps are finalized it's merged to main in a separate PR and then backported from there to other branches like 2.x.

@HenryL27
Copy link
Contributor Author

oh right, forgot this was on a feature branch lol

martin-gaievski pushed a commit to martin-gaievski/neural-search that referenced this pull request Feb 6, 2024
* add validations from appsec

Signed-off-by: HenryL27 <[email protected]>
Co-authored-by: Heemin Kim <[email protected]>
@martin-gaievski martin-gaievski mentioned this pull request Feb 6, 2024
5 tasks
martin-gaievski pushed a commit that referenced this pull request Feb 6, 2024
* add validations from appsec

Signed-off-by: HenryL27 <[email protected]>
Co-authored-by: Heemin Kim <[email protected]>
Signed-off-by: Martin Gaievski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog v2.12.0 Issues targeting release v2.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants