From d9ea6dd21a7808aecbe989f1a01905eafe899625 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 29 Apr 2022 12:19:46 -0700 Subject: [PATCH] Adding CODEOWNERS, backport and documentation (#226) (#227) * Adding CODEOWNERS Signed-off-by: Vacha Shah * Updating backport workflow and adding auto delete backport branch workflow Signed-off-by: Vacha Shah * Documentation Signed-off-by: Vacha Shah (cherry picked from commit ab2b354173e4ca34b08873832b3a6909c84a7171) Co-authored-by: Vacha Shah --- .github/CODEOWNERS | 2 ++ .github/workflows/backport.yml | 18 ++++++++++++--- .github/workflows/delete_backport_branch.yml | 15 +++++++++++++ ADMINS.md | 6 +++++ DEVELOPER_GUIDE.md | 9 ++++++++ MAINTAINERS.md | 23 ++++++++++++-------- README.md | 8 ++++--- 7 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/workflows/delete_backport_branch.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..7df943260 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# This should match the team set up in https://github.com/orgs/opensearch-project/teams and include any additional contributors +* @opensearch-project/clients \ No newline at end of file diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index c0d07fef8..e47d8d88c 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,6 +1,6 @@ name: Backport on: - pull_request: + pull_request_target: types: - closed - labeled @@ -8,9 +8,21 @@ on: 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: tibdex/backport@v1 + uses: VachaShah/backport@v1.1.4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ steps.github_app_token.outputs.token }} + branch_name: backport/backport-${{ github.event.number }} diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml new file mode 100644 index 000000000..d654df6b4 --- /dev/null +++ b/.github/workflows/delete_backport_branch.yml @@ -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 }} \ No newline at end of file diff --git a/ADMINS.md b/ADMINS.md index 780d18c1f..c94582649 100644 --- a/ADMINS.md +++ b/ADMINS.md @@ -1,3 +1,9 @@ +- [Overview](#overview) +- [Current Admins](#current-admins) +- [Admin Responsibilities](#admin-responsibilities) + - [Prioritize Security](#prioritize-security) + - [Enforce Code of Conduct](#enforce-code-of-conduct) + - [Adopt Organizational Best Practices](#adopt-organizational-best-practices) ## Overview This document explains who the admins are (see below), what they do in this repo, and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md). diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index fbdeaabf9..0a523a6f3 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -1,3 +1,12 @@ +- [Developer Guide](#developer-guide) + - [Getting Started](#getting-started) + - [Git Clone OpenSearch Node.js Client Repository](#git-clone-opensearch-nodejs-client-repository) + - [Install Prerequisites](#install-prerequisites) + - [Node.js](#nodejs) + - [Docker](#docker) + - [Unit Testing](#unit-testing) + - [Integration Testing](#integration-testing) + - [Execute integration tests from your terminal](#execute-integration-tests-from-your-terminal) # Developer Guide So you want to contribute code to the OpenSearch Node.js Client? Excellent! We're glad you're here. Here's what you need to do: diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 337419dfe..467d53e8e 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -1,15 +1,16 @@ - [Overview](#overview) - [Current Maintainers](#current-maintainers) - [Maintainer Responsibilities](#maintainer-responsibilities) - - [Uphold Code of Conduct](#uphold-code-of-conduct) - - [Prioritize Security](#prioritize-security) - - [Review Pull Requests](#review-pull-requests) - - [Triage Open Issues](#triage-open-issues) - - [Be Responsive](#be-responsive) - - [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo) - - [Use Semver](#use-semver) - - [Release Frequently](#release-frequently) - - [Promote Other Maintainers](#promote-other-maintainers) + - [Uphold Code of Conduct](#uphold-code-of-conduct) + - [Prioritize Security](#prioritize-security) + - [Review Pull Requests](#review-pull-requests) + - [Triage Open Issues](#triage-open-issues) + - [Backports](#backports) + - [Be Responsive](#be-responsive) + - [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo) + - [Use Semver](#use-semver) + - [Release Frequently](#release-frequently) + - [Promote Other Maintainers](#promote-other-maintainers) ## Overview @@ -52,6 +53,10 @@ All repositories in this organization have a standard set of labels, including ` Use labels to target an issue or a PR for a given release, add `help wanted` to good issues for new community members, and `blocker` for issues that scare you or need immediate attention. Request for more information from a submitter if an issue is not clear. Create new labels as needed by the project. +### Backports + +The Github workflow in [backport.yml](.github/workflows/backport.yml) creates backport PRs automatically when the original PR with an appropriate label `backport ` is merged to main. To backport a PR to `1.x`, add a label `backport 1.x` to the PR, once this PR is merged to main, the workflow will create a backport PR to the `1.x` branch. + ### Be Responsive Respond to enhancement requests, and forum posts. Allocate time to reviewing and commenting on issues and conversations as they come in. diff --git a/README.md b/README.md index d414f4c1f..503426063 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,26 @@ OpenSearch Node.js client - [Welcome!](#welcome) +- [Example use](#example-use) + - [Setup](#setup) + - [Sample code](#sample-code) - [Project Resources](#project-resources) - [Code of Conduct](#code-of-conduct) - [License](#license) - [Copyright](#copyright) - ## Welcome! **[opensearch-js](https://www.npmjs.com/package/@opensearch-project/opensearch)** is [a community-driven, open source fork](https://aws.amazon.com/blogs/opensource/introducing-opensearch/) of elasticsearch-js licensed under the [Apache v2.0 License](LICENSE.txt). For more information, see [opensearch.org](https://opensearch.org/). ## Example use + The OpenSearch JavaScript client provides a safer and easier way to interact with your OpenSearch cluster. Rather than using OpenSearch from the browser and potentially exposing your data to the public, you can build an OpenSearch client that takes care of sending requests to your cluster. The client contains a library of APIs that let you perform different operations on your cluster and return a standard response body. The example here demonstrates some basic operations like creating an index, adding documents, and searching your data. - ### Setup -# To add the client to your project, install it with npm: +To add the client to your project, install it with npm: ```bash npm i @opensearch-project/opensearch