Skip to content

Commit b37a473

Browse files
committed
Merge branch 'main' into simplify-security
2 parents 4ebcdff + 41db8c0 commit b37a473

File tree

218 files changed

+473
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+473
-396
lines changed

Diff for: .github/workflows/changelog_verifier.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Changelog Verifier"
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'whitesource-remediate/**'
6+
- 'backport/**'
7+
pull_request:
8+
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]
9+
10+
jobs:
11+
# Enforces the update of a changelog file on every pull request
12+
verify-changelog:
13+
if: github.repository == 'opensearch-project/anomaly-detection'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
- uses: dangoslen/changelog-enforcer@v3
22+
with:
23+
skipLabels: "autocut, skip-changelog"

Diff for: .github/workflows/test_build_multi_platform.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
needs: spotless
3030
strategy:
3131
matrix:
32-
java: [ 21 ]
32+
java: [21, 23]
3333
name: Build and Test Anomaly Detection Plugin on Windows
3434
runs-on: windows-latest
3535
env:
@@ -57,7 +57,7 @@ jobs:
5757
needs: [Get-CI-Image-Tag, spotless]
5858
strategy:
5959
matrix:
60-
java: [21]
60+
java: [21, 23]
6161
fail-fast: false
6262
name: Build and Test Anomaly detection Plugin on Linux
6363
runs-on: ubuntu-latest
@@ -95,7 +95,7 @@ jobs:
9595
needs: spotless
9696
strategy:
9797
matrix:
98-
java: [21]
98+
java: [21, 23]
9999
fail-fast: false
100100

101101
name: Build and Test Anomaly detection Plugin on MacOS

Diff for: CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# CHANGELOG
2+
All notable changes to this project are documented in this file.
3+
4+
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
5+
6+
## [Unreleased 3.0](https://github.com/opensearch-project/anomaly-detection/compare/2.x...HEAD)
7+
### Features
8+
### Enhancements
9+
### Bug Fixes
10+
### Infrastructure
11+
### Documentation
12+
### Maintenance
13+
### Refactoring
14+
15+
## [Unreleased 2.x](https://github.com/opensearch-project/anomaly-detection/compare/2.19...2.x)
16+
### Features
17+
18+
### Enhancements
19+
- Github workflow for changelog verification ([#1413](https://github.com/opensearch-project/anomaly-detection/pull/1413))
20+
### Bug Fixes
21+
### Infrastructure
22+
### Documentation
23+
### Maintenance
24+
### Refactoring

Diff for: DEVELOPER_GUIDE.md

+24
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Backports](#backports)
1212
- [Gradle Plugins](#gradle-plugins)
1313
- [Distribution Download Plugin](#distribution-download-plugin)
14+
- [Changelog](#changelog)
1415

1516
## Developer Guide
1617

@@ -102,3 +103,26 @@ The Distribution Download plugin downloads the latest version of OpenSearch by d
102103
```
103104
./gradlew integTest -PcustomDistributionUrl="https://ci.opensearch.org/ci/dbc/bundle-build/1.2.0/1127/linux/x64/dist/opensearch-1.2.0-linux-x64.tar.gz"
104105
```
106+
107+
## Changelog
108+
109+
AD maintains version specific changelog by enforcing a change to the ongoing [CHANGELOG](CHANGELOG.md) file adhering to the [Keep A Changelog](https://keepachangelog.com/en/1.1.0/) format.
110+
111+
Briefly, the changes are curated by version, with the changes to the main branch added chronologically to `Unreleased` version. Further, each version has corresponding sections which list out the category of the change - `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`.
112+
113+
#### How to add my changes to [CHANGELOG](CHANGELOG.md)?
114+
115+
As a contributor, you must ensure that every pull request has the changes listed out within the corresponding version and appropriate section of [CHANGELOG](CHANGELOG.md) file.
116+
117+
Adding in the change is two step process -
118+
1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR
119+
120+
`Your change here ([#PR_NUMBER](PR_URL))`
121+
122+
2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there.
123+
124+
[Example PR](https://github.com/opensearch-project/flow-framework/pull/998/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR24)
125+
126+
For future release notes, all entries can be directly copied to the release notes and then deleted from either the 2.x or 3.0 section as a cleanup. For example, see: https://github.com/opensearch-project/flow-framework/pull/1036/files
127+
128+
For changes that don't require an entry, we can add the 'skip-changelog' label to the PR. This will allow the changelog workflow to pass without adding an entry."

Diff for: build-tools/coverage.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
apply plugin: 'jacoco'
77

88
jacoco {
9-
toolVersion = "0.8.10"
9+
toolVersion = "0.8.12"
1010
}
1111

1212
/**

Diff for: build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ buildscript {
3535
ext {
3636
opensearch_group = "org.opensearch"
3737
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
38-
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
39-
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
38+
opensearch_version = System.getProperty("opensearch.version", "3.0.0-alpha1-SNAPSHOT")
39+
buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1")
4040
// 3.0.0-SNAPSHOT -> 3.0.0.0-SNAPSHOT
4141
version_tokens = opensearch_version.tokenize('-')
4242
opensearch_build = version_tokens[0] + '.0'
@@ -52,7 +52,7 @@ buildscript {
5252
js_resource_folder = "src/test/resources/job-scheduler"
5353
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
5454
job_scheduler_version = System.getProperty("job_scheduler.version", opensearch_build)
55-
bwcVersionShort = "2.19.0"
55+
bwcVersionShort = "2.20.0"
5656
bwcVersion = bwcVersionShort + ".0"
5757
bwcOpenSearchADDownload = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + bwcVersionShort + '/latest/linux/x64/tar/builds/' +
5858
'opensearch/plugins/opensearch-anomaly-detection-' + bwcVersion + '.zip'
@@ -82,7 +82,7 @@ buildscript {
8282
}
8383

8484
plugins {
85-
id 'com.netflix.nebula.ospackage' version "11.5.0"
85+
id 'com.netflix.nebula.ospackage' version "11.11.1"
8686
id "com.diffplug.spotless" version "6.25.0"
8787
id 'java-library'
8888
id 'org.gradle.test-retry' version '1.6.0'

Diff for: gradle/wrapper/gradle-wrapper.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionSha256Sum=2ab88d6de2c23e6adae7363ae6e29cbdd2a709e992929b48b6530fd0c7133bd6
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
45
networkTimeout=10000
56
validateDistributionUrl=true
67
zipStoreBase=GRADLE_USER_HOME
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Version 2.19.0.0 Release Notes
2+
3+
Compatible with OpenSearch 2.19.0
4+
5+
### Features
6+
* Allow triggering anomaly only on drop or rise of features ([#1358](https://github.com/opensearch-project/anomaly-detection/pull/1358))
7+
* Add flattens custom result index when enabled ([#1401](https://github.com/opensearch-project/anomaly-detection/pull/1401)), ([#1409](https://github.com/opensearch-project/anomaly-detection/pull/1409))
8+
9+
### Enhancements
10+
* Changing replica count to up 2 for custom result index ([#1362](https://github.com/opensearch-project/anomaly-detection/pull/1362))
11+
12+
### Bug Fixes
13+
* Not blocking detector creation on unknown feature validation error ([#1366](https://github.com/opensearch-project/anomaly-detection/pull/1366))
14+
* Fix exceptions in IntervalCalculation and ResultIndexingHandler ([#1379](https://github.com/opensearch-project/anomaly-detection/pull/1379))
15+
16+
### Infrastructure
17+
* Bump codecov/codecov-action from 4 to 5 ([#1369](https://github.com/opensearch-project/anomaly-detection/pull/1369))
18+
* Bump com.google.code.gson:gson from 2.8.9 to 2.11.0 ([#1375](https://github.com/opensearch-project/anomaly-detection/pull/1375))
19+
* Bump jackson from 2.18.0 to 2.18.2 ([#1376](https://github.com/opensearch-project/anomaly-detection/pull/1376))
20+
* Bump org.apache.commons:commons-lang3 from 3.13.0 to 3.17.0 ([#1377](https://github.com/opensearch-project/anomaly-detection/pull/1377))
21+
* Bump org.objenesis:objenesis from 3.3 to 3.4 ([#1393](https://github.com/opensearch-project/anomaly-detection/pull/1393))
22+
* Updating several dependencies ([#1368](https://github.com/opensearch-project/anomaly-detection/pull/1368))
23+
* Update recency_emphasis to be greater than 1 in test cases ([#1406](https://github.com/opensearch-project/anomaly-detection/pull/1406))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Version 3.0.0.0-alpha1 Release Notes
2+
3+
Compatible with OpenSearch 3.0.0.0-alpha1
4+
5+
### Maintenance
6+
- Fix breaking changes for 3.0.0 release ([#1424](https://github.com/opensearch-project/anomaly-detection/pull/1424))

Diff for: src/main/java/org/opensearch/ad/ADEntityProfileRunner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
import org.opensearch.ad.model.AnomalyResult;
1717
import org.opensearch.ad.settings.ADNumericSetting;
1818
import org.opensearch.ad.transport.ADEntityProfileAction;
19-
import org.opensearch.client.Client;
2019
import org.opensearch.core.xcontent.NamedXContentRegistry;
2120
import org.opensearch.timeseries.AnalysisType;
2221
import org.opensearch.timeseries.EntityProfileRunner;
2322
import org.opensearch.timeseries.util.SecurityClientUtil;
23+
import org.opensearch.transport.client.Client;
2424

2525
public class ADEntityProfileRunner extends EntityProfileRunner<ADEntityProfileAction> {
2626

Diff for: src/main/java/org/opensearch/ad/ADTaskProfileRunner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
import org.opensearch.ad.transport.ADTaskProfileAction;
1616
import org.opensearch.ad.transport.ADTaskProfileNodeResponse;
1717
import org.opensearch.ad.transport.ADTaskProfileRequest;
18-
import org.opensearch.client.Client;
1918
import org.opensearch.core.action.ActionListener;
2019
import org.opensearch.timeseries.TaskProfileRunner;
2120
import org.opensearch.timeseries.cluster.HashRing;
2221
import org.opensearch.timeseries.model.EntityTaskProfile;
22+
import org.opensearch.transport.client.Client;
2323

2424
public class ADTaskProfileRunner implements TaskProfileRunner<ADTask, ADTaskProfile> {
2525
public final Logger logger = LogManager.getLogger(ADTaskProfileRunner.class);

Diff for: src/main/java/org/opensearch/ad/AnomalyDetectorProfileRunner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
import org.opensearch.ad.task.ADTaskCacheManager;
2525
import org.opensearch.ad.task.ADTaskManager;
2626
import org.opensearch.ad.transport.ADProfileAction;
27-
import org.opensearch.client.Client;
2827
import org.opensearch.core.xcontent.NamedXContentRegistry;
2928
import org.opensearch.timeseries.AnalysisType;
3029
import org.opensearch.timeseries.ProfileRunner;
3130
import org.opensearch.timeseries.model.ProfileName;
3231
import org.opensearch.timeseries.util.DiscoveryNodeFilterer;
3332
import org.opensearch.timeseries.util.SecurityClientUtil;
3433
import org.opensearch.transport.TransportService;
34+
import org.opensearch.transport.client.Client;
3535

3636
/**
3737
* Since version 2.15, we have merged the single-stream and HC detector workflows. Consequently, separate logic for profiling is no longer necessary.

Diff for: src/main/java/org/opensearch/ad/ExecuteADResultResponseRecorder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.opensearch.ad.task.ADTaskCacheManager;
2626
import org.opensearch.ad.task.ADTaskManager;
2727
import org.opensearch.ad.transport.ADProfileAction;
28-
import org.opensearch.client.Client;
2928
import org.opensearch.commons.authuser.User;
3029
import org.opensearch.threadpool.ThreadPool;
3130
import org.opensearch.timeseries.AnalysisType;
@@ -36,6 +35,7 @@
3635
import org.opensearch.timeseries.transport.ResultResponse;
3736
import org.opensearch.timeseries.transport.handler.ResultBulkIndexingHandler;
3837
import org.opensearch.timeseries.util.DiscoveryNodeFilterer;
38+
import org.opensearch.transport.client.Client;
3939

4040
public class ExecuteADResultResponseRecorder extends
4141
ExecuteResultResponseRecorder<ADIndex, ADIndexManagement, ADTaskCacheManager, ADTaskType, ADTask, ADTaskManager, AnomalyResult, ADProfileAction> {

Diff for: src/main/java/org/opensearch/ad/client/AnomalyDetectionNodeClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
import org.opensearch.ad.transport.GetAnomalyDetectorResponse;
1414
import org.opensearch.ad.transport.SearchAnomalyDetectorAction;
1515
import org.opensearch.ad.transport.SearchAnomalyResultAction;
16-
import org.opensearch.client.Client;
1716
import org.opensearch.core.action.ActionListener;
1817
import org.opensearch.core.action.ActionResponse;
1918
import org.opensearch.core.common.io.stream.NamedWriteableRegistry;
2019
import org.opensearch.timeseries.transport.GetConfigRequest;
20+
import org.opensearch.transport.client.Client;
2121

2222
public class AnomalyDetectionNodeClient implements AnomalyDetectionClient {
2323
private final Client client;

Diff for: src/main/java/org/opensearch/ad/indices/ADIndexManagement.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.opensearch.ad.constant.ADCommonName;
3434
import org.opensearch.ad.model.AnomalyDetector;
3535
import org.opensearch.ad.model.AnomalyResult;
36-
import org.opensearch.client.Client;
3736
import org.opensearch.cluster.service.ClusterService;
3837
import org.opensearch.common.settings.Settings;
3938
import org.opensearch.common.xcontent.XContentType;
@@ -45,6 +44,7 @@
4544
import org.opensearch.timeseries.common.exception.EndRunException;
4645
import org.opensearch.timeseries.indices.IndexManagement;
4746
import org.opensearch.timeseries.util.DiscoveryNodeFilterer;
47+
import org.opensearch.transport.client.Client;
4848

4949
import com.fasterxml.jackson.databind.ObjectMapper;
5050

Diff for: src/main/java/org/opensearch/ad/ml/ADCheckpointDao.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
import org.opensearch.ad.constant.ADCommonName;
3939
import org.opensearch.ad.indices.ADIndex;
4040
import org.opensearch.ad.indices.ADIndexManagement;
41-
import org.opensearch.client.Client;
4241
import org.opensearch.core.action.ActionListener;
4342
import org.opensearch.index.IndexNotFoundException;
4443
import org.opensearch.index.query.MatchQueryBuilder;
@@ -52,6 +51,7 @@
5251
import org.opensearch.timeseries.ml.SingleStreamModelIdMapper;
5352
import org.opensearch.timeseries.model.Entity;
5453
import org.opensearch.timeseries.util.ClientUtil;
54+
import org.opensearch.transport.client.Client;
5555

5656
import com.amazon.randomcutforest.RandomCutForest;
5757
import com.amazon.randomcutforest.config.Precision;

Diff for: src/main/java/org/opensearch/ad/rest/RestAnomalyDetectorJobAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.opensearch.ad.constant.ADCommonMessages;
2424
import org.opensearch.ad.settings.ADEnabledSetting;
2525
import org.opensearch.ad.transport.AnomalyDetectorJobAction;
26-
import org.opensearch.client.node.NodeClient;
2726
import org.opensearch.cluster.service.ClusterService;
2827
import org.opensearch.common.settings.Settings;
2928
import org.opensearch.common.unit.TimeValue;
@@ -33,6 +32,7 @@
3332
import org.opensearch.timeseries.model.DateRange;
3433
import org.opensearch.timeseries.rest.RestJobAction;
3534
import org.opensearch.timeseries.transport.JobRequest;
35+
import org.opensearch.transport.client.node.NodeClient;
3636

3737
import com.google.common.collect.ImmutableList;
3838

Diff for: src/main/java/org/opensearch/ad/rest/RestDeleteAnomalyDetectorAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
import org.opensearch.ad.constant.ADCommonMessages;
2121
import org.opensearch.ad.settings.ADEnabledSetting;
2222
import org.opensearch.ad.transport.DeleteAnomalyDetectorAction;
23-
import org.opensearch.client.node.NodeClient;
2423
import org.opensearch.rest.BaseRestHandler;
2524
import org.opensearch.rest.RestRequest;
2625
import org.opensearch.rest.action.RestToXContentListener;
2726
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin;
2827
import org.opensearch.timeseries.transport.DeleteConfigRequest;
28+
import org.opensearch.transport.client.node.NodeClient;
2929

3030
import com.google.common.collect.ImmutableList;
3131

Diff for: src/main/java/org/opensearch/ad/rest/RestDeleteAnomalyResultsAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import org.opensearch.ad.constant.ADCommonMessages;
2323
import org.opensearch.ad.settings.ADEnabledSetting;
2424
import org.opensearch.ad.transport.DeleteAnomalyResultsAction;
25-
import org.opensearch.client.node.NodeClient;
2625
import org.opensearch.core.action.ActionListener;
2726
import org.opensearch.core.rest.RestStatus;
2827
import org.opensearch.core.xcontent.ToXContent;
@@ -33,6 +32,7 @@
3332
import org.opensearch.rest.RestRequest;
3433
import org.opensearch.search.builder.SearchSourceBuilder;
3534
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin;
35+
import org.opensearch.transport.client.node.NodeClient;
3636

3737
import com.google.common.collect.ImmutableList;
3838

Diff for: src/main/java/org/opensearch/ad/rest/RestExecuteAnomalyDetectorAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.opensearch.ad.settings.ADEnabledSetting;
2929
import org.opensearch.ad.transport.AnomalyResultAction;
3030
import org.opensearch.ad.transport.AnomalyResultRequest;
31-
import org.opensearch.client.node.NodeClient;
3231
import org.opensearch.cluster.service.ClusterService;
3332
import org.opensearch.common.settings.Settings;
3433
import org.opensearch.common.unit.TimeValue;
@@ -39,6 +38,7 @@
3938
import org.opensearch.rest.RestRequest;
4039
import org.opensearch.rest.action.RestToXContentListener;
4140
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin;
41+
import org.opensearch.transport.client.node.NodeClient;
4242

4343
import com.google.common.collect.ImmutableList;
4444

Diff for: src/main/java/org/opensearch/ad/rest/RestGetAnomalyDetectorAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
import org.opensearch.ad.constant.ADCommonMessages;
2525
import org.opensearch.ad.settings.ADEnabledSetting;
2626
import org.opensearch.ad.transport.GetAnomalyDetectorAction;
27-
import org.opensearch.client.node.NodeClient;
2827
import org.opensearch.rest.BaseRestHandler;
2928
import org.opensearch.rest.RestRequest;
3029
import org.opensearch.rest.action.RestActions;
3130
import org.opensearch.rest.action.RestToXContentListener;
3231
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin;
3332
import org.opensearch.timeseries.transport.GetConfigRequest;
3433
import org.opensearch.timeseries.util.RestHandlerUtils;
34+
import org.opensearch.transport.client.node.NodeClient;
3535

3636
import com.google.common.collect.ImmutableList;
3737

Diff for: src/main/java/org/opensearch/ad/rest/RestIndexAnomalyDetectorAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.opensearch.ad.transport.IndexAnomalyDetectorAction;
3131
import org.opensearch.ad.transport.IndexAnomalyDetectorRequest;
3232
import org.opensearch.ad.transport.IndexAnomalyDetectorResponse;
33-
import org.opensearch.client.node.NodeClient;
3433
import org.opensearch.cluster.service.ClusterService;
3534
import org.opensearch.common.settings.Settings;
3635
import org.opensearch.core.rest.RestStatus;
@@ -43,6 +42,7 @@
4342
import org.opensearch.rest.RestResponse;
4443
import org.opensearch.rest.action.RestResponseListener;
4544
import org.opensearch.timeseries.TimeSeriesAnalyticsPlugin;
45+
import org.opensearch.transport.client.node.NodeClient;
4646

4747
import com.google.common.collect.ImmutableList;
4848

Diff for: src/main/java/org/opensearch/ad/rest/RestPreviewAnomalyDetectorAction.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public String getName() {
5353
}
5454

5555
@Override
56-
protected RestChannelConsumer prepareRequest(RestRequest request, org.opensearch.client.node.NodeClient client) throws IOException {
56+
protected RestChannelConsumer prepareRequest(RestRequest request, org.opensearch.transport.client.node.NodeClient client)
57+
throws IOException {
5758
if (!ADEnabledSetting.isADEnabled()) {
5859
throw new IllegalStateException(ADCommonMessages.DISABLED_ERR_MSG);
5960
}

0 commit comments

Comments
 (0)