Skip to content

Commit 403fcd1

Browse files
AWSHurneytcwperks
andauthored
[Backport 2.x] Fix bucket selector aggregation writeable name. (#1780) (#1785)
* Fixed pipeline aggregation registration. Signed-off-by: AWSHurneyt <[email protected]> * Updated unit tests. Signed-off-by: AWSHurneyt <[email protected]> * Moved unit tests to common utils where those assets are currently located. Signed-off-by: AWSHurneyt <[email protected]> * Adjusted workflows to refresh dependencies. Signed-off-by: AWSHurneyt <[email protected]> --------- Signed-off-by: AWSHurneyt <[email protected]> Co-authored-by: Craig Perkins <[email protected]>
1 parent a6285e9 commit 403fcd1

File tree

5 files changed

+8
-380
lines changed

5 files changed

+8
-380
lines changed

.github/workflows/multi-node-test-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ jobs:
4444
- name: Run integration tests with multi node config
4545
run: |
4646
chown -R 1000:1000 `pwd`
47-
su `id -un 1000` -c "whoami && java -version && ./gradlew integTest -PnumNodes=3"
47+
su `id -un 1000` -c "whoami && java -version && ./gradlew integTest -PnumNodes=3 --refresh-dependencies"

.github/workflows/security-test-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
java-version: ${{ matrix.java }}
3434
- name: Build Alerting
3535
# Only assembling since the full build is governed by other workflows
36-
run: ./gradlew assemble
36+
run: ./gradlew assemble --refresh-dependencies
3737
- name: Pull and Run Docker
3838
run: |
3939
plugin=`basename $(ls alerting/build/distributions/*.zip)`
@@ -87,7 +87,7 @@ jobs:
8787
if [ $security -gt 0 ]
8888
then
8989
echo "Security plugin is available"
90-
./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=myStrongPassword123!
90+
./gradlew :alerting:integTest --refresh-dependencies -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=myStrongPassword123!
9191
else
9292
echo "Security plugin is NOT available skipping this run as tests without security have already been run"
9393
fi

.github/workflows/test-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Build and run with Gradle
4848
run: |
4949
chown -R 1000:1000 `pwd`
50-
su `id -un 1000` -c "whoami && java -version && ./gradlew assemble integTest"
50+
su `id -un 1000` -c "whoami && java -version && ./gradlew assemble integTest --refresh-dependencies"
5151
- name: Create Artifact Path
5252
run: |
5353
mkdir -p alerting-artifacts
@@ -99,7 +99,7 @@ jobs:
9999
java-version: ${{ matrix.java }}
100100
- name: Build and run with Gradle
101101
working-directory: ${{ env.WORKING_DIR }}
102-
run: ./gradlew assemble ${{ env.BUILD_ARGS }}
102+
run: ./gradlew assemble ${{ env.BUILD_ARGS }} --refresh-dependencies
103103
env:
104104
_JAVA_OPTIONS: ${{ matrix.os_java_options }}
105105
- name: Create Artifact Path

alerting/src/main/kotlin/org/opensearch/alerting/AlertingPlugin.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import org.opensearch.common.settings.SettingsFilter
9797
import org.opensearch.commons.alerting.action.AlertingActions
9898
import org.opensearch.commons.alerting.action.DocLevelMonitorFanOutAction
9999
import org.opensearch.commons.alerting.aggregation.bucketselectorext.BucketSelectorExtAggregationBuilder
100+
import org.opensearch.commons.alerting.aggregation.bucketselectorext.BucketSelectorIndices
100101
import org.opensearch.commons.alerting.model.BucketLevelTrigger
101102
import org.opensearch.commons.alerting.model.ChainedAlertTrigger
102103
import org.opensearch.commons.alerting.model.ClusterMetricsInput
@@ -468,10 +469,8 @@ internal class AlertingPlugin : PainlessExtension, ActionPlugin, ScriptPlugin, R
468469
SearchPlugin.PipelineAggregationSpec(
469470
BucketSelectorExtAggregationBuilder.NAME,
470471
{ sin: StreamInput -> BucketSelectorExtAggregationBuilder(sin) },
471-
{ parser: XContentParser, agg_name: String ->
472-
BucketSelectorExtAggregationBuilder.parse(agg_name, parser)
473-
}
474-
)
472+
{ parser: XContentParser, agg_name: String -> BucketSelectorExtAggregationBuilder.parse(agg_name, parser) }
473+
).addResultReader({ sin: StreamInput -> BucketSelectorIndices(sin) })
475474
)
476475
}
477476

0 commit comments

Comments
 (0)