From 7be0e2e088d83a1a8448d10c1f7b70d71524d0a0 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Fri, 16 Apr 2021 15:30:40 -0700 Subject: [PATCH 1/4] Add docs to main branch --- .github/ISSUE_TEMPLATE/bug_template.md | 33 +++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 6 ++++ CODE_OF_CONDUCT.md | 29 +++++++++++++++--- CONTRIBUTING.md | 36 +++++++++++++++++++++++ LICENSE | 28 +++++++++++++++++- MAINTAINERS.md | 8 +++++ NOTICE | 13 +++++++- 8 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_template.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 MAINTAINERS.md diff --git a/.github/ISSUE_TEMPLATE/bug_template.md b/.github/ISSUE_TEMPLATE/bug_template.md new file mode 100644 index 00000000..8fae24db --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_template.md @@ -0,0 +1,33 @@ +--- +name: 🐛 Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Plugins** +Please list all plugins currently enabled. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Host/Environment (please complete the following information):** + - OS: [e.g. iOS] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..2791b808 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: 🎆 Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..05d3e6aa --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,6 @@ +*Issue #, if available:* + +*Description of changes:* + + + By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5b627cfa..997bae66 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,25 @@ -## Code of Conduct -This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). -For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact -opensource-codeofconduct@amazon.com with any additional questions or comments. + +This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project. + + +**Our open source communities endeavor to:** + +* Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language. +* Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute. +* Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated. +* Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work. + + +**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:** + +* The use of violent threats, abusive, discriminatory, or derogatory language; +* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation; +* Posting of sexually explicit or violent content; +* The use of sexualized language and unwelcome sexual attention or advances; +* Public or private harassment of any kind; +* Publishing private information, such as physical or electronic address, without permission; +* Other conduct which could reasonably be considered inappropriate in a professional setting; +* Advocating for or encouraging any of the above behaviors. +* Enforcement and Reporting Code of Conduct Issues: + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:opensource-codeofconduct@amazon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 914e0741..e1dfb00a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,6 +19,42 @@ reported the issue. Please try to include as much information as you can. Detail * Any modifications you've made relevant to the bug * Anything unusual about your environment or deployment +## Sign your work +The sign-off is a simple line at the end of each commit, which certifies that you wrote it or otherwise have the right to pass it on as an open-source patch. if you can certify the below +``` +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. +``` +then you just add a line to every git commit message: +``` +Signed-off-by: Bob Sanders +``` +You can sign off your work easily by adding the configuration in github +``` +git config user.name "Bob Sanders" +git config user.email "bob.sanders@email.com" +``` +Then, you could sign off commits automatically by adding `-s` or `-=signoff` parameter to your usual git commits commands. e.g. +``` +git commit -s -m "my first commit" +``` ## Contributing via Pull Requests Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: diff --git a/LICENSE b/LICENSE index 67db8588..261eeb9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,3 @@ - Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ @@ -173,3 +172,30 @@ defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..b65d172e --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,8 @@ +# Notifications Maintainers + +## Maintainers +| Maintainer | GitHub ID | Affiliation | +|------------------------|---------------------------------------------------|-------------| +| Anantha Krishna Bhatta | [akbhatta](https://github.com/akbhatta) | Amazon | +| Joshua Li | [joshuali925](https://github.com/joshuali925) | Amazon | +| Zhongnan Su | [zhongnansu](https://github.com/zhongnansu) | Amazon | diff --git a/NOTICE b/NOTICE index 616fc588..be83767d 100644 --- a/NOTICE +++ b/NOTICE @@ -1 +1,12 @@ -Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +OpenSearch +Copyright 2021 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/). From 05faaa1da4df035665d1619299382173db732f13 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Mon, 19 Apr 2021 13:59:56 -0700 Subject: [PATCH 2/4] Update pull request template Signed-off-by: Joshua Li --- .github/PULL_REQUEST_TEMPLATE.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 05d3e6aa..19d54289 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,16 @@ -*Issue #, if available:* +### Description +[Describe what this change achieves] -*Description of changes:* +### Issues Resolved +[List any issues this PR will resolve] +### Check List +- [ ] New functionality includes testing. + - [ ] All tests pass, including unit test, integration test and doctest +- [ ] New functionality has been documented. + - [ ] New functionality has javadoc added + - [ ] New functionality has user manual doc added +- [ ] 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. +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/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). From 70432297577eb88cf4a8eb6374a98f1d7139ef09 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Mon, 19 Apr 2021 15:19:53 -0700 Subject: [PATCH 3/4] Addrss comments Signed-off-by: Joshua Li --- NOTICE | 3 --- 1 file changed, 3 deletions(-) diff --git a/NOTICE b/NOTICE index be83767d..a9cf0fc8 100644 --- a/NOTICE +++ b/NOTICE @@ -7,6 +7,3 @@ 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/). From 9f35511626f921d8f62ccb4b21af84028fd2aa47 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Mon, 19 Apr 2021 15:20:10 -0700 Subject: [PATCH 4/4] Update readme from develop branch Signed-off-by: Joshua Li --- README.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index bb392c54..96322f9f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -# Notifications plugin for Open Distro +[![codecov](https://codecov.io/gh/opendistro-for-elasticsearch/notifications/branch/develop/graph/badge.svg?token=VV8JDA5DKY)](https://codecov.io/gh/opendistro-for-elasticsearch/notifications) + + +# Notifications plugin for OpenSearch ## Overview -Notifications plugin for Open Distro enables other plugins to send notifications via Email, Slack, Amazon Chime, Custom web-hook etc channels +Notifications plugin for OpenSearch enables other plugins to send notifications via Email, Slack, Amazon Chime, Custom web-hook etc channels ## Highlights @@ -20,6 +23,12 @@ Please see our [documentation](https://opendistro.github.io/for-elasticsearch-do 1. Launch Intellij IDEA, choose **Import Project**, and select the `settings.gradle` file in the root of this package. 1. To build from the command line, set `JAVA_HOME` to point to a JDK >= 14 before running `./gradlew`. +### Setup email notification using localhost email relay/server + +1. Run local email server on the machine where OpenSearch is running. e.g. for Mac, run command `sudo postfix start` +1. Verify that local email server does not require any authentication (Make sure server is listening on local port only) +1. Update the `notification.yml` configuration file according to your setup + ### Setup Amazon SES and SDK While using Amazon SES as email channel for sending mail, use below procedure for SES setup and configure environment. @@ -35,7 +44,7 @@ While using Amazon SES as email channel for sending mail, use below procedure fo This project uses following tools 1. [Gradle](https://docs.gradle.org/current/userguide/userguide.html) build system. Gradle comes with an excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. -1. Elastic build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. If you encounter such a situation, the Elastic build tools [source code](https://github.com/elastic/elasticsearch/tree/master/buildSrc/src/main/groovy/org/elasticsearch/gradle) is your best bet for figuring out what's going on. +1. OpenSearch build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. If you encounter such a situation, the OpenSearch build tools is your best bet for figuring out what's going on. ### Building from the command line @@ -54,18 +63,18 @@ When launching a cluster using above commands, logs are placed in `notifications 1. Setup a local ODFE cluster with security plugin. - `./gradlew build` -- `./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin` -- `./gradlew integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=es-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin --tests ""` +- `./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=opensearch-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin` +- `./gradlew integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=opensearch-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin --tests ""` ### Debugging -Sometimes it's useful to attach a debugger to either the Elasticsearch cluster, or the integ tests to see what's going on. When running unit tests, hit **Debug** from the IDE's gutter to debug the tests. +Sometimes it's useful to attach a debugger to either the OpenSearch cluster, or the integ tests to see what's going on. When running unit tests, hit **Debug** from the IDE's gutter to debug the tests. You must start your debugger to listen for remote JVM before running the below commands. To debug code running in an actual server, run: ``` -./gradlew integTest -Des.debug # to start a cluster and run integ tests +./gradlew integTest -Dopensearch.debug # to start a cluster and run integ tests ``` OR @@ -74,7 +83,7 @@ OR ./gradlew run --debug-jvm # to just start a cluster that can be debugged ``` -The Elasticsearch server JVM will launch suspended and wait for a debugger to attach to `localhost:5005` before starting the Elasticsearch server. +The OpenSearch server JVM will launch suspended and wait for a debugger to attach to `localhost:5005` before starting the OpenSearch server. The IDE needs to listen for the remote JVM. If using Intellij you must set your debug-configuration to "Listen to remote JVM" and make sure "Auto Restart" is checked. You must start your debugger to listen for remote JVM before running the commands. @@ -89,7 +98,7 @@ The test runner JVM will start suspended and wait for a debugger to attach to `l ### Advanced: Launching multi-node clusters locally -Sometimes you need to launch a cluster with more than one Elasticsearch server process. +Sometimes you need to launch a cluster with more than one OpenSearch server process. You can do this by running `./gradlew run -PnumNodes=`