Skip to content

Commit 54de680

Browse files
committed
Merge branch 'main' into POC_on_collector_context
2 parents a2bcea0 + 0874e58 commit 54de680

File tree

210 files changed

+7388
-801
lines changed

Some content is hidden

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

210 files changed

+7388
-801
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
distribution: temurin
2626
java-version: 21
2727

28-
- name: Configure AWS credentials
29-
uses: aws-actions/configure-aws-credentials@v4
28+
- name: Load secret
29+
uses: 1password/load-secrets-action@v2
3030
with:
31-
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
32-
aws-region: us-east-1
31+
# Export loaded secrets as environment variables
32+
export-env: true
33+
env:
34+
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
35+
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
36+
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
3337

3438
- name: Publish snapshots to maven
3539
run: |
36-
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
37-
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
38-
echo "::add-mask::$SONATYPE_USERNAME"
39-
echo "::add-mask::$SONATYPE_PASSWORD"
4040
./gradlew publishNebulaPublicationToSnapshotsRepository

.github/workflows/version.yml

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
fi
3030
CURRENT_VERSION_ARRAY=($(echo "$TAG" | tr . '\n'))
3131
BASE=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:2}")
32-
BASE_X=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:1}.x")
32+
MAIN_BRANCH="main"
3333
CURRENT_VERSION=$(IFS=. ; echo "${CURRENT_VERSION_ARRAY[*]:0:3}")
3434
CURRENT_VERSION_UNDERSCORE=$(IFS=_ ; echo "V_${CURRENT_VERSION_ARRAY[*]:0:3}")
3535
CURRENT_VERSION_ARRAY[2]=$((CURRENT_VERSION_ARRAY[2]+1))
@@ -42,7 +42,7 @@ jobs:
4242
fi
4343
echo "TAG=$TAG" >> $GITHUB_ENV
4444
echo "BASE=$BASE" >> $GITHUB_ENV
45-
echo "BASE_X=$BASE_X" >> $GITHUB_ENV
45+
echo "MAIN_BRANCH=$MAIN_BRANCH" >> $GITHUB_ENV
4646
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
4747
echo "CURRENT_VERSION_UNDERSCORE=$CURRENT_VERSION_UNDERSCORE" >> $GITHUB_ENV
4848
echo "NEXT_VERSION=$NEXT_VERSION" >> $GITHUB_ENV
@@ -77,33 +77,7 @@ jobs:
7777
7878
- uses: actions/checkout@v4
7979
with:
80-
ref: ${{ env.BASE_X }}
81-
82-
- name: Add Patch Version on Major.X branch
83-
uses: peternied/opensearch-core-version-updater@v1
84-
with:
85-
previous-version: ${{ env.CURRENT_VERSION }}
86-
new-version: ${{ env.NEXT_VERSION }}
87-
update-current: false
88-
89-
- name: Create PR for BASE_X
90-
id: base_x_pr
91-
uses: peter-evans/create-pull-request@v7
92-
with:
93-
base: ${{ env.BASE_X }}
94-
branch: 'create-pull-request/patch-${{ env.BASE_X }}'
95-
commit-message: Add bwc version ${{ env.NEXT_VERSION }}
96-
signoff: true
97-
delete-branch: true
98-
labels: |
99-
autocut
100-
title: '[AUTO] [${{ env.BASE_X }}] Add bwc version ${{ env.NEXT_VERSION }}.'
101-
body: |
102-
I've noticed that a new tag ${{ env.TAG }} was pushed, and added a bwc version ${{ env.NEXT_VERSION }}.
103-
104-
- uses: actions/checkout@v4
105-
with:
106-
ref: main
80+
ref: ${{ env.MAIN_BRANCH }}
10781

10882
- name: Add Patch Version on main branch
10983
uses: peternied/opensearch-core-version-updater@v1
@@ -112,18 +86,18 @@ jobs:
11286
new-version: ${{ env.NEXT_VERSION }}
11387
update-current: false
11488

115-
- name: Create PR for main
116-
id: main_pr
89+
- name: Create PR for MAIN_BRANCH
90+
id: main_branch_pr
11791
uses: peter-evans/create-pull-request@v7
11892
with:
119-
base: main
120-
branch: 'create-pull-request/patch-main'
93+
base: ${{ env.MAIN_BRANCH }}
94+
branch: 'create-pull-request/patch-${{ env.MAIN_BRANCH }}'
12195
commit-message: Add bwc version ${{ env.NEXT_VERSION }}
12296
signoff: true
12397
delete-branch: true
12498
labels: |
12599
autocut
126-
title: '[AUTO] [main] Add bwc version ${{ env.NEXT_VERSION }}.'
100+
title: '[AUTO] [${{ env.MAIN_BRANCH }}] Add bwc version ${{ env.NEXT_VERSION }}.'
127101
body: |
128102
I've noticed that a new tag ${{ env.TAG }} was pushed, and added a bwc version ${{ env.NEXT_VERSION }}.
129103
@@ -139,8 +113,7 @@ jobs:
139113
### Exit Criteria
140114
Review and merged the following pull requests
141115
- [ ] ${{ steps.base_pr.outputs.pull-request-url }}
142-
- [ ] ${{ steps.base_x_pr.outputs.pull-request-url }}
143-
- [ ] ${{ steps.main_pr.outputs.pull-request-url }}
116+
- [ ] ${{ steps.main_branch_pr.outputs.pull-request-url }}
144117
145118
### Additional Context
146119
See project wide guidance on branching and versions [[link]](https://github.com/opensearch-project/.github/blob/main/RELEASING.md).

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
### Added
88
- Add support for Warm Indices Write Block on Flood Watermark breach ([#18375](https://github.com/opensearch-project/OpenSearch/pull/18375))
99
- Ability to run Code Coverage with Gradle and produce the jacoco reports locally ([#18509](https://github.com/opensearch-project/OpenSearch/issues/18509))
10+
- Add NodeResourceUsageStats to ClusterInfo ([#18480](https://github.com/opensearch-project/OpenSearch/issues/18472))
11+
- Introduce SecureHttpTransportParameters experimental API (to complement SecureTransportParameters counterpart) ([#18572](https://github.com/opensearch-project/OpenSearch/issues/18572))
12+
- Create equivalents of JSM's AccessController in the java agent ([#18346](https://github.com/opensearch-project/OpenSearch/issues/18346))
13+
- Introduced a new cluster-level API to fetch remote store metadata (segments and translogs) for each shard of an index. ([#18257](https://github.com/opensearch-project/OpenSearch/pull/18257))
14+
- Add last index request timestamp columns to the `_cat/indices` API. ([10766](https://github.com/opensearch-project/OpenSearch/issues/10766))
15+
- Introduce a new pull-based ingestion plugin for file-based indexing (for local testing) ([#18591](https://github.com/opensearch-project/OpenSearch/pull/18591))
16+
- Add support for search pipeline in search and msearch template ([#18564](https://github.com/opensearch-project/OpenSearch/pull/18564))
17+
- Add BooleanQuery rewrite moving constant-scoring must clauses to filter clauses ([#18510](https://github.com/opensearch-project/OpenSearch/issues/18510))
1018

1119
### Changed
20+
- Update Subject interface to use CheckedRunnable ([#18570](https://github.com/opensearch-project/OpenSearch/issues/18570))
1221

1322
### Dependencies
1423
- Bump `stefanzweifel/git-auto-commit-action` from 5 to 6 ([#18524](https://github.com/opensearch-project/OpenSearch/pull/18524))
24+
- Bump Apache Lucene to 10.2.2 ([#18573](https://github.com/opensearch-project/OpenSearch/pull/18573))
25+
- Bump `org.apache.logging.log4j:log4j-core` from 2.24.3 to 2.25.0 ([#18589](https://github.com/opensearch-project/OpenSearch/pull/18589))
26+
- Bump `com.google.code.gson:gson` from 2.13.0 to 2.13.1 ([#18585](https://github.com/opensearch-project/OpenSearch/pull/18585))
27+
- Bump `com.azure:azure-core-http-netty` from 1.15.11 to 1.15.12 ([#18586](https://github.com/opensearch-project/OpenSearch/pull/18586))
1528

1629
### Deprecated
1730

1831
### Removed
1932

2033
### Fixed
2134
- Add task cancellation checks in aggregators ([#18426](https://github.com/opensearch-project/OpenSearch/pull/18426))
35+
- Fix concurrent timings in profiler ([#18540](https://github.com/opensearch-project/OpenSearch/pull/18540))
36+
- [Autotagging] Fix delete rule event consumption in InMemoryRuleProcessingService ([#18628](https://github.com/opensearch-project/OpenSearch/pull/18628))
37+
- Cannot communicate with HTTP/2 when reactor-netty is enabled ([#18599](https://github.com/opensearch-project/OpenSearch/pull/18599))
38+
- Fix the visit of sub queries for HasParentQuery and HasChildQuery ([#18621](https://github.com/opensearch-project/OpenSearch/pull/18621))
39+
2240

2341
### Security
2442

MAINTAINERS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
1111
| Andriy Redko | [reta](https://github.com/reta) | Independent |
1212
| Ankit Jain | [jainankitk](https://github.com/jainankitk) | Amazon |
1313
| Ashish Singh | [ashking94](https://github.com/ashking94) | Amazon |
14+
| Bharathwaj G | [bharath-techie](https://github.com/bharath-techie) | Amazon |
1415
| Bukhtawar Khan | [Bukhtawar](https://github.com/Bukhtawar) | Amazon |
1516
| Charlotte Henkle | [CEHENKLE](https://github.com/CEHENKLE) | Amazon |
1617
| Craig Perkins | [cwperks](https://github.com/cwperks) | Amazon |

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ subprojects {
118118
}
119119
maven {
120120
name = 'Snapshots'
121-
url = 'https://aws.oss.sonatype.org/content/repositories/snapshots'
121+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
122122
credentials {
123123
username = "$System.env.SONATYPE_USERNAME"
124124
password = "$System.env.SONATYPE_PASSWORD"

buildSrc/src/testKit/thirdPartyAudit/sample_jars/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repositories {
1717
}
1818

1919
dependencies {
20-
implementation "org.apache.logging.log4j:log4j-core:2.24.3"
20+
implementation "org.apache.logging.log4j:log4j-core:2.25.0"
2121
}
2222

2323
["0.0.1", "0.0.2"].forEach { v ->

client/rest-high-level/src/test/java/org/opensearch/client/RequestConvertersTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,7 @@ public void testSearchTemplate() throws Exception {
13671367
scriptParams.put("field", "name");
13681368
scriptParams.put("value", "soren");
13691369
searchTemplateRequest.setScriptParams(scriptParams);
1370+
searchTemplateRequest.setSearchPipeline("pipeline");
13701371

13711372
// Verify that the resulting REST request looks as expected.
13721373
Request request = RequestConverters.searchTemplate(searchTemplateRequest);
@@ -1391,6 +1392,7 @@ public void testRenderSearchTemplate() throws Exception {
13911392
searchTemplateRequest.setScript("template1");
13921393
searchTemplateRequest.setScriptType(ScriptType.STORED);
13931394
searchTemplateRequest.setProfile(randomBoolean());
1395+
searchTemplateRequest.setSearchPipeline("pipeline");
13941396

13951397
Map<String, Object> scriptParams = new HashMap<>();
13961398
scriptParams.put("field", "name");
@@ -1431,6 +1433,7 @@ public void testMultiSearchTemplate() throws Exception {
14311433
searchTemplateRequest.setScript("{\"query\": { \"match\" : { \"{{field}}\" : \"{{value}}\" }}}");
14321434
searchTemplateRequest.setScriptType(ScriptType.INLINE);
14331435
searchTemplateRequest.setProfile(randomBoolean());
1436+
searchTemplateRequest.setSearchPipeline("pipeline");
14341437

14351438
Map<String, Object> scriptParams = new HashMap<>();
14361439
scriptParams.put("field", "name");

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
opensearch = "3.2.0"
3-
lucene = "10.2.1"
3+
lucene = "10.2.2"
44

55
bundled_jdk_vendor = "adoptium"
66
bundled_jdk = "24.0.1+9"
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
package org.opensearch.secure_sm;
10+
11+
import java.util.concurrent.Callable;
12+
import java.util.function.Supplier;
13+
14+
/**
15+
* A utility class that provides methods to perform actions in a privileged context.
16+
*
17+
* This class is a replacement for Java's {@code java.security.AccessController} functionality which is marked for
18+
* removal. All new code should use this class instead of the JDK's {@code AccessController}.
19+
*
20+
* Running code in a privileged context will ensure that the code has the necessary permissions
21+
* without traversing through the entire call stack. See {@code org.opensearch.javaagent.StackCallerProtectionDomainChainExtractor}
22+
*
23+
* Example usages:
24+
* <pre>
25+
* {@code
26+
* AccessController.doPrivileged(() -> {
27+
* // code that requires privileges
28+
* });
29+
* }
30+
* </pre>
31+
*
32+
* Example usage with a return value and checked exception:
33+
*
34+
* <pre>
35+
* {@code
36+
* T something = AccessController.doPrivilegedChecked(() -> {
37+
* // code that requires privileges and may throw a checked exception
38+
* return something;
39+
* // or
40+
* throw new Exception();
41+
* });
42+
* }
43+
* </pre>
44+
*/
45+
public final class AccessController {
46+
/**
47+
* Don't allow instantiation an {@code AccessController}
48+
*/
49+
private AccessController() {}
50+
51+
/**
52+
* Performs the specified action in a privileged block.
53+
*
54+
* <p> If the action's {@code run} method throws an (unchecked)
55+
* exception, it will propagate through this method.
56+
*
57+
* @param action the action to be performed
58+
*/
59+
public static void doPrivileged(Runnable action) {
60+
action.run();
61+
}
62+
63+
/**
64+
* Performs the specified action.
65+
*
66+
* <p> If the action's {@code run} method throws an <i>unchecked</i>
67+
* exception, it will propagate through this method.
68+
*
69+
* @param <T> the type of the value returned by the
70+
* PrivilegedExceptionAction's {@code run} method
71+
*
72+
* @param action the action to be performed
73+
*
74+
* @return the value returned by the action's {@code run} method
75+
*/
76+
public static <T> T doPrivileged(Supplier<T> action) {
77+
return action.get();
78+
}
79+
80+
/**
81+
* Performs the specified action.
82+
*
83+
* <p> If the action's {@code run} method throws an <i>unchecked</i>
84+
* exception, it will propagate through this method.
85+
*
86+
* @param <T> the type of the value returned by the
87+
* PrivilegedExceptionAction's {@code run} method
88+
*
89+
* @param action the action to be performed
90+
*
91+
* @return the value returned by the action's {@code run} method
92+
*
93+
* @throws Exception if the specified action's
94+
* {@code call} method threw a <i>checked</i> exception
95+
*/
96+
public static <T> T doPrivilegedChecked(Callable<T> action) throws Exception {
97+
return action.call();
98+
}
99+
100+
/**
101+
* Performs the specified action in a privileged block.
102+
*
103+
* <p> If the action's {@code run} method throws an (unchecked)
104+
* exception, it will propagate through this method.
105+
*
106+
* @param action the action to be performed
107+
*
108+
* @throws T if the specified action's
109+
* {@code call} method threw a <i>checked</i> exception
110+
*/
111+
public static <T extends Exception> void doPrivilegedChecked(CheckedRunnable<T> action) throws T {
112+
action.run();
113+
}
114+
115+
/**
116+
* A functional interface that represents a runnable action that can throw a checked exception.
117+
*
118+
* @param <E> the type of the exception that can be thrown
119+
*/
120+
public interface CheckedRunnable<E extends Exception> {
121+
122+
/**
123+
* Executes the action.
124+
*
125+
* @throws E
126+
*/
127+
void run() throws E;
128+
}
129+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/**
10+
* Classes for running code in a privileged context
11+
*/
12+
package org.opensearch.secure_sm;

0 commit comments

Comments
 (0)