-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add validations from appsec #562
Conversation
Codecov ReportAttention:
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. |
Signed-off-by: HenryL27 <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
3fe935c
to
9a6fe41
Compare
...ain/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java
Outdated
Show resolved
Hide resolved
Signed-off-by: HenryL27 <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
...ain/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java
Outdated
Show resolved
Hide resolved
Signed-off-by: HenryL27 <[email protected]>
...ain/java/org/opensearch/neuralsearch/processor/rerank/context/QueryContextSourceFetcher.java
Outdated
Show resolved
Hide resolved
Signed-off-by: HenryL27 <[email protected]>
Could you add which validations is this PR added in the description? |
...test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java
Outdated
Show resolved
Hide resolved
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") |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
...test/java/org/opensearch/neuralsearch/processor/rerank/MLOpenSearchRerankProcessorTests.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactoryTests.java
Outdated
Show resolved
Hide resolved
.../java/org/opensearch/neuralsearch/processor/rerank/context/DocumentContextSourceFetcher.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/neuralsearch/processor/factory/RerankProcessorFactory.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Heemin Kim <[email protected]> Signed-off-by: HenryL27 <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
Signed-off-by: HenryL27 <[email protected]>
d21d838
into
opensearch-project:feature/reranker
@martin-gaievski do we need to backport this? |
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. |
oh right, forgot this was on a feature branch lol |
* add validations from appsec Signed-off-by: HenryL27 <[email protected]> Co-authored-by: Heemin Kim <[email protected]>
* add validations from appsec Signed-off-by: HenryL27 <[email protected]> Co-authored-by: Heemin Kim <[email protected]> Signed-off-by: Martin Gaievski <[email protected]>
Description
Adding validation for parameters of re-ranker processor.
Issues Resolved
#555
Check List
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.