Skip to content

Commit

Permalink
Merge pull request #174 from leeyun-amzn/main-to-1.x
Browse files Browse the repository at this point in the history
Cherry-pick commits from main to 1.x
  • Loading branch information
Annie Lee authored Mar 9, 2022
2 parents ddaf063 + 11044c8 commit d7cd6ab
Show file tree
Hide file tree
Showing 473 changed files with 9,129 additions and 9,994 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This should match the owning team set up in https://github.com/orgs/opensearch-project/teams
* @opensearch-project/alerting-plugin
29 changes: 29 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
name: Backport
steps:
- name: GitHub App token
id: github_app_token
uses: tibdex/github-app-token@v1.5.0
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780

- name: Backport
uses: VachaShah/backport@v1.1.4
with:
github_token: ${{ steps.github_app_token.outputs.token }}
branch_name: backport/backport-${{ github.event.number }}
4 changes: 3 additions & 1 deletion .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ on:
pull_request:
branches:
- main
- 1.x
push:
branches:
- main
- 1.x
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
OPENSEARCH_VERSION: '1.2.0-SNAPSHOT'
OPENSEARCH_VERSION: '1.3.0-SNAPSHOT'
jobs:
tests:
name: Run Cypress E2E tests
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Delete merged branch of the backport PRs
on:
pull_request:
types:
- closed

jobs:
delete-branch:
runs-on: ubuntu-latest
if: startsWith(github.event.pull_request.head.ref,'backport/')
steps:
- name: Delete merged branch
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ on:
push:
branches:
- main
- 1.x
pull_request:
branches:
- main
- 1.x
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
jobs:
Expand Down
15 changes: 15 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scanSettings": {
"configMode": "AUTO",
"configExternalURL": "",
"projectToken": "",
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
47 changes: 2 additions & 45 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
## Contributing to OpenSearch
## Contributing to this Project

OpenSearch is a community project that is built and maintained by people just like **you**.
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects.

## Developer Certificate of Origin

OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache](https://www.apache.org/licenses/LICENSE-2.0) site or the [LICENSE.txt file](https://github.com/opensearch-project/.github/blob/main/LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software.

We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.

The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/).
````
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the
best of my knowledge, is covered under an appropriate open
source license and I have the right under that license to
submit that work with modifications, whether created in whole
or in part by me, under the same open source license (unless
I am permitted to submit under a different license), as
Indicated in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including
all personal information I submit with it, including my
sign-off) is maintained indefinitely and may be redistributed
consistent with this project or the open source license(s)
involved.
````
We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms.

Each commit must include a DCO which looks like this
````
Signed-off-by: Jane Smith <jane.smith@email.com>
````
You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `–-signoff` to add the `Signed-off-by` line to the end of the commit message.
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects.
10 changes: 0 additions & 10 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@
OpenSearch (https://opensearch.org/)
Copyright OpenSearch Contributors

This product includes software developed by
Elasticsearch (http://www.elastic.co).
Copyright 2009-2018 Elasticsearch

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).

This product includes software developed by
Joda.org (http://www.joda.org/).
134 changes: 134 additions & 0 deletions cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"name": "sample_alerts_flyout_bucket_level_monitor",
"type": "monitor",
"monitor_type": "bucket_level_monitor",
"enabled": true,
"schedule": {
"period": {
"unit": "MINUTES",
"interval": 1
}
},
"inputs": [
{
"search": {
"indices": ["opensearch_dashboards_sample_data_ecommerce"],
"query": {
"size": 0,
"aggregations": {
"composite_agg": {
"composite": {
"sources": [
{
"customer_gender": {
"terms": {
"field": "customer_gender"
}
}
},
{
"user": {
"terms": {
"field": "user"
}
}
}
]
},
"aggs": {
"avg_products_price": {
"avg": {
"field": "products.price"
}
}
}
}
},
"query": {
"bool": {
"filter": [
{
"range": {
"order_date": {
"gte": "{{period_end}}||-10d",
"lte": "{{period_end}}",
"format": "epoch_millis"
}
}
}
]
}
}
}
}
}
],
"triggers": [
{
"bucket_level_trigger": {
"id": "JHpsfH0BYHgJ26-yS5n7",
"name": "sample_alerts_flyout_bucket_level_trigger",
"severity": "4",
"condition": {
"buckets_path": {
"_count": "_count",
"avg_products_price": "avg_products_price"
},
"parent_bucket_path": "composite_agg",
"script": {
"source": "params._count < 10000 || params.avg_products_price == 10",
"lang": "painless"
},
"gap_policy": "skip"
},
"actions": []
}
}
],
"ui_metadata": {
"schedule": {
"timezone": null,
"frequency": "interval",
"period": {
"unit": "MINUTES",
"interval": 1
},
"daily": 0,
"weekly": {
"tue": false,
"wed": false,
"thur": false,
"sat": false,
"fri": false,
"mon": false,
"sun": false
},
"monthly": {
"type": "day",
"day": 1
},
"cronExpression": "0 */1 * * *"
},
"search": {
"searchType": "graph",
"timeField": "order_date",
"aggregations": [
{
"aggregationType": "avg",
"fieldName": "products.price"
}
],
"groupBy": ["customer_gender", "user"],
"bucketValue": 10,
"bucketUnitOfTime": "d",
"where": {
"fieldName": [],
"fieldRangeEnd": 0,
"fieldRangeStart": 0,
"fieldValue": "",
"operator": "is"
}
},
"monitor_type": "bucket_level_monitor"
}
}
101 changes: 101 additions & 0 deletions cypress/fixtures/sample_alerts_flyout_query_level_monitor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"name": "sample_alerts_flyout_query_level_monitor",
"type": "monitor",
"monitor_type": "query_level_monitor",
"enabled": true,
"schedule": {
"period": {
"unit": "MINUTES",
"interval": 1
}
},
"inputs": [
{
"search": {
"indices": ["opensearch_dashboards_sample_data_ecommerce"],
"query": {
"size": 0,
"aggregations": {
"terms_agg": {
"terms": {
"field": "user"
}
}
},
"query": {
"bool": {
"filter": [
{
"range": {
"order_date": {
"gte": "{{period_end}}||-10d",
"lte": "{{period_end}}",
"format": "epoch_millis"
}
}
}
]
}
}
}
}
}
],
"triggers": [
{
"query_level_trigger": {
"id": "YHpufH0BYHgJ26-yhJm-",
"name": "sample_alerts_flyout_query_level_trigger",
"severity": "2",
"condition": {
"script": {
"source": "ctx.results[0].hits.total.value < 10000",
"lang": "painless"
}
},
"actions": []
}
}
],
"ui_metadata": {
"schedule": {
"timezone": null,
"frequency": "interval",
"period": {
"unit": "MINUTES",
"interval": 1
},
"daily": 0,
"weekly": {
"tue": false,
"wed": false,
"thur": false,
"sat": false,
"fri": false,
"mon": false,
"sun": false
},
"monthly": {
"type": "day",
"day": 1
},
"cronExpression": "0 */1 * * *"
},
"search": {
"searchType": "graph",
"timeField": "order_date",
"aggregations": [],
"groupBy": ["user"],
"bucketValue": 10,
"bucketUnitOfTime": "d",
"where": {
"fieldName": [],
"fieldRangeEnd": 0,
"fieldRangeStart": 0,
"fieldValue": "",
"operator": "is"
}
},
"monitor_type": "query_level_monitor"
}
}
Loading

0 comments on commit d7cd6ab

Please sign in to comment.