diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 03cccbf28..87503acb6 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -10,7 +10,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - id: get_data + run: | + echo "approvers=$(cat .github/CODEOWNERS | grep @ | tr -d '* ' | sed 's/@/,/g' | sed 's/,//1')" >> $GITHUB_OUTPUT + echo "version=$(cat package.json | jq .version | tr -d "\"")" >> $GITHUB_OUTPUT + - uses: trstringer/manual-approval@v1 + with: + secret: ${{ github.TOKEN }} + approvers: ${{ steps.get_data.outputs.approvers }} + minimum-approvals: 2 + issue-title: 'Release opensearch-js : ${{ steps.get_data.outputs.version }}' + issue-body: "Please approve or deny the release of opensearch-js. **VERSION**: ${{ steps.get_data.outputs.version }} **TAG**: ${{ github.ref_name }} **COMMIT**: ${{ github.sha }}" + exclude-workflow-initiator-as-approver: true - name: Release uses: softprops/action-gh-release@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eec6c613..d6296760d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,6 +77,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove guidance on using npm and switch completely to yarn in developer_guide ([#439](https://github.com/opensearch-project/opensearch-js/issues/435)) - Change coverage, compatability, integration, integration with unreleased Open Search, node ci, bundler tests not to run on documentation change ([441](https://github.com/opensearch-project/opensearch-js/pull/441)) - Change the Windows yarn installation troubleshoot steps ([455](https://github.com/opensearch-project/opensearch-js/issues/455)) +- Make `callback` arg in `BaseConnectionPool`, `CloudConnectionPool` and `ConnectionPool` optional ([#451](https://github.com/opensearch-project/opensearch-js/pull/451)) + ### Deprecated - Remove deprecation warnings in bulk.test.js ([#434](https://github.com/opensearch-project/opensearch-js/issues/434)) diff --git a/RELEASING.md b/RELEASING.md index 67f56906d..020b556d5 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -34,7 +34,8 @@ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v The release process is standard across repositories in this org and is run by a release manager volunteering from amongst [maintainers](MAINTAINERS.md). 1. Create a tag, e.g. v2.1.0, and push it to the GitHub repo. -1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and a draft release will be created. +1. The [release-drafter.yml](.github/workflows/release-drafter.yml) will be automatically kicked off and is responsible for drafting a new release on GitHub. +1. Before creating a draft release, this workflow creates a GitHub issue asking for approval from the [maintainers](MAINTAINERS.md). See sample [issue](https://github.com/gaiksaya/opensearch-js/issues/1). The maintainers need to approve in order to continue the workflow run. 1. This draft release triggers the [jenkins release workflow](https://build.ci.opensearch.org/job/opensearch-js-release/) as a result of which opensearch-js client is released on [npmjs](https://www.npmjs.com/package/@opensearch-project/opensearch). 1. Once the above release workflow is successful, the drafted release on GitHub is published automatically. 1. Increment "version" in package.json to the next patch release, e.g. v2.1.1. See [example](https://github.com/opensearch-project/opensearch-js/pull/318) diff --git a/USER_GUIDE.md b/USER_GUIDE.md index 579c170e3..d917f93f6 100644 --- a/USER_GUIDE.md +++ b/USER_GUIDE.md @@ -10,6 +10,7 @@ - [Search for the Document](#search-for-the-document) - [Delete the document](#delete-the-document) - [Delete the index](#delete-the-index) + - [Empty all Pool Connections](#empty-all-pool-connections) ## Initializing a Client @@ -87,7 +88,7 @@ const { AwsSigv4Signer } = require('@opensearch-project/opensearch/aws'); const client = new Client({ ...AwsSigv4Signer({ region: 'us-east-1', - service: 'es', // 'aoss' for OpenSearch Serverless + service: 'es', // 'aoss' for OpenSearch Serverless // Must return a Promise that resolve to an AWS.Credentials object. // This function is used to acquire the credentials when the client start and // when the credentials are expired. @@ -249,4 +250,18 @@ console.log('Deleting all PITs:'); var response = await client.deleteAllPits(); console.log(response.body); -``` \ No newline at end of file +``` + +## Empty all Pool Connections + +```javascript +var pool = new ConnectionPool({ Connection }); +pool.addConnection('http://localhost:9200/'); +pool.addConnection('http://localhost:9201/'); + +pool.empty(); +// OR +pool.empty(() => { + // Do something after emptying the pool +}); +```