Skip to content

Commit 1109526

Browse files
author
Leo
committed
Merge branch 'main' into fix/connectTimeout
2 parents f469469 + b5e5642 commit 1109526

130 files changed

Lines changed: 10778 additions & 4307 deletions

File tree

Some content is hidden

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

.github/workflows/dependabot_pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
uses: actions/checkout@v4
2929
with:
3030
token: ${{ steps.github_app_token.outputs.token }}
31+
ref: ${{ github.event.pull_request.head.ref }}
32+
repository: ${{ github.event.pull_request.head.repo.full_name }}
3133

3234
- id: version
3335
run: |

.github/workflows/publish-snapshots.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
java-version: '21'
2121
distribution: 'temurin'
2222
cache: 'gradle'
23-
- name: Configure AWS credentials
24-
uses: aws-actions/configure-aws-credentials@v4
23+
- name: Load secret
24+
uses: 1password/load-secrets-action@v2
2525
with:
26-
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
27-
aws-region: us-east-1
26+
# Export loaded secrets as environment variables
27+
export-env: true
28+
env:
29+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
30+
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
31+
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
2832
- name: publish snapshots to maven
2933
run: |
30-
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
31-
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
32-
echo "::add-mask::$SONATYPE_USERNAME"
33-
echo "::add-mask::$SONATYPE_PASSWORD"
3434
./gradlew --no-daemon publishPublishMavenPublicationToSnapshotsRepository

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
# CHANGELOG
22
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
33

4+
## [Unreleased 4.x]
5+
6+
### Dependencies
7+
- Bump `org.junit:junit-bom` from 5.13.1 to 5.13.2 ([#1650](https://github.com/opensearch-project/opensearch-java/pull/1650))
8+
- Bump `io.github.classgraph:classgraph` from 4.8.179 to 4.8.180 ([#1651](https://github.com/opensearch-project/opensearch-java/pull/1651))
9+
410
## [Unreleased 3.x]
511
### Added
612
- Added support for Index Management plugin APIs ([#1604](https://github.com/opensearch-project/opensearch-java/pull/1604))
713
- Added support for the security plugin APIs ([#1601](https://github.com/opensearch-project/opensearch-java/pull/1601))
14+
- Jackson `ObjectMapper` modules are now being auto-detected ([#1643](https://github.com/opensearch-project/opensearch-java/pull/1643))
815

916
### Dependencies
1017
- Bump `org.owasp.dependencycheck` from 12.1.1 to 12.1.3 ([#1608](https://github.com/opensearch-project/opensearch-java/pull/1608), [#1607](https://github.com/opensearch-project/opensearch-java/pull/1607), [#1623](https://github.com/opensearch-project/opensearch-java/pull/1623))
1118
- Bump `org.junit:junit-bom` from 5.13.0 to 5.13.1 ([#1606](https://github.com/opensearch-project/opensearch-java/pull/1606))
1219
- Bump `org.ajoberstar.grgit:grgit-gradle` from 5.3.0 to 5.3.2 ([#1621](https://github.com/opensearch-project/opensearch-java/pull/1621))
20+
- Bump `org.opensearch.gradle:build-tools` from 3.1.0-SNAPSHOT to 3.2.0-SNAPSHOT ([#1642](https://github.com/opensearch-project/opensearch-java/pull/1642))
1321

1422
### Changed
23+
- Changed the type of the properties in DocStatus from integer to Long to resolve the integer overflow issue ([#1644](https://github.com/opensearch-project/opensearch-java/pull/1644))
1524

1625
### Deprecated
1726

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUC
5353
See [User Guide](USER_GUIDE.md).
5454

5555
## Snapshot Builds
56-
The [snapshots builds](https://aws.oss.sonatype.org/content/repositories/snapshots/org/opensearch/client/opensearch-java/) are published to sonatype using [publish-snapshots.yml](./.github/workflows/publish-snapshots.yml) workflow. Each `push` event to the main branch triggers this workflow.
56+
The [snapshots builds](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/org/opensearch/client/opensearch-java/) are published to sonatype using [publish-snapshots.yml](./.github/workflows/publish-snapshots.yml) workflow. Each `push` event to the main branch triggers this workflow.
5757

5858
## Compatibility with OpenSearch
5959

UPGRADING.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
* [UPGRADING](#upgrading)
2+
* [Upgrading from 2.x to 3.0](#upgrading-from-2x-to-30)
3+
* [Upgrading from 3.x to UNRELEASED](#upgrading-from-3x-to-unreleased)
4+
15
# UPGRADING
26

3-
## Upgrading 2.x to 3.0
7+
## Upgrading from 2.x to 3.0
48
### URL Path Encoding
59
- The default URL path encoding has been changed to be more conservative. Previously the `!`, `$`, `&`, `'`, `(`, `)`, `*`, `+`, `,`, `;`, `=`, `@` and `:` characters were left un-encoded, they will now be percent-encoded. If you require the previous behavior you can specify the `org.opensearch.path.encoding=HTTP_CLIENT_V4_EQUIV` system property.
610

@@ -704,4 +708,73 @@ After:
704708
- The `tBucketSerializer` property has been removed as it is unused.
705709

706710
### ExplainResponse
707-
- The `explanation` property is now of type `Explanation` instead of `ExplanationDetail`.
711+
- The `explanation` property is now of type `Explanation` instead of `ExplanationDetail`.
712+
713+
## Upgrading from 3.x to UNRELEASED
714+
### ExplainRequest
715+
- The `routing` property is now of type `List<String>` instead of `String`.
716+
717+
### ExplainResponse
718+
- The `tDocumentSerializer` property has been removed as it is unused.
719+
720+
### GetRequest
721+
- The `refresh` property has been corrected to be of type `Refresh` instead of `Boolean`.
722+
- The `routing` property is now of type `List<String>` instead of `String`.
723+
724+
### GetResponse
725+
- The `GetResponse` class now extends a `GetResultBase` class instead of `GetResult`.
726+
727+
### GetSourceRequest
728+
- The `refresh` property has been corrected to be of type `Refresh` instead of `Boolean`.
729+
- The `routing` property is now of type `List<String>` instead of `String`.
730+
- The `storedFields` property has been removed as it is not supported by OpenSearch.
731+
732+
### ScrollResponse
733+
- The `ScrollResponse` class now extends `SearchResult` directly instead of via `SearchResponse`.
734+
735+
### SearchResult
736+
- The `documents` property has been removed as it is not supported by OpenSearch.
737+
- The `maxScore` property has been removed as it is not supported by OpenSearch.
738+
- The `numReducePhases` property has been corrected to be of type `Integer` instead of `Long`.
739+
- The `tDocumentSerializer` property has been removed as it is unused.
740+
741+
### CompletionSuggestOption
742+
- The `score` property has been corrected to be of type `Float` instead of `Double`.
743+
744+
### SuggestVariant
745+
- The `_suggestionKind` method's naming has been corrected to `_suggestKind`.
746+
- The `_toSuggestion` method's naming has been corrected to `toSuggest`.
747+
748+
### SuggestOptionBuilders
749+
- The `SuggestOptionBuilders` class has been removed.
750+
751+
### SearchRequest
752+
- The `batchedReduceSize` property has been corrected to be of type `Integer` instead of `Long`.
753+
- The `indicesBoost` property is now of type `List<Map<String, Float>>` instead of `List<Map<String, Double>>`.
754+
- The `maxConcurrentShardRequests` property has been corrected to be of type `Integer` instead of `Long`.
755+
- The `minCompatibleShardNode` property has been removed as it is not supported by OpenSearch.
756+
- The `minScore` property has been corrected to be of type `Float` instead of `Double`.
757+
- The `preFilterShardSize` property has been corrected to be of type `Integer` instead of `Long`.
758+
- The `routing` property is now of type `List<String>` instead of `String`.
759+
- The `runtimeMappings` property has been removed as it is not supported by OpenSearch.
760+
- The `terminateAfter` property has been corrected to be of type `Integer` instead of `Long`.
761+
762+
### core.search.Pit renamed to PointInTimeReference
763+
- The `Pit` class has been renamed to `PointInTimeReference`, this affects:
764+
- `SearchRequest`'s `pit` field.
765+
- The `keepAlive` property has been corrected to be of type `Time` instead of `String`.
766+
767+
### SearchTemplateRequest
768+
- The `routing` property is now of type `List<String>` instead of `String`.
769+
770+
### LifecycleOperationMode
771+
- The `LifecycleOperationMode` enum has been removed as it is no longer used.
772+
773+
### RuntimeField
774+
- The `RuntimeField` class has been removed as it is not supported by OpenSearch.
775+
776+
### RuntimeFieldType
777+
- The `RuntimeFieldType` class has been removed as it is not supported by OpenSearch.
778+
779+
### MultiSearchItem
780+
- The `MultiSearchItem` class now extends `SearchResult` directly instead of via `SearchResponse`.

USER_GUIDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ OpenSearchTransport transport = new RestClientTransport(restClient, new JacksonJ
9999
OpenSearchClient client = new OpenSearchClient(transport);
100100
```
101101

102-
The `JacksonJsonpMapper` class (2.x versions) only supports Java 7 objects by default. [Java 8 modules](https://github.com/FasterXML/jackson-modules-java8) to support JDK8 classes such as the Date and Time API (JSR-310), `Optional`, and more can be used by including [the additional datatype dependency](https://github.com/FasterXML/jackson-modules-java8#usage) and adding the module. For example, to include JSR-310 classes:
102+
The `JacksonJsonpMapper` class (2.x versions) only supports Java 7 objects by default. [Java 8 modules](https://github.com/FasterXML/jackson-modules-java8) to support JDK8 classes such as the Date and Time API (JSR-310), `Optional`, and more can be used by including [the additional datatype dependency](https://github.com/FasterXML/jackson-modules-java8#usage) and adding the module. Auto-detection for these modules is enabled, adding them to the classpath is enough.
103+
You can also provide your own `ObjectMapper` instance if you need to pre-configure it differently, for example:
103104

104105
```java
105106
OpenSearchTransport transport = new RestClientTransport(restClient,
106-
new JacksonJsonpMapper(new ObjectMapper().registerModule(new JavaTimeModule())));
107+
new JacksonJsonpMapper(new ObjectMapper().findAndRegisterModules().configure(SerializationFeature.INDENT_OUTPUT, true)));
107108
OpenSearchClient client = new OpenSearchClient(transport);
108109
```
109110

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ allprojects {
3838

3939
repositories {
4040
mavenLocal()
41+
maven(url = "https://central.sonatype.com/repository/maven-snapshots/")
4142
maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots")
4243
mavenCentral()
4344
gradlePluginPortal()

buildSrc/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ plugins {
3636

3737
repositories {
3838
mavenLocal()
39+
maven(url = "https://central.sonatype.com/repository/maven-snapshots/")
3940
maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots")
4041
mavenCentral()
4142
gradlePluginPortal()

java-client/build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ import java.io.FileWriter
3838
buildscript {
3939
repositories {
4040
mavenLocal()
41+
maven(url = "https://central.sonatype.com/repository/maven-snapshots/")
4142
maven(url = "https://aws.oss.sonatype.org/content/repositories/snapshots")
4243
mavenCentral()
4344
gradlePluginPortal()
4445
}
4546
dependencies {
46-
"classpath"(group = "org.opensearch.gradle", name = "build-tools", version = "3.1.0-SNAPSHOT")
47+
"classpath"(group = "org.opensearch.gradle", name = "build-tools", version = "3.2.0-SNAPSHOT")
4748
}
4849
}
4950

@@ -244,7 +245,7 @@ dependencies {
244245
implementation("org.eclipse", "yasson", "2.0.2")
245246

246247
// https://github.com/classgraph/classgraph
247-
testImplementation("io.github.classgraph:classgraph:4.8.179")
248+
testImplementation("io.github.classgraph:classgraph:4.8.180")
248249

249250
// Eclipse 1.0
250251
testImplementation("junit", "junit" , "4.13.2") {
@@ -317,7 +318,7 @@ tasks.withType<Jar> {
317318
publishing {
318319
repositories{
319320
if (version.toString().endsWith("SNAPSHOT")) {
320-
maven("https://aws.oss.sonatype.org/content/repositories/snapshots/") {
321+
maven("https://central.sonatype.com/repository/maven-snapshots/") {
321322
name = "Snapshots"
322323
credentials {
323324
username = System.getenv("SONATYPE_USERNAME")

0 commit comments

Comments
 (0)