Skip to content

Commit 103d28c

Browse files
authored
Merge branch 'main' into reduce_log_level_for_deleteoldindices
Signed-off-by: Subhobrata Dey <[email protected]>
2 parents de93144 + 61715cd commit 103d28c

File tree

385 files changed

+22883
-4229
lines changed

Some content is hidden

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

385 files changed

+22883
-4229
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
2-
* @opensearch-project/security-analytics
1+
* @amsiglan @awshurneyt @getsaurabh02 @lezzago @praveensameneni @sbcd90 @eirsep

.github/workflows/add-untriaged.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Apply 'untriaged' label during issue lifecycle
2+
3+
on:
4+
issues:
5+
types: [opened, reopened, transferred]
6+
7+
jobs:
8+
apply-label:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/github-script@v6
12+
with:
13+
script: |
14+
github.rest.issues.addLabels({
15+
issue_number: context.issue.number,
16+
owner: context.repo.owner,
17+
repo: context.repo.repo,
18+
labels: ['untriaged']
19+
})

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
os: [ ubuntu-latest, windows-latest, macos-latest ]
1919
include:
2020
- os: windows-latest
21-
os_build_args: -x jacocoTestReport
21+
os_build_args: -x integTest -x jacocoTestReport
2222
working_directory: X:\
2323
os_java_options: -Xmx4096M
2424
- os: macos-latest
25-
os_build_args: -x jacocoTestReport
25+
os_build_args: -x integTest -x jacocoTestReport
2626

2727
name: Build and Test security-analytics with JDK ${{ matrix.java }} on ${{ matrix.os }}
2828
runs-on: ${{ matrix.os }}

.github/workflows/maven-publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish snapshots to maven
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [
7+
main
8+
1.*
9+
2.*
10+
]
11+
12+
jobs:
13+
build-and-publish-snapshots:
14+
strategy:
15+
fail-fast: false
16+
if: github.repository == 'opensearch-project/security-analytics'
17+
runs-on: ubuntu-latest
18+
19+
permissions:
20+
id-token: write
21+
contents: write
22+
23+
steps:
24+
- uses: actions/setup-java@v3
25+
with:
26+
distribution: temurin # Temurin is a distribution of adoptium
27+
java-version: 17
28+
- uses: actions/checkout@v3
29+
- uses: aws-actions/configure-aws-credentials@v1
30+
with:
31+
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
32+
aws-region: us-east-1
33+
- name: publish snapshots to maven
34+
run: |
35+
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
36+
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
37+
echo "::add-mask::$SONATYPE_USERNAME"
38+
echo "::add-mask::$SONATYPE_PASSWORD"
39+
./gradlew publishPluginZipPublicationToSnapshotsRepository

.whitesource

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"scanSettings": {
3+
"configMode": "AUTO",
4+
"configExternalURL": "",
5+
"projectToken": "",
6+
"baseBranches": []
7+
},
8+
"checkRunSettings": {
9+
"vulnerableCheckRunConclusionLevel": "failure",
10+
"displayMode": "diff",
11+
"useMendCheckNames": true
12+
},
13+
"issueSettings": {
14+
"minSeverityLevel": "LOW",
15+
"issueType": "DEPENDENCY"
16+
},
17+
"remediateSettings": {
18+
"workflowRules": {
19+
"enabled": true
20+
}
21+
}
22+
}

MAINTAINERS.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
## Maintainers
2-
| Maintainer | GitHub ID | Affiliation |
3-
|------------------------|-------------------------------------------------| ----------- |
4-
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
5-
| Subhobrata Dey | [sbcd90](https://github.com/sbcd90) | Amazon |
6-
| Surya Sashank Nistalai | [eirsep](https://github.com/eirsep) | Amazon |
1+
## Overview
72

3+
This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).
84

9-
[This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
5+
## Current Maintainers
6+
7+
| Maintainer | GitHub ID | Affiliation |
8+
| ---------------- | ----------------------------------------------------- | ----------- |
9+
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
10+
| Subhobrata Dey | [sbcd90](https://github.com/sbcd90) | Amazon |
11+
| Thomas Hurney | [awshurneyt](https://github.com/AWSHurneyt) | Amazon |
12+
| Surya Sashank Nistala | [eirsep](https://github.com/eirsep) | Amazon |
13+
| Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon |
14+
| Amardeepsingh Siglani | [amsiglan](https://github.com/amsiglan) | Amazon |
15+
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |

build-tools/opensearchplugin-coverage.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ jacocoTestReport {
3737
getSourceDirectories().from(sourceSets.main.allSource)
3838
getClassDirectories().from(sourceSets.main.output)
3939
reports {
40-
html.enabled = true // human readable
41-
xml.enabled = true // for coverlay
40+
html.required = true // human readable
41+
xml.required = true // for coverlay
4242
}
4343
}
4444

build.gradle

Lines changed: 39 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.opensearch.gradle.test.RestIntegTestTask
66

77
buildscript {
88
ext {
9-
opensearch_version = System.getProperty("opensearch.version", "2.4.0-SNAPSHOT")
9+
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
1010
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
1111
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
1212
version_tokens = opensearch_version.tokenize('-')
@@ -35,7 +35,7 @@ buildscript {
3535
}
3636

3737
plugins {
38-
id 'nebula.ospackage' version "8.3.0"
38+
id "com.netflix.nebula.ospackage" version "11.3.0"
3939
id 'java-library'
4040
}
4141

@@ -53,7 +53,7 @@ ext {
5353

5454
licenseHeaders.enabled = true
5555
testingConventions.enabled = false
56-
forbiddenApis.ignoreFailures = false
56+
forbiddenApis.ignoreFailures = true
5757

5858
dependencyLicenses.enabled = false
5959
thirdPartyAudit.enabled = false
@@ -116,6 +116,17 @@ publishing {
116116
}
117117
}
118118
}
119+
120+
repositories {
121+
maven {
122+
name = "Snapshots"
123+
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
124+
credentials {
125+
username "$System.env.SONATYPE_USERNAME"
126+
password "$System.env.SONATYPE_PASSWORD"
127+
}
128+
}
129+
}
119130
}
120131

121132
repositories {
@@ -125,19 +136,27 @@ repositories {
125136
}
126137

127138
sourceSets.main.java.srcDirs = ['src/main/generated','src/main/java']
139+
configurations {
140+
zipArchive
141+
}
128142

129143
dependencies {
130144
javaRestTestImplementation project.sourceSets.main.runtimeClasspath
131145
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
132146
implementation "org.antlr:antlr4-runtime:4.10.1"
133147
implementation "com.cronutils:cron-utils:9.1.6"
134-
api "org.opensearch:common-utils:${common_utils_version}"
148+
api "org.opensearch:common-utils:${common_utils_version}@jar"
135149
api "org.opensearch.client:opensearch-rest-client:${opensearch_version}"
136150
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
151+
152+
// Needed for integ tests
153+
zipArchive group: 'org.opensearch.plugin', name:'alerting', version: "${opensearch_build}"
154+
zipArchive group: 'org.opensearch.plugin', name:'opensearch-notifications-core', version: "${opensearch_build}"
155+
zipArchive group: 'org.opensearch.plugin', name:'notifications', version: "${opensearch_build}"
137156
}
138157

139158
// RPM & Debian build
140-
apply plugin: 'nebula.ospackage'
159+
apply plugin: 'com.netflix.nebula.ospackage'
141160

142161
def es_tmp_dir = rootProject.file('build/private/es_tmp').absoluteFile
143162
es_tmp_dir.mkdirs()
@@ -209,15 +228,6 @@ integTest.getClusters().forEach{c -> {
209228
c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))
210229
}}
211230

212-
String alertingFilePath = "src/test/resources/alerting"
213-
String alertingPlugin = "opensearch-alerting-" + plugin_no_snapshot + ".zip"
214-
String alertingRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_no_snapshot + "/latest/linux/x64/tar/builds/opensearch/plugins/" + alertingPlugin
215-
String notificationsFilePath = "src/test/resources/notifications"
216-
String notificationsCoreFilePath = "src/test/resources/notifications-core"
217-
String notificationsPlugin = "opensearch-notifications-" + plugin_no_snapshot + ".zip"
218-
String notificationsCorePlugin = "opensearch-notifications-core-" + plugin_no_snapshot + ".zip"
219-
String notificationsRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_no_snapshot + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsPlugin
220-
String notificationsCoreRemoteFile = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/" + opensearch_no_snapshot + "/latest/linux/x64/tar/builds/opensearch/plugins/" + notificationsCorePlugin
221231
testClusters.integTest {
222232
testDistribution = 'ARCHIVE'
223233

@@ -233,58 +243,33 @@ testClusters.integTest {
233243
debugPort += 1
234244
}
235245
}
236-
setting 'path.repo', repo.absolutePath
237246
plugin(provider({
238247
new RegularFile() {
239248
@Override
240249
File getAsFile() {
241-
File dir = new File(rootDir.path + "/" + alertingFilePath)
242-
243-
if (!dir.exists()) {
244-
dir.mkdirs()
245-
}
246-
247-
File f = new File(dir, alertingPlugin)
248-
if (!f.exists()) {
249-
new URL(alertingRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
250-
}
251-
fileTree(alertingFilePath).getSingleFile()
250+
return configurations.zipArchive.asFileTree.matching {
251+
include '**/opensearch-notifications-core*'
252+
}.singleFile
252253
}
253254
}
254255
}))
255256
plugin(provider({
256257
new RegularFile() {
257258
@Override
258259
File getAsFile() {
259-
File dir = new File(rootDir.path + "/" + notificationsCoreFilePath)
260-
261-
if (!dir.exists()) {
262-
dir.mkdirs()
263-
}
264-
265-
File f = new File(dir, notificationsCorePlugin)
266-
if (!f.exists()) {
267-
new URL(notificationsCoreRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
268-
}
269-
fileTree(notificationsCoreFilePath).getSingleFile()
260+
return configurations.zipArchive.asFileTree.matching {
261+
include '**/notifications*'
262+
}.singleFile
270263
}
271264
}
272265
}))
273266
plugin(provider({
274267
new RegularFile() {
275268
@Override
276269
File getAsFile() {
277-
File dir = new File(rootDir.path + "/" + notificationsFilePath)
278-
279-
if (!dir.exists()) {
280-
dir.mkdirs()
281-
}
282-
283-
File f = new File(dir, notificationsPlugin)
284-
if (!f.exists()) {
285-
new URL(notificationsRemoteFile).withInputStream{ ins -> f.withOutputStream{ it << ins }}
286-
}
287-
fileTree(notificationsFilePath).getSingleFile()
270+
return configurations.zipArchive.asFileTree.matching {
271+
include '**/alerting*'
272+
}.singleFile
288273
}
289274
}
290275
}))
@@ -332,7 +317,7 @@ afterEvaluate {
332317
ospackage {
333318
packageName = "${name}"
334319
release = isSnapshot ? "0.1" : '1'
335-
version = "${project.version}"
320+
version = "${project.version}" - "-SNAPSHOT"
336321

337322
into '/usr/share/opensearch/plugins'
338323
from(zipTree(bundlePlugin.archivePath)) {
@@ -365,23 +350,18 @@ afterEvaluate {
365350
finalizedBy 'renameRpm'
366351
task renameRpm(type: Copy) {
367352
from("$buildDir/distributions")
368-
into("$buildDir/distributions")
369-
include archiveName
370-
rename archiveName, "${packageName}-${version}.rpm"
371-
doLast { delete file("$buildDir/distributions/$archiveName") }
353+
rename "$archiveFileName", "${packageName}-${archiveVersion}.rpm"
354+
doLast { delete file("$buildDir/distributions/$archiveFileName") }
372355
}
373356
}
374-
375357
buildDeb {
376358
arch = 'all'
377359
dependsOn 'assemble'
378360
finalizedBy 'renameDeb'
379361
task renameDeb(type: Copy) {
380362
from("$buildDir/distributions")
381-
into("$buildDir/distributions")
382-
include archiveName
383-
rename archiveName, "${packageName}-${version}.deb"
384-
doLast { delete file("$buildDir/distributions/$archiveName") }
363+
rename "$archiveFileName", "${packageName}-${archiveVersion}.deb"
364+
doLast { delete file("$buildDir/distributions/$archiveFileName") }
385365
}
386366
}
387-
}
367+
}

gradle/wrapper/gradle-wrapper.jar

2.2 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)