Skip to content

Fix mutable script params for detector trigger actions (#1715)#1722

Open
thecodingshrimp wants to merge 1 commit into
opensearch-project:mainfrom
thecodingshrimp:fix-1715-mutable-script-params
Open

Fix mutable script params for detector trigger actions (#1715)#1722
thecodingshrimp wants to merge 1 commit into
opensearch-project:mainfrom
thecodingshrimp:fix-1715-mutable-script-params

Conversation

@thecodingshrimp
Copy link
Copy Markdown

@thecodingshrimp thecodingshrimp commented May 18, 2026

Description

This change fixes a detector create/update failure caused by using Java's immutable Collections.emptyMap() when constructing trigger action Script objects in DetectorTrigger#getActions().

The Alerting plugin consumes these script params from Kotlin and expects a mutable map implementation. Replacing the immutable empty map with new HashMap<>() prevents the kotlin.collections.EmptyMap cannot be cast to kotlin.collections.MutableMap exception and allows detector operations with trigger actions to succeed.

Related Issues

Resolves #1715, #1553, #1721

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

…oject#1715)

Signed-off-by: thecodingshrimp <leonard.stutzer@sap.com>
@thecodingshrimp
Copy link
Copy Markdown
Author

@andrross thx for encouraging

@andrross
Copy link
Copy Markdown
Member

@AWSHurneyt Can a maintainer review this PR?

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] Detector creation/update fails with Kotlin casting error: Collections.EmptyMap cannot be cast to MutableMap

2 participants