Skip to content

Commit

Permalink
Merge branch 'main' into feature/fix-flat_object-long-field-error
Browse files Browse the repository at this point in the history
Signed-off-by: Naomichi Yamakita <[email protected]>
  • Loading branch information
naomichi-y authored Apr 22, 2024
2 parents 0ade2bd + 4e58cef commit 85dafbf
Show file tree
Hide file tree
Showing 76 changed files with 1,082 additions and 527 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/detect-breaking-change.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Detect Breaking Changes"
on:
pull_request
pull_request:
branches-ignore:
- main # This branch represents a to-be-released version of OpenSearch where breaking changes are allowed

jobs:
detect-breaking-change:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Bump `gradle/wrapper-validation-action` from 2 to 3 ([#13192](https://github.com/opensearch-project/OpenSearch/pull/13192))
- Bump joda from 2.12.2 to 2.12.7 ([#13193](https://github.com/opensearch-project/OpenSearch/pull/13193))
- Bump bouncycastle from 1.77 to 1.78 ([#13243](https://github.com/opensearch-project/OpenSearch/pull/13243))
- Update google dependencies in repository-gcs and discovery-gce ([#13213](https://github.com/opensearch-project/OpenSearch/pull/13213))

### Changed
- [BWC and API enforcement] Enforcing the presence of API annotations at build time ([#12872](https://github.com/opensearch-project/OpenSearch/pull/12872))
- Improve built-in secure transports support ([#12907](https://github.com/opensearch-project/OpenSearch/pull/12907))
- Update links to documentation in rest-api-spec ([#13043](https://github.com/opensearch-project/OpenSearch/pull/13043))
- Ignoring unavailable shards during search request execution with ignore_available parameter ([#13298](https://github.com/opensearch-project/OpenSearch/pull/13298))
- Refactoring globMatch using simpleMatchWithNormalizedStrings from Regex ([#13104](https://github.com/opensearch-project/OpenSearch/pull/13104))
- [BWC and API enforcement] Reconsider the breaking changes check policy to detect breaking changes against released versions ([#13292](https://github.com/opensearch-project/OpenSearch/pull/13292))

### Deprecated

Expand All @@ -55,8 +58,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix issue with feature flags where default value may not be honored ([#12849](https://github.com/opensearch-project/OpenSearch/pull/12849))
- Fix UOE While building Exists query for nested search_as_you_type field ([#12048](https://github.com/opensearch-project/OpenSearch/pull/12048))
- Client with Java 8 runtime and Apache HttpClient 5 Transport fails with java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer ([#13100](https://github.com/opensearch-project/opensearch-java/pull/13100))
- Enabled mockTelemetryPlugin for IT and fixed OOM issues ([#13054](https://github.com/opensearch-project/OpenSearch/pull/13054))
- Fix implement mark() and markSupported() in class FilterStreamInput ([#13098](https://github.com/opensearch-project/OpenSearch/pull/13098))
- Fix snapshot _status API to return correct status for partial snapshots ([#12812](https://github.com/opensearch-project/OpenSearch/pull/12812))
- Improve the error messages for _stats with closed indices ([#13012](https://github.com/opensearch-project/OpenSearch/pull/13012))
- Ignore BaseRestHandler unconsumed content check as it's always consumed. ([#13290](https://github.com/opensearch-project/OpenSearch/pull/13290))
- Fix mapper_parsing_exception when using flat_object fields with names longer than 11 characters ([#13259](https://github.com/opensearch-project/OpenSearch/pull/13259))

### Security
Expand Down
15 changes: 15 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
- [Developer API](#developer-api)
- [User API](#user-api)
- [Experimental Development](#experimental-development)
- [API Compatibility Checks](#api-compatibility-checks)
- [Backports](#backports)
- [LineLint](#linelint)
- [Lucene Snapshots](#lucene-snapshots)
Expand Down Expand Up @@ -607,6 +608,20 @@ a LTS feature but with additional guard rails and communication mechanisms to si
release, or be removed altogether. Any Developer or User APIs implemented along with the experimental feature should be marked with `@ExperimentalApi` (or documented as
`@opensearch.experimental`) annotation to signal the implementation is not subject to LTS and does not follow backwards compatibility guidelines.

#### API Compatibility Checks

The compatibility checks for public APIs are performed using [japicmp](https://siom79.github.io/japicmp/) and are available as separate Gradle tasks (those are run on demand at the moment):

```
./gradlew japicmp
```

By default, the API compatibility checks are run against the latest released version of the OpenSearch, however the target version to compare to could be provided using system property during the build, fe.:

```
./gradlew japicmp -Djapicmp.compare.version=2.14.0-SNAPSHOT
```

### Backports

The Github workflow in [`backport.yml`](.github/workflows/backport.yml) creates backport PRs automatically when the original PR with an appropriate label `backport <backport-branch-name>` is merged to main with the backport workflow run successfully on the PR. For example, if a PR on main needs to be backported to `1.x` branch, add a label `backport 1.x` to the PR and make sure the backport workflow runs on the PR along with other checks. Once this PR is merged to main, the workflow will create a backport PR to the `1.x` branch.
Expand Down
7 changes: 4 additions & 3 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ This will instruct all JVMs (including any that run cli tools such as creating t
- In order to remotely attach a debugger to the process: `--debug-jvm`
- In order to set a different keystore password: `--keystore-password yourpassword`
- In order to set an OpenSearch setting, provide a setting with the following prefix: `-Dtests.opensearch.`
- In order to enable stack trace of the MockSpanData during testing, add: `-Dtests.telemetry.span.stack_traces=true` (Storing stack traces alongside span data can be useful for comprehensive debugging and performance optimization during testing, as it provides insights into the exact code paths and execution sequences, facilitating efficient issue identification and resolution. Note: Enabling this might lead to OOM issues while running ITs)

## Test case filtering

Expand Down Expand Up @@ -412,8 +413,8 @@ Say you need to make a change to `main` and have a BWC layer in `5.x`. You will
You may want to run BWC tests for a secure OpenSearch cluster. In order to do this, you will need to follow a few additional steps:

1. Clone the OpenSearch Security repository from https://github.com/opensearch-project/security.
2. Get both the old version of the Security plugin (the version you wish to come from) and the new version of the Security plugin (the version you wish to go to). This can be done either by fetching the maven artifact with a command like `wget https://repo1.maven.org/maven2/org/opensearch/plugin/opensearch-security/<TARGET_VERSION>.0/opensearch-security-<TARGET_VERSION>.0.zip` or by running `./gradlew assemble` from the base of the Security repository.
3. Move both of the Security artifacts into new directories at the path `/security/bwc-test/src/test/resources/<TARGET_VERSION>.0`. You should end up with two different directories in `/security/bwc-test/src/test/resources/`, one named the old version and one the new version.
2. Get both the old version of the Security plugin (the version you wish to come from) and the new version of the Security plugin (the version you wish to go to). This can be done either by fetching the maven artifact with a command like `wget https://repo1.maven.org/maven2/org/opensearch/plugin/opensearch-security/<TARGET_VERSION>.0/opensearch-security-<TARGET_VERSION>.0.zip` or by running `./gradlew assemble` from the base of the Security repository.
3. Move both of the Security artifacts into new directories at the path `/security/bwc-test/src/test/resources/<TARGET_VERSION>.0`. You should end up with two different directories in `/security/bwc-test/src/test/resources/`, one named the old version and one the new version.
4. Run the following command from the base of the Security repository:

```
Expand All @@ -428,7 +429,7 @@ You may want to run BWC tests for a secure OpenSearch cluster. In order to do th

`-Dtests.security.manager=false` handles access issues when attempting to read the certificates from the file system.
`-Dtests.opensearch.http.protocol=https` tells the wait for cluster startup task to do the right thing.
`-PcustomDistributionUrl=...` uses a custom build of the distribution of OpenSearch. This is unnecessary when running against standard/unmodified OpenSearch core distributions.
`-PcustomDistributionUrl=...` uses a custom build of the distribution of OpenSearch. This is unnecessary when running against standard/unmodified OpenSearch core distributions.

### Skip fetching latest

Expand Down
1 change: 1 addition & 0 deletions buildSrc/version.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ antlr4 = 4.13.1
guava = 32.1.1-jre
protobuf = 3.22.3
jakarta_annotation = 1.3.5
google_http_client = 1.44.1

# when updating the JNA version, also update the version in buildSrc/build.gradle
jna = 5.13.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public void testIndicesOptions() {
request.indicesOptions(IndicesOptions.fromParameters("closed", null, null, "false", SearchRequest.DEFAULT_INDICES_OPTIONS));
response = client().execute(RankEvalAction.INSTANCE, request).actionGet();
assertEquals(1, response.getFailures().size());
assertThat(response.getFailures().get("amsterdam_query"), instanceOf(IndexClosedException.class));
assertThat(response.getFailures().get("amsterdam_query"), instanceOf(IllegalArgumentException.class));

// test allow_no_indices
request = new RankEvalRequest(task, new String[] { "bad*" });
Expand Down
74 changes: 43 additions & 31 deletions plugins/discovery-gce/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ opensearchplugin {
classname 'org.opensearch.plugin.discovery.gce.GceDiscoveryPlugin'
}

versions << [
'google': '1.23.0'
]

dependencies {
api "com.google.apis:google-api-services-compute:v1-rev160-${versions.google}"
api "com.google.api-client:google-api-client:${versions.google}"
api "com.google.apis:google-api-services-compute:v1-rev235-1.25.0"
api "com.google.api-client:google-api-client:1.35.2"
api "com.google.oauth-client:google-oauth-client:1.35.0"
api "com.google.http-client:google-http-client:${versions.google}"
api "com.google.http-client:google-http-client-jackson2:${versions.google}"
api "com.google.http-client:google-http-client:${versions.google_http_client}"
api "com.google.http-client:google-http-client-gson:${versions.google_http_client}"
api "com.google.http-client:google-http-client-jackson2:${versions.google_http_client}"
api 'com.google.code.findbugs:jsr305:3.0.2'
api "org.apache.httpcomponents:httpclient:${versions.httpclient}"
api "org.apache.httpcomponents:httpcore:${versions.httpcore}"
api "commons-logging:commons-logging:${versions.commonslogging}"
api "org.apache.logging.log4j:log4j-1.2-api:${versions.log4j}"
api "commons-codec:commons-codec:${versions.commonscodec}"
api 'io.grpc:grpc-api:1.57.2'
api 'io.opencensus:opencensus-api:0.31.1'
api 'io.opencensus:opencensus-contrib-http-util:0.31.1'
runtimeOnly "com.google.guava:guava:${versions.guava}"
}

restResources {
Expand All @@ -43,6 +44,7 @@ restResources {

tasks.named("dependencyLicenses").configure {
mapping from: /google-.*/, to: 'google'
mapping from: /opencensus.*/, to: 'opencensus'
}

check {
Expand All @@ -55,26 +57,36 @@ test {
systemProperty 'tests.artifact', project.name
}

thirdPartyAudit.ignoreMissingClasses(
// classes are missing
'javax.jms.Message',
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',
'org.apache.log.Logger',
'com.google.api.client.json.gson.GsonFactory',
'com.google.common.base.Preconditions',
'com.google.common.base.Splitter',
'com.google.common.cache.CacheBuilder',
'com.google.common.cache.CacheLoader',
'com.google.common.cache.LoadingCache',
'com.google.common.collect.ImmutableMap',
'com.google.common.collect.ImmutableMap$Builder',
'com.google.common.collect.ImmutableSet',
'com.google.common.collect.Lists',
'com.google.common.collect.Multiset',
'com.google.common.collect.SortedMultiset',
'com.google.common.collect.TreeMultiset',
'com.google.common.io.BaseEncoding',
)
thirdPartyAudit {
ignoreViolations(
// uses internal java api: sun.misc.Unsafe
'com.google.common.cache.Striped64',
'com.google.common.cache.Striped64$1',
'com.google.common.cache.Striped64$Cell',
'com.google.common.hash.Striped64',
'com.google.common.hash.Striped64$1',
'com.google.common.hash.Striped64$Cell',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$1',
'com.google.common.hash.LittleEndianByteArray$UnsafeByteArray$2',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper',
'com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper$1',
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator',
'com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1',
)

ignoreMissingClasses(
'com.google.api.client.http.apache.v2.ApacheHttpTransport',
'com.google.common.util.concurrent.internal.InternalFutureFailureAccess',
'com.google.common.util.concurrent.internal.InternalFutures',
'com.google.gson.stream.JsonReader',
'com.google.gson.stream.JsonToken',
'com.google.gson.stream.JsonWriter',
'javax.jms.Message',
'javax.servlet.ServletContextEvent',
'javax.servlet.ServletContextListener',
'org.apache.avalon.framework.logger.Logger',
'org.apache.log.Hierarchy',
'org.apache.log.Logger'
)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2d737980e34c674da4ff0ae124b80caefdc7198a

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
67bf1ac84286b4f9ea996a90f6e91e36dc648aff

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d8956bacb8a4011365fa15a690482c49a70c78c5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f3b8967c6f7078da6380687859d0873105f84d39

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3f1947de0fd9eb250af16abe6103c11e68d11635
1 change: 1 addition & 0 deletions plugins/discovery-gce/licenses/grpc-api-1.57.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c71a006b81ddae7bc4b7cb1d2da78c1b173761f4
Loading

0 comments on commit 85dafbf

Please sign in to comment.