Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integ test failure fix #1437

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
9f3c393
Added 2.1 release notes. (#485)
AWSHurneyt Jul 6, 2022
a27d5a2
Add support for reproducible builds (#472)
inglor Jul 26, 2022
3b8bfe7
Staging for version increment automation (#489)
prudhvigodithi Jul 26, 2022
fea6b4a
Refactored backwards compatibility tests to point to the OpenSearch 1…
AWSHurneyt Aug 4, 2022
087982d
Cherry-picked 2.2 commits to main. (#518)
AWSHurneyt Aug 12, 2022
9218363
Replace Forum link in Alerting plugin README.md (#545)
cwillum Sep 8, 2022
ac868dd
Deprecate the Master nomenclature (#548)
sbcd90 Sep 8, 2022
5074f7b
Adds support in monitor configs for custom alerts, findings, queries …
eirsep Sep 12, 2022
415dc82
Adds support for fetching alerts from custom alert index in Get Alert…
eirsep Sep 21, 2022
4ca0fb0
GetFindingsAction new optional parameters (#563)
petardz Sep 23, 2022
3a844f8
Disable ktlint for alerting as it has errors on Windows (#570)
peterzhuamazon Sep 27, 2022
cda8301
Adds owner field in monitor model (#579)
eirsep Oct 3, 2022
c532061
support query deletion from custom query index on delete monitor (#584)
eirsep Oct 4, 2022
2c7c652
Use custom query index in update monitor flow (#591)
eirsep Oct 7, 2022
19dec99
Bumps alerting to 2.4 (#596)
eirsep Oct 10, 2022
1547560
Use alerting models and dtos from common-utils dependencies. (#592)
eirsep Oct 10, 2022
4165eac
add tags to trigger condition of doc-level monitor (#598)
sbcd90 Oct 11, 2022
01a28e9
Remove plugin to OS min race condition (#601)
prudhvigodithi Oct 13, 2022
f4a3509
Enhance Get Alerts and Get Findings for list of monitors in bulk (#590)
eirsep Oct 14, 2022
e94ea32
use acknowledge alert request,response, actions from common-utils dep…
eirsep Oct 14, 2022
3c74744
Support fetching alerts by list of alert ids in Get Alerts Action (#608)
eirsep Oct 18, 2022
996190e
searchAlert fix (#613)
petardz Oct 19, 2022
2005185
change transport ack alerts action to accept Action Request and recre…
eirsep Oct 20, 2022
7546b00
Custom history indicies (#616)
petardz Oct 21, 2022
ce79ffd
fix alias exists check in findings index creation (#622)
eirsep Oct 25, 2022
49fbb4d
fix for windows ktlint issue (#585)
sbcd90 Oct 26, 2022
0740d9b
Ack alerts - allow moving alerts to history index with custom datasou…
petardz Oct 28, 2022
c6c12db
refactored DeleteMonitor Action to be synchronious (#628)
petardz Nov 1, 2022
3491fb2
Enabled parsing of bucket level monitors when executing the transport…
stevanbz Nov 3, 2022
80504a9
add tests to verify owner field (#637)
eirsep Nov 4, 2022
f986238
Support to specify backend roles for monitors (#635)
lezzago Nov 4, 2022
bb84683
Add 2.4 release notes (#647)
lezzago Nov 5, 2022
5b451b9
Adds findings in bucket level monitor (#636)
eirsep Nov 5, 2022
f842a04
update release notes (#654)
eirsep Nov 7, 2022
ceff609
Added exception check once the .opendistro-alerting-config index is b…
stevanbz Nov 7, 2022
1018fa2
create findingIndex bugfix (#653)
petardz Nov 7, 2022
42abf4d
Added support for "nested" mappings (#645)
petardz Nov 7, 2022
0fb9dd0
fix bucket level monitor findings to support term aggs in query (#666)
eirsep Nov 9, 2022
0afcc4a
mappings traversal bug fix (#669)
petardz Nov 9, 2022
817d9ef
set lastnotification time as created time for new bucket level monito…
eirsep Nov 11, 2022
9d9f588
Set message when building LegacyCustomWebhookMessage (#670)
petar-partlov Dec 1, 2022
41265f8
Seperate variables for alert and finding scheduled rollovers (#705)
lezzago Dec 20, 2022
2a1a185
Fix error message bug to show the correct destination ID thats missin…
lezzago Dec 20, 2022
88536b2
Overriding defaultTitle with subject for SNS notifications (#708)
uroskarama Dec 20, 2022
6f48746
QueryIndex rollover when field mapping limit is reached (#725)
petardz Dec 31, 2022
19d4a41
Added unwrapping exception from core; added more debug logs (#728)
petardz Jan 6, 2023
1098203
fix percolator mapping error when having field name 'type' (#726)
raj-chak Jan 11, 2023
780744f
Added 2.5 release notes. (#743)
AWSHurneyt Jan 11, 2023
8084943
Added document _id as param for terms query when searching alerts by …
stevanbz Jan 13, 2023
e4236db
Dev guide update to include building/using local os-min distro (#757)
petardz Jan 19, 2023
fa47702
Updated MAINTAINERS.md to match recommended opensearch-project format…
dblock Jan 23, 2023
daf8c7c
fix for ERROR alert state generation in doc-level monitors (#768)
sbcd90 Jan 27, 2023
270303d
Version bump to 3.0 (#762)
lezzago Jan 30, 2023
ce7094a
[BUG] ExecuteMonitor inserting metadata doc during dry run (#758)
petardz Feb 3, 2023
c9d84cb
Adjusting max field index setting dynamically for query index (#776)
petardz Feb 3, 2023
830dff1
Fix setting default title only when no subject has been set (#750)
lezzago Feb 9, 2023
c51940f
fixed security tests (#484)
raj-chak Feb 10, 2023
c7fed1b
Fixed cluster metrics monitor tests following bug fix in PR https://g…
AWSHurneyt Feb 21, 2023
c426173
minot fix to prevent flaky tests in downstream plugins (#804)
sbcd90 Feb 21, 2023
06c58b0
Publish snapshots to maven via GHA (#805)
lezzago Feb 21, 2023
de9fa64
Multiple indices support in DocLevelMonitorInput (#784)
petardz Feb 21, 2023
db83a81
Added 2.6 release notes. (#809)
lezzago Feb 21, 2023
a3c9f3b
revert enabled field in source_to_query_index_mapping (#812)
sbcd90 Feb 22, 2023
8ba7cfd
Fix Xcontent build issues (#819)
lezzago Mar 3, 2023
bcd8988
Created untriaged issue workflow. (#795)
dblock Mar 9, 2023
3f2e651
Adjusted mockito dependency to retrieve the version from OpenSearch c…
AWSHurneyt Mar 29, 2023
702da92
Fixed transformation of document field names before running percolato…
petardz Apr 6, 2023
fcdcdcb
use latest common-utils snapshot (#858)
lezzago Apr 15, 2023
e0b7a5a
Notification security fix (#852)
petardz Apr 17, 2023
6a5c041
Mappings parsing fix (#851)
petardz Apr 17, 2023
21aeb3c
Update config index schema if needed at the start of each monitor exe…
lezzago Apr 18, 2023
6e94ee2
Added 2.7 release notes. (#864)
AWSHurneyt Apr 18, 2023
e6a6b07
Fix getAlerts API for standard Alerting monitors (#870)
lezzago Apr 18, 2023
37b81fa
integrate security-analytics & alerting for correlation engine (#878)
sbcd90 Apr 19, 2023
1ebe8d7
Baseline codeowners and maintainers (#818)
lezzago Apr 27, 2023
58d2b03
upgrade gradle to 8.1.1 (#893)
sbcd90 Apr 28, 2023
4ba7d42
DocLevel Monitor - generate findings when 0 triggers (#856)
petardz May 2, 2023
8c033b9
Fixed a bug that prevented alerts from being generated for doc level …
AWSHurneyt May 5, 2023
461e95f
DocLevelMonitor Error Alert - rework (#892)
petardz May 5, 2023
9e9f765
DocLevelMonitor Error Alert revisit (#905)
petardz May 9, 2023
2bd679f
Update codeowners and maintainers (#899)
lezzago May 10, 2023
89142f4
Updating the CODEOWNERS file with the right format (#911)
bbarani May 10, 2023
333349c
log error messages and clean up monitor when indexing doc level queri…
eirsep May 10, 2023
9b44a26
Compile fix - Strings package change (#924)
petardz May 25, 2023
5e2312d
revert to deleting monitor metadata after deleting doc level queries …
eirsep May 25, 2023
85c013d
Adds transport layer actions for CRUD workflows (#934)
eirsep May 25, 2023
3cb1a3d
Added 2.8 release notes (#939)
bowenlan-amzn May 26, 2023
32c0bb0
fix schema version in tests and delegate monitor metadata constructio…
eirsep Jun 2, 2023
33d913d
Use strong password in security test (#933) (#954)
bowenlan-amzn Jun 19, 2023
b3c3f23
Added rest layer for the workflow. (#963)
eirsep Jun 21, 2023
62d2524
add workflow_id field in alert mapping (#969)
eirsep Jun 22, 2023
6da86fe
fix alert constructor with noop trigger to use execution id and workf…
eirsep Jul 8, 2023
641d17b
Fixed search monitor API to return alert counts. (#978)
AWSHurneyt Jul 10, 2023
5fc607b
Check if AD backend role is enabled (#968)
amitgalitz Jul 10, 2023
a5ad3b9
Fix getAlerts RBAC problem (#991)
lezzago Jul 11, 2023
a3db266
[BucketLevelMonitor] Multi-term agg support (#964)
petardz Jul 11, 2023
3911ca9
Adds chained alerts (#976)
eirsep Jul 12, 2023
a772019
Implemented support for configuring a cluster metrics monitor to call…
AWSHurneyt Jul 12, 2023
2d3af5b
Added 2.9 release notes. (#1010)
AWSHurneyt Jul 12, 2023
dc22baa
Temp refactor cluster metrics monitor suspendUntil() to get(). (#1015)
AWSHurneyt Jul 12, 2023
2430d81
Add workflowIds field in getAlerts API (#1014)
eirsep Jul 12, 2023
6b85728
Upgrade the backport workflow (#1029)
lezzago Jul 17, 2023
d879e1a
Update imports for files refactored in core PR #8157 (#1025)
lezzago Jul 24, 2023
f08cea5
fix password argument in SecureRestClientBuilder constructor for Secu…
opensearch-trigger-bot[bot] Jul 26, 2023
e511009
add workflow type field exists check in search monitors action to ret…
opensearch-trigger-bot[bot] Jul 26, 2023
eb0844e
Fix get alerts api to also return chained alerts with default params.…
opensearch-trigger-bot[bot] Jul 26, 2023
5fbb18a
Resolve core Xcontent and CircuitBreaker refactor (#1062)
lezzago Aug 1, 2023
3baf51a
Update actionGet to SuspendUntil for ClusterMetrics (#1067)
lezzago Aug 2, 2023
03acc53
fix get alerts alertState query filter (#1064) (#1066)
opensearch-trigger-bot[bot] Aug 2, 2023
d9f66b3
add alertId parameter in get chained alert API and paginate associate…
eirsep Aug 2, 2023
09911d2
Added workflow auto-release solving the issue https://github.com/open…
LastZhabka Aug 2, 2023
b1f4bed
update alerting main after core changes (#1080)
sbcd90 Aug 7, 2023
6e7a16b
fix breaking change from core library refactor (#1090)
eirsep Aug 16, 2023
778e7ce
exclude <v32 version of google guava dependency from google java form…
eirsep Aug 17, 2023
ec83886
Update BWC version to fix BWC tests (#1103)
lezzago Aug 25, 2023
0f2dec7
Chained Alert Behaviour Changes (#1079)
eirsep Aug 25, 2023
7b9584c
Adds support for using findings from list of monitors as input data f…
eirsep Sep 2, 2023
0ce01cb
add primary first preference in search request for fetching audit sta…
eirsep Sep 5, 2023
7f0c7c7
optimize doc-level monitor workflow for index patterns (#1097)
sbcd90 Sep 6, 2023
a7962cd
Updates demo certs used in integ tests (#1115)
DarshitChanpura Sep 7, 2023
49a67ea
Added 2.10 release notes (#1117)
lezzago Sep 7, 2023
d6fd871
add workflow null or empty check only when empty workflow id passed. …
eirsep Sep 13, 2023
3647e9c
ignore flaky security tests (#1166)
eirsep Sep 15, 2023
2197d46
Add primary first calls for different monitor types (#1205)
lezzago Oct 2, 2023
f5fc62c
fix workflow execution for first run (#1220)
sbcd90 Oct 4, 2023
0a15bfd
Add logging for execution and indexes of monitors and workflows (#1223)
lezzago Oct 4, 2023
941d457
Reduce log level for informative message (#1218)
eht16 Oct 5, 2023
6f29716
fix constructor (#1240)
eirsep Oct 9, 2023
2996611
[PR]Ensure Github workflow runs on docker image used by Production Di…
peterzhuamazon Oct 11, 2023
3529e03
Drafted 2.11 release notes. (#1251)
AWSHurneyt Oct 11, 2023
36d81e4
fix for concurrentmodificationexception with linkedhashmap (#1255)
sbcd90 Oct 12, 2023
b195c59
[PR2]Ensure Github workflow runs on docker image used by Production D…
peterzhuamazon Oct 13, 2023
c2f45de
Changed @Ignore to @AwaitsFix (#1245)
kennyzhang0819 Oct 13, 2023
ca9b75c
Avoid hardcoding username for uid 1000 on docker container (#1271)
peterzhuamazon Oct 16, 2023
2146199
add nested fields param mapping findings index for doc level queries …
eirsep Oct 24, 2023
a26f4c0
change Thread.sleep to waitUntil function under test files (#1242)
JacobCho-i Nov 10, 2023
06c1b8a
Added 2.11.1 release notes. (#1306)
AWSHurneyt Nov 21, 2023
32718e8
fix workflow security tests in alerting (#1310)
sbcd90 Nov 26, 2023
b7c1823
Reference get monitor and search monitor action / request / responses…
ohltyler Nov 28, 2023
903a6d9
optimize doc-level monitor execution workflow for datastreams (#1302)
sbcd90 Dec 8, 2023
008e076
Set docData to empty string if actual is null (#1325)
engechas Dec 21, 2023
526433a
Add token to chime URL used in tests to adhere to new Notifications v…
engechas Dec 21, 2023
733fd4e
Don't attempt to parse workflow if it doesn't exist (#1346)
engechas Jan 3, 2024
48e56bf
Removed log entry regarding destination migration (#1356)
riysaxen-amzn Jan 8, 2024
bea2e68
Update to Gradle 8.5 (#1369)
reta Jan 13, 2024
ffc183f
Inject namedWriteableRegistry during ser/deser of SearchMonitorAction…
ohltyler Jan 18, 2024
3c50f7d
removed default admin credentials for alerting (#1399)
toepkerd Feb 1, 2024
8d59060
ipaddress lib upgrade as part of cve fix (#1397)
riysaxen-amzn Feb 6, 2024
b561965
Bulk index findings and sequentially invoke auto-correlations (#1355)
goyamegh Feb 6, 2024
ea36996
Implemented cross-cluster monitor support (#1404)
AWSHurneyt Feb 6, 2024
b10eaad
Add 2.12 release notes (#1408)
engechas Feb 6, 2024
4cdc1d1
Add publishToMavenLocal in build.sh (#1418)
zane-neo Feb 9, 2024
719db46
Added chase as a maintainer. (#1416)
AWSHurneyt Feb 9, 2024
5b3e1a2
fix for MapperException[the [enabled] parameter can't be updated for …
sbcd90 Feb 16, 2024
57e1820
added sleep for flaky tests
riysaxen-amzn Feb 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
* @opensearch-project/alerting-plugin
* @lezzago @AWSHurneyt @sbcd90 @eirsep @getsaurabh02 @praveensameneni @qreshi @bowenlan-amzn @rishabhmaurya @engechas
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*Description of changes:*

*CheckList:*
[ ] Commits are signed per the DCO using --signoff
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/alerting/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
19 changes: 19 additions & 0 deletions .github/workflows/add-untriaged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Apply 'untriaged' label during issue lifecycle

on:
issues:
types: [opened, reopened, transferred]

jobs:
apply-label:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['untriaged']
})
29 changes: 29 additions & 0 deletions .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Releases

on:
push:
tags:
- '*'

jobs:

build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
- uses: actions/checkout@v2
- uses: ncipollo/release-action@v1
with:
github_token: ${{ steps.github_app_token.outputs.token }}
bodyFile: release-notes/opensearch.release-notes-${{steps.tag.outputs.tag}}.md
4 changes: 3 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
installation_id: 22958780

- name: Backport
uses: VachaShah/backport@v1.1.4
uses: VachaShah/backport@v2.2.0
with:
github_token: ${{ steps.github_app_token.outputs.token }}
branch_name: backport/backport-${{ github.event.number }}
labels_template: "<%= JSON.stringify([...labels, 'autocut']) %>"
failure_labels: "failed backport"
28 changes: 19 additions & 9 deletions .github/workflows/bwc-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,39 @@ on:
- "*"

jobs:
build:
Get-CI-Image-Tag:
uses: ./.github/workflows/get-ci-image-tag.yml
with:
platform: centos7
usage: opensearch

build-linux:
needs: Get-CI-Image-Tag
strategy:
matrix:
java: [ 11 ]
# Job name
name: Build and test Alerting
# This job runs on Linux
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK 11
- name: Set Up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: 11
java-version: ${{ matrix.java }}
- name: Run Alerting Backwards Compatibility Tests
run: |
echo "Running backwards compatibility tests..."
./gradlew bwcTestSuite
chown -R opensearch.opensearch `pwd`
su opensearch -c "whoami && java -version && ./gradlew bwcTestSuite"
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish snapshots to maven

on:
workflow_dispatch:
push:
branches: [
main
1.*
2.*
]

jobs:
build-and-publish-snapshots:
strategy:
fail-fast: false
matrix:
jdk: [17]
platform: ["ubuntu-latest"]
if: github.repository == 'opensearch-project/alerting'
runs-on: ${{ matrix.platform }}

permissions:
id-token: write
contents: write

steps:
- uses: actions/setup-java@v3
with:
distribution: temurin # Temurin is a distribution of adoptium
java-version: ${{ matrix.jdk }}
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
aws-region: us-east-1
- name: publish snapshots to maven
run: |
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew publishPluginZipPublicationToSnapshotsRepository
19 changes: 17 additions & 2 deletions .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@ on:
- "*"

jobs:
build:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
strategy:
matrix:
java: [ 11, 17 ]
# Job name
name: Build and test Alerting
# This job runs on Linux
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK ${{ matrix.java }}
Expand All @@ -27,4 +40,6 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@v2
- name: Run integration tests with multi node config
run: ./gradlew integTest -PnumNodes=3
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "whoami && java -version && ./gradlew integTest -PnumNodes=3"
17 changes: 11 additions & 6 deletions .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
strategy:
matrix:
java: [ 11, 17 ]
java: [ 11, 17, 21 ]
# Job name
name: Build and test Alerting
# This job runs on Linux
Expand Down Expand Up @@ -43,7 +43,12 @@ jobs:
plugin_version=`echo $plugin|awk -F- '{print $3}'| cut -d. -f 1-4`
qualifier=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-1`
candidate_version=`echo $plugin|awk -F- '{print $5}'| cut -d. -f 1-1`
docker_version=$version-$qualifier
if qualifier
then
docker_version=$version-$qualifier
else
docker_version=$version
fi

[[ -z $candidate_version ]] && candidate_version=$qualifier && qualifier=""

Expand All @@ -68,20 +73,20 @@ jobs:
if: env.imagePresent == 'true'
run: |
cd ..
docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" opensearch-alerting:test
docker run -p 9200:9200 -d -p 9600:9600 -e "OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!" -e "discovery.type=single-node" opensearch-alerting:test
sleep 120

- name: Run Alerting Test for security enabled test cases
if: env.imagePresent == 'true'
run: |
cluster_running=`curl -XGET https://localhost:9200/_cat/plugins -u admin:admin --insecure`
cluster_running=`curl -XGET https://localhost:9200/_cat/plugins -u admin:myStrongPassword123! --insecure`
echo $cluster_running
security=`curl -XGET https://localhost:9200/_cat/plugins -u admin:admin --insecure |grep opensearch-security|wc -l`
security=`curl -XGET https://localhost:9200/_cat/plugins -u admin:myStrongPassword123! --insecure |grep opensearch-security|wc -l`
echo $security
if [ $security -gt 0 ]
then
echo "Security plugin is available"
./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin
./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=myStrongPassword123!
else
echo "Security plugin is NOT available skipping this run as tests without security have already been run"
fi
76 changes: 71 additions & 5 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,30 @@ on:
- "*"

jobs:
build:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
env:
BUILD_ARGS: ${{ matrix.os_build_args }}
WORKING_DIR: ${{ matrix.working_directory }}.
strategy:
matrix:
java: [11, 17]
java: [11, 17, 21]
# Job name
name: Build Alerting with JDK ${{ matrix.java }}
name: Build Alerting with JDK ${{ matrix.java }} on Linux
# This job runs on Linux
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
Expand All @@ -27,7 +43,9 @@ jobs:
with:
java-version: ${{ matrix.java }}
- name: Build and run with Gradle
run: ./gradlew build
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "whoami && java -version && ./gradlew assemble integTest"
- name: Create Artifact Path
run: |
mkdir -p alerting-artifacts
Expand All @@ -41,5 +59,53 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: alerting-plugin
name: alerting-plugin-${{ matrix.os }}
path: alerting-artifacts

build:
needs: Get-CI-Image-Tag
env:
BUILD_ARGS: ${{ matrix.os_build_args }}
WORKING_DIR: ${{ matrix.working_directory }}.
strategy:
matrix:
java: [11, 17, 21]
os: [ windows-latest, macos-latest ]
include:
- os: windows-latest
os_build_args: -x integTest
working_directory: X:\
os_java_options: -Xmx4096M
# Job name
name: Build Alerting with JDK ${{ matrix.java }} on ${{ matrix.os }}
# This job runs on Linux
runs-on: ${{ matrix.os }}
steps:
# This step uses the checkout Github action: https://github.com/actions/checkout
- name: Checkout Branch
uses: actions/checkout@v2
# This is a hack, but this step creates a link to the X: mounted drive, which makes the path
# short enough to work on Windows
- name: Shorten Path
if: ${{ matrix.os == 'windows-latest' }}
run: subst 'X:' .
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Build and run with Gradle
working-directory: ${{ env.WORKING_DIR }}
run: ./gradlew assemble integTest ${{ env.BUILD_ARGS }}
env:
_JAVA_OPTIONS: ${{ matrix.os_java_options }}
- name: Create Artifact Path
run: |
mkdir -p alerting-artifacts
cp ./alerting/build/distributions/*.zip alerting-artifacts
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: alerting-plugin-${{ matrix.os }}
path: alerting-artifacts
Loading
Loading