Skip to content

Commit e3fe3ae

Browse files
Atri SharmaAtri Sharma
authored andcommitted
Merge origin/main into streaming-scoring-clean
2 parents b7f3128 + da1de97 commit e3fe3ae

File tree

799 files changed

+26925
-8158
lines changed

Some content is hidden

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

799 files changed

+26925
-8158
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ BWC_VERSION:
5555
- "3.3.1"
5656
- "3.3.2"
5757
- "3.4.0"
58+
- "3.5.0"

.github/benchmark-configs.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,41 @@
240240
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
241241
},
242242
"baseline_cluster_config": "x64-r5.xlarge-1-shard-0-replica-snapshot-baseline"
243+
},
244+
"id_15": {
245+
"description": "Intra-segment search test-procedure for big5 with concurrent segment search mode as auto and force partition strategy",
246+
"supported_major_versions": ["3"],
247+
"cluster-benchmark-configs": {
248+
"SINGLE_NODE_CLUSTER": "true",
249+
"MIN_DISTRIBUTION": "true",
250+
"TEST_WORKLOAD": "big5",
251+
"ADDITIONAL_CONFIG": "search.concurrent_segment_search.partition_strategy:force",
252+
"WORKLOAD_PARAMS": "{\"snapshot_repo_name\":\"benchmark-workloads-repo-3x\",\"snapshot_bucket_name\":\"benchmark-workload-snapshots\",\"snapshot_region\":\"us-east-1\",\"snapshot_base_path\":\"10.3.2\",\"snapshot_name\":\"big5_1_shard_text_field\"}",
253+
"CAPTURE_NODE_STAT": "true",
254+
"TEST_PROCEDURE": "intra-segment"
255+
},
256+
"cluster_configuration": {
257+
"size": "Single-Node",
258+
"data_instance_config": "4vCPU, 32G Mem, 16G Heap"
259+
},
260+
"baseline_cluster_config": "x64-r5.xlarge-1-shard-0-replica-snapshot-baseline"
261+
},
262+
"id_16": {
263+
"description": "clickbench workload DSL queries test",
264+
"supported_major_versions": ["3"],
265+
"cluster-benchmark-configs": {
266+
"SINGLE_NODE_CLUSTER": "true",
267+
"MIN_DISTRIBUTION": "true",
268+
"DATA_INSTANCE_TYPE": "c5.2xlarge",
269+
"TEST_WORKLOAD": "clickbench",
270+
"WORKLOAD_PARAMS": "{\"snapshot_repo_name\":\"benchmark-workloads-repo-3x\",\"snapshot_bucket_name\":\"benchmark-workload-snapshots\",\"snapshot_region\":\"us-east-1\",\"snapshot_base_path\":\"10.3.2\",\"snapshot_name\":\"clickbench_3_shards\",\"warmup_iterations\":10,\"test_iterations\":20}",
271+
"CAPTURE_NODE_STAT": "true",
272+
"TEST_PROCEDURE": "dsl-clickbench-snapshot"
273+
},
274+
"cluster_configuration": {
275+
"size": "Single-Node",
276+
"data_instance_config": "8vCPU, 32G Mem, 16G Heap"
277+
},
278+
"baseline_cluster_config": "x64-c5.2xlarge-3-shard-0-replica-snapshot-baseline"
243279
}
244280
}

.github/workflows/benchmark-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
run: |
150150
./gradlew :distribution:archives:linux-tar:assemble -Dbuild.snapshot=false
151151
- name: Configure AWS credentials
152-
uses: aws-actions/configure-aws-credentials@v5
152+
uses: aws-actions/configure-aws-credentials@v6
153153
with:
154154
role-to-assume: ${{ secrets.UPLOAD_ARCHIVE_ARTIFACT_ROLE }}
155155
role-session-name: publish-to-s3

.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/gradle-check.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,40 @@ jobs:
2424
- uses: actions/checkout@v6
2525
- name: Get changed files
2626
id: changed-files-specific
27-
uses: tj-actions/changed-files@v47.0.1
27+
uses: tj-actions/changed-files@v47.0.5
2828
with:
2929
files_ignore: |
3030
release-notes/*.md
3131
.github/**
3232
*.md
3333
34+
Code-Diff-Analyzer:
35+
uses: opensearch-project/opensearch-build/.github/workflows/code-diff-analyzer.yml@main
36+
if: github.repository == 'opensearch-project/OpenSearch'
37+
permissions:
38+
id-token: write # github oidc to assume aws roles
39+
pull-requests: write # to create or update comment (peter-evans/create-or-update-comment)
40+
secrets:
41+
BEDROCK_ACCESS_ROLE: ${{ secrets.BEDROCK_ACCESS_ROLE }}
42+
with:
43+
skip_diff_analyzer_with_label_name: 'skip-diff-analyzer'
44+
update_pr_comment_with_analyzer_report: true
45+
hard_fail_level: 2 # issues with medium severity or above will hard fail the check
46+
47+
Code-Diff-Reviewer:
48+
uses: opensearch-project/opensearch-build/.github/workflows/code-diff-reviewer.yml@main
49+
needs: Code-Diff-Analyzer
50+
if: github.repository == 'opensearch-project/OpenSearch'
51+
permissions:
52+
id-token: write # github oidc to assume aws roles
53+
pull-requests: write # to create or update comment (peter-evans/create-or-update-comment)
54+
secrets:
55+
BEDROCK_ACCESS_ROLE: ${{ secrets.BEDROCK_ACCESS_ROLE }}
56+
with:
57+
skip_diff_reviewer_with_label_name: 'skip-diff-reviewer'
58+
3459
gradle-check:
35-
needs: check-files
60+
needs: [check-files, Code-Diff-Analyzer]
3661
if: github.repository == 'opensearch-project/OpenSearch' && needs.check-files.outputs.RUN_GRADLE_CHECK == 'true'
3762
permissions:
3863
contents: read # to fetch code (actions/checkout)
@@ -164,10 +189,12 @@ jobs:
164189
Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change?
165190
166191
check-result:
167-
needs: [check-files, gradle-check]
192+
needs: [check-files, gradle-check, Code-Diff-Analyzer]
168193
if: always()
169194
runs-on: ubuntu-latest
170195
steps:
171196
- name: Fail if gradle-check fails
172-
if: ${{ needs.check-files.outputs.RUN_GRADLE_CHECK && needs.gradle-check.result == 'failure' }}
197+
if: |
198+
needs.check-files.outputs.RUN_GRADLE_CHECK == 'true' &&
199+
(needs.gradle-check.result == 'failure' || needs.Code-Diff-Analyzer.result == 'failure' || needs.Code-Diff-Analyzer.result == 'cancelled')
173200
run: exit 1

.github/workflows/links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v6
1414
- name: lychee Link Checker
1515
id: lychee
16-
uses: lycheeverse/lychee-action@v2.7.0
16+
uses: lycheeverse/lychee-action@v2.8.0
1717
with:
1818
args: --accept=200,403,429 --exclude-mail **/*.html **/*.md **/*.txt **/*.json --exclude-file .lychee.excludes
1919
fail: true

.github/workflows/lucene-snapshots.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: ./gradlew publishJarsPublicationToMavenLocal -Pversion.suffix=snapshot-${{ env.REVISION }} -x javadoc
4848

4949
- name: Configure AWS credentials
50-
uses: aws-actions/configure-aws-credentials@v5
50+
uses: aws-actions/configure-aws-credentials@v6
5151
with:
5252
role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_SECRET_ROLE }}
5353
aws-region: us-east-1
@@ -60,7 +60,7 @@ jobs:
6060
echo "LUCENE_SNAPSHOTS_BUCKET=$lucene_snapshots_bucket" >> $GITHUB_OUTPUT
6161
6262
- name: Configure AWS credentials
63-
uses: aws-actions/configure-aws-credentials@v5
63+
uses: aws-actions/configure-aws-credentials@v6
6464
with:
6565
role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_S3_ROLE }}
6666
aws-region: us-east-1
@@ -70,7 +70,7 @@ jobs:
7070
aws s3 cp ~/.m2/repository/org/apache/lucene/ s3://${{ steps.get_s3_bucket.outputs.LUCENE_SNAPSHOTS_BUCKET }}/snapshots/lucene/org/apache/lucene/ --recursive --no-progress
7171
7272
- name: Configure AWS credentials
73-
uses: aws-actions/configure-aws-credentials@v5
73+
uses: aws-actions/configure-aws-credentials@v6
7474
with:
7575
role-to-assume: ${{ secrets.LUCENE_SNAPSHOTS_ROLE }}
7676
aws-region: us-west-2

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jobs:
3636
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role
3737

3838
- name: Configure AWS credentials
39-
uses: aws-actions/configure-aws-credentials@v5
39+
uses: aws-actions/configure-aws-credentials@v6
4040
with:
4141
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
4242
aws-region: us-east-1
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.

0 commit comments

Comments
 (0)