-
Notifications
You must be signed in to change notification settings - Fork 99
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
Fixing Issue #200 (Adding support for various ctx variable fields) #504
Conversation
* Added 2.1 release notes. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Added 2.1 release notes. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
…in various classes Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #504 +/- ##
============================================
- Coverage 76.89% 76.86% -0.03%
- Complexity 176 178 +2
============================================
Files 166 166
Lines 8370 8399 +29
Branches 1232 1232
============================================
+ Hits 6436 6456 +20
- Misses 1329 1340 +11
+ Partials 605 603 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -19,7 +20,7 @@ import org.opensearch.search.aggregations.pipeline.AbstractPipelineAggregationBu | |||
import org.opensearch.search.aggregations.pipeline.BucketHelpers.GapPolicy | |||
import org.opensearch.search.aggregations.pipeline.PipelineAggregator | |||
import java.io.IOException | |||
import java.util.Objects | |||
import java.util.* |
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.
We typically avoid wildcard imports since they are very generic in the libraries they end up including. If you're using Intellij, it is probably doing this for you automatically. You can refer to this to disable that behavior.
@@ -66,11 +70,13 @@ data class DocumentLevelTrigger( | |||
} | |||
|
|||
/** Returns a representation of the trigger suitable for passing into painless and mustache scripts. */ | |||
fun asTemplateArg(): Map<String, Any> { | |||
override fun asTemplateArg(): Map<String, Any?> { | |||
log.info("inside docleveltrigger astemplatearg") |
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.
Can remove this if it was only used for debugging purposes. Same goes for the other log.info
s in asTemplateArg()
s.
// WHEN | ||
val templateArgs = monitor.asTemplateArg() | ||
|
||
this.logger.info("template args in log: $templateArgs") |
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.
This can be removed.
assertEquals( | ||
"Template args monitor type does not match\nhere's templateArgs: $templateArgs \n" + | ||
"here's monitor: $monitor \n here's toXContent: ${monitor.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS)}", | ||
templateArgs[Monitor.MONITOR_TYPE_FIELD], monitor.monitorType.toString() | ||
) |
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 believe the assertion method will output the expected
and actual
arguments when the assertion fails but if you do want to keep the message as-is, using a raw string with variable templating might be a cleaner solution.
Example:
assertEquals(
"""
Template args monitor type does not match.
Template args was: $templateArgs
Monitor is: $monitor
""".trimIndent(),
templateArgs[Monitor.MONITOR_TYPE_FIELD], monitor.monitorType.toString()
)
@@ -0,0 +1,9 @@ | |||
## Version 2.1.0.0 2022-07-06 |
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.
This may have been pulled into the PR because your dev branch is old. Could you rebase your dev branch with the current main
?
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
…ensearch-project#502) * Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation: task rename updateVersion Signed-off-by: pgodithi <pgodithi@amazon.com> (cherry picked from commit 3b8bfe7) Signed-off-by: prudhvigodithi <pgodithi@amazon.com> Co-authored-by: Prudhvi Godithi <pgodithi@amazon.com>
….1.0.0 zip following deprecation of ODFE. (opensearch-project#510) (opensearch-project#511) Signed-off-by: AWSHurneyt <hurneyt@amazon.com> (cherry picked from commit fea6b4a) Co-authored-by: AWSHurneyt <hurneyt@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Signed-off-by: Dennis Toepker <toepkerd@amazon.com>
Closing this PR as there are many conflicts and many of the changes have been merged in this PR: opensearch-project/common-utils#318. May need to reopen another PR to add support for anything else missing. |
Signed-off-by: Dennis Toepker toepkerd@amazon.com
Issue #200
Added support for various ctx fields by implementing asTemplateArg() in various classes
CheckList:
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.