Skip to content

Commit 87eab2c

Browse files
authored
Merge branch 'opensearch-project:main' into main
2 parents 3926f7a + 521cef1 commit 87eab2c

File tree

16 files changed

+131
-24
lines changed

16 files changed

+131
-24
lines changed

.github/workflows/detect-breaking-change.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- if: failure()
2121
run: cat server/build/reports/java-compatibility/report.txt
2222
- if: failure()
23-
uses: actions/upload-artifact@v6
23+
uses: actions/upload-artifact@v7
2424
with:
2525
name: java-compatibility-report.html
2626
path: ${{ github.workspace }}/server/build/reports/java-compatibility/report.html

.github/workflows/publish-maven-snapshots.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ jobs:
4343

4444
- name: Publish snapshots to maven
4545
run: |
46-
./gradlew publishNebulaPublicationToSnapshotsRepository
46+
./gradlew publishNebulaPublicationToSnapshotsRepository -Pcrypto.standard=FIPS-140-3

AGENTS.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# AGENTS.md
2+
3+
## Repository Structure
4+
5+
Key components:
6+
7+
- `server` - Core of the OpenSearch server. Includes the distributed system framework as well as most of the search and indexing functionality.
8+
- `plugins/*` - Optional plugins that extend interfaces defined in `server`. Plugins run in their own classloader that is a child of the `server` classloader.
9+
- `modules/*` - Architecturally the same as plugins, but are included by default and are not uninstallable.
10+
- `libs/*` - Libraries that can be used by `server` or any plugin or module.
11+
- `buildSrc` - The build framework, used by this repository and all external plugin repositories. This is published as the `build-tools` artifact.
12+
- `sandbox` - Contains `libs`, `modules`, and `plugins` that are under development. These are not included in non-snapshot builds.
13+
- `distribution` - Builds tar, zip, rpm, and deb packages.
14+
- `qa` - Integration tests requiring multiple modules/plugins, multi-version cluster tests, and tests in unusual configurations.
15+
- `test` - Test framework and test fixtures used across the project. Published for external plugin testing.
16+
17+
## Build
18+
19+
JDK 21 is the minimum supported. `JAVA_HOME` must be set.
20+
21+
```
22+
./gradlew assemble # build all distributions
23+
./gradlew localDistro # build for local platform only
24+
./gradlew run # run OpenSearch from source
25+
./gradlew generateProto # regenerate protobuf code (if compilation errors)
26+
```
27+
28+
## Testing
29+
30+
### Unit Testing
31+
- Defined in `<component>/src/test` directory
32+
- Test class names must end with "Tests"
33+
- Base class: `OpenSearchTestCase`
34+
35+
### Internal Cluster Tests
36+
- Defined in `<component>/src/internalClusterTest` directory
37+
- Test class names must end with "IT"
38+
- Base classes: `OpenSearchSingleNodeTestCase` (single node), `OpenSearchIntegTestCase` (multi-node)
39+
- These tests are extremely prone to race conditions. Ensure that you are using appropriate concurrency primitives or polling when asserting on a condition that completes asynchronously.
40+
41+
### REST Tests
42+
- YAML-based REST tests: `./gradlew :rest-api-spec:yamlRestTest`
43+
- Java REST tests: `./gradlew :<module>:javaRestTest` (base class: `OpenSearchRestTestCase`)
44+
45+
### Running Tests
46+
47+
```
48+
./gradlew check # all verification tasks (unit, integration, static checks)
49+
./gradlew precommit # precommit checks only
50+
./gradlew internalClusterTest # in-memory cluster integration tests only
51+
./gradlew test # unit tests only
52+
53+
# run a specific test
54+
./gradlew server:test --tests "*.ReplicaShardBatchAllocatorTests.testNoAsyncFetchData"
55+
./gradlew :server:internalClusterTest --tests "org.opensearch.action.admin.ClientTimeoutIT.testNodesInfoTimeout"
56+
57+
# run with a specific seed for reproducibility
58+
./gradlew test -Dtests.seed=DEADBEEF
59+
60+
# repeat a test N times
61+
./gradlew server:test --tests "*.ReplicaShardBatchAllocatorTests.testNoAsyncFetchData" -Dtests.iters=N
62+
```
63+
64+
### Writing Good Tests
65+
66+
- Prefer unit tests over multi-threaded integration tests when unit tests can provide the same test coverage.
67+
- Use randomization for parameters not expected to affect behavior (e.g., shard count for aggregation tests), not for coverage. If different code paths exist (e.g., 1 shard vs 2+ shards), write separate tests for each.
68+
- Never use `Thread.sleep` directly. Use `assertBusy` or `waitUntil` for polling, or instrument code with concurrency primitives like `CountDownLatch` for deterministic waiting.
69+
- Do not depend on specific segment topology. If needed, disable background refreshes and force merge after indexing.
70+
- Clean up all resources at the end of each test. The base test class checks for open file handles and running threads after tear down.
71+
- Do not abuse randomization in multi-threaded tests because it can make failures non-reproducible.
72+
- When testing functionality behind a feature flag, use `FeatureFlags.TestUtils` and the `@LockFeatureFlag` annotation.
73+
- Use the `-Dtests.iters=N` parameter to repeat new and modified tests with many different random seeds to ensure stability.
74+
75+
## Java Formatting
76+
77+
- Formatted with Eclipse JDT formatter via Spotless Gradle plugin.
78+
- Run `./gradlew spotlessJavaCheck` to check, `./gradlew spotlessApply` to fix.
79+
- 4-space indent, 140-character line width.
80+
- Wildcard imports are forbidden.
81+
- Prefer `foo == false` over `!foo` for readability.
82+
83+
## Adding Dependencies
84+
85+
When adding or removing a dependency in any `build.gradle` (non-test scope):
86+
1. Copy the library's `LICENSE.txt` and `NOTICE.txt` to `<component>/licenses/<artifact>-LICENSE.txt` and `<artifact>-NOTICE.txt`.
87+
2. Run `./gradlew :<component>:updateSHAs` to generate the SHA file.
88+
3. Verify with `./gradlew :<component>:check`.
89+
90+
## Backwards Compatibility
91+
92+
- Use `Version.onOrAfter` / `Version.before` checks when changing on-disk formats or encodings.
93+
- Mark public API classes with `@PublicApi` (backwards compatibility guaranteed), `@InternalApi` (no guarantees), `@ExperimentalApi` (may change any time), or `@DeprecatedApi`.
94+
- User-facing API changes require the `>breaking` PR label, a CHANGELOG entry, and deprecation log messages via `DeprecationLogger`.
95+
- Run `./gradlew japicmp` to check API compatibility against the latest release.
96+
97+
## Commits
98+
99+
Ensure `./gradlew precommit` passes before creating a commit. Write commit message titles focused on user impact and not implementation details.
100+
101+
- Good: `Allow slash in snapshot file name validation`
102+
- Bad: `Add Strings#validFileNameExcludingSlash method`
103+
104+
Commit message titles should be limited to 50 characters, followed by a blank line, and the body should be wrapped at 72 characters. Include all relevant context in commit messages but avoid excess verbosity. Users must understand and accept the Developer Certificate of Origin (DCO) and all commits must be signed off accordingly.
105+
106+
## Pull Requests
107+
108+
Always push to the user's fork. Never push to the upstream `opensearch-project/OpenSearch` repo. Never push directly to `main`. If a user fork does not exist, ask the contributor to create one.

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6262
- Fallback to netty client if AWS Crt client is not available on the target platform / architecture ([#20698](https://github.com/opensearch-project/OpenSearch/pull/20698))
6363
- Fix ShardSearchFailure in transport-grpc ([#20641](https://github.com/opensearch-project/OpenSearch/pull/20641))
6464
- Fix TLS cert hot-reload for Arrow Flight transport ([#20732](https://github.com/opensearch-project/OpenSearch/pull/20732))
65+
- Fix misleading heap usage cancellation message in SearchBackpressureService ([#20779](https://github.com/opensearch-project/OpenSearch/pull/20779))
6566

6667
### Dependencies
6768
- Bump shadow-gradle-plugin from 8.3.9 to 9.3.1 ([#20569](https://github.com/opensearch-project/OpenSearch/pull/20569))
@@ -73,10 +74,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
7374
- Bump `reactor-netty` from 1.3.2 to 1.3.3 ([#20589](https://github.com/opensearch-project/OpenSearch/pull/20589))
7475
- Bump `reactor` from 3.8.2 to 3.8.3 ([#20589](https://github.com/opensearch-project/OpenSearch/pull/20589))
7576
- Bump `org.jruby.jcodings:jcodings` from 1.0.63 to 1.0.64 ([#20713](https://github.com/opensearch-project/OpenSearch/pull/20713))
76-
- Bump `org.jruby.joni:joni` from 2.2.3 to 2.2.6 ([#20714](https://github.com/opensearch-project/OpenSearch/pull/20714))
77+
- Bump `org.jruby.joni:joni` from 2.2.3 to 2.2.7 ([#20714](https://github.com/opensearch-project/OpenSearch/pull/20714), [#20759](https://github.com/opensearch-project/OpenSearch/pull/20759))
7778
- Bump `tj-actions/changed-files` from 47.0.1 to 47.0.4 ([#20638](https://github.com/opensearch-project/OpenSearch/pull/20638), [#20716](https://github.com/opensearch-project/OpenSearch/pull/20716))
7879
- Bump `com.nimbusds:nimbus-jose-jwt` from 10.7 to 10.8 ([#20715](https://github.com/opensearch-project/OpenSearch/pull/20715))
7980
- Bump OpenTelemetry to 1.59.0 and OpenTelemetry Semconv to 1.40.0 ([#20737](https://github.com/opensearch-project/OpenSearch/pull/20737))
81+
- Bump `ch.qos.logback:logback-classic` from 1.5.27 to 1.5.32 ([#20761](https://github.com/opensearch-project/OpenSearch/pull/20761))
82+
- Bump `actions/upload-artifact` from 6 to 7 ([#20762](https://github.com/opensearch-project/OpenSearch/pull/20762))
83+
- Bump `org.tukaani:xz` from 1.11 to 1.12 ([#20760](https://github.com/opensearch-project/OpenSearch/pull/20760))
8084

8185
### Removed
8286

MAINTAINERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
2727
| Varun Bansal | [linuxpi](https://github.com/linuxpi) | Amazon |
2828
| Marc Handalian | [mch2](https://github.com/mch2) | Amazon |
2929
| Michael Froh | [msfroh](https://github.com/msfroh) | Uber |
30+
| Mohit Godwani | [mgodwan](https://github.com/mgodwan) | Amazon |
3031
| Nick Knize | [nknize](https://github.com/nknize) | Lucenia |
3132
| Owais Kazi | [owaiskazi19](https://github.com/owaiskazi19) | Amazon |
3233
| Pan Guixin | [bugmakerrrrrr](https://github.com/bugmakerrrrrr) | ByteDance |

libs/grok/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*/
3030

3131
dependencies {
32-
api 'org.jruby.joni:joni:2.2.6'
32+
api 'org.jruby.joni:joni:2.2.7'
3333
// joni dependencies:
3434
api 'org.jruby.jcodings:jcodings:1.0.64'
3535

libs/grok/licenses/joni-2.2.6.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cb952bb876a4b1bbcea57b2bf0232bb898ee4042

plugins/examples/system-ingest-processor/src/yamlRestTest/resources/rest-api-spec/test/example-system-ingest-processor/20_system_ingest_processor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ teardown:
111111
- skip:
112112
features: allowed_warnings
113113
- do:
114+
allowed_warnings:
115+
- "index template [example-template] has index patterns [template-*] matching patterns from existing older templates [global] with patterns (global => [*]); this template [example-template] will take precedence during new index creation"
114116
# test v2 template
115117
indices.put_index_template:
116118
name: example-template
@@ -120,8 +122,6 @@ teardown:
120122
settings:
121123
index.example_system_ingest_processor_plugin.trigger_setting: true
122124
- do:
123-
allowed_warnings:
124-
- "index [template-index-1] matches multiple legacy templates [example-template, global], composable templates will only match a single template"
125125
index:
126126
index: template-index-1
127127
id: 1

plugins/ingest-attachment/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dependencies {
6666
runtimeOnly "com.optimaize.languagedetector:language-detector:0.6"
6767
runtimeOnly "com.google.guava:guava:${versions.guava}"
6868
// Other dependencies
69-
api 'org.tukaani:xz:1.11'
69+
api 'org.tukaani:xz:1.12'
7070
api "commons-io:commons-io:${versions.commonsio}"
7171
api "org.slf4j:slf4j-api:${versions.slf4j}"
7272

0 commit comments

Comments
 (0)