-
Notifications
You must be signed in to change notification settings - Fork 93
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 list of monitor ids in Chained Monitor Findings #514
Conversation
Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: Surya Sashank Nistala <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #514 +/- ##
============================================
+ Coverage 74.60% 74.63% +0.02%
- Complexity 868 872 +4
============================================
Files 130 130
Lines 5632 5662 +30
Branches 689 697 +8
============================================
+ Hits 4202 4226 +24
- Misses 1124 1130 +6
Partials 306 306
|
@@ -30,7 +30,7 @@ class IndexWorkflowRequest : ActionRequest { | |||
refreshPolicy: WriteRequest.RefreshPolicy, | |||
method: RestRequest.Method, | |||
workflow: Workflow, | |||
rbacRoles: List<String>? = null | |||
rbacRoles: List<String>? = null, |
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.
is the ,
required?
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.
reverted
} | ||
|
||
@Throws(IOException::class) | ||
constructor(sin: StreamInput) : this( | ||
sin.readString(), // monitorId | ||
sin.readOptionalString(), // monitorId | ||
Collections.unmodifiableList(sin.readStringList()) |
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 we use kotlin toList
here?
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.
Any specific reason to use toList
?
Collections.unmodifiableList
has been used across the code base to wrap string lists read from stream input
fun asTemplateArg(): Map<String, Any> { | ||
return mapOf( | ||
MONITOR_ID_FIELD to monitorId, | ||
) | ||
MONITOR_IDS_FIELD to monitorIds |
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.
is it possible we merge these 2 fields to 1? it looks little complex that we have both
MONITOR_ID_FIELD to monitorId,
MONITOR_IDS_FIELD to monitorIds```
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 need to have both for backward compatibility.
Signed-off-by: Surya Sashank Nistala <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/common-utils/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.x
# Create a new branch
git switch --create backport-514-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7736e080f9b0a2f6f2d9ad3b4272090b281ea8fa
# Push it to GitHub
git push --set-upstream origin backport-514-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.x Then, create a pull request where the |
…roject#514) support list of monitor ids in Chained Monitor Findings Signed-off-by: Surya Sashank Nistala <[email protected]>
support list of monitor ids in Chained Monitor Findings Signed-off-by: Surya Sashank Nistala <[email protected]>
…roject#514) (opensearch-project#515) support list of monitor ids in Chained Monitor Findings Signed-off-by: Surya Sashank Nistala <[email protected]> Signed-off-by: AWSHurneyt <[email protected]>
Adds support for passing a list monitor ids in chained monitor findings. This helps filter data of a monitor in workflow based on findings of multiple monitors instead of a single monitor.
If workflow sequence looks like:
[m1] -> [m2] -> [m3 (chained findings of m1, m2)]
this means m3's data input would be the related doc ids from findings of m1 and m2.
for backward compatibility reasons, the monitorId field would be given preference over the new list type field, monitorIds, if both are provided.