From 3f0b50c1513ba494453bbbb9993a17daaea48e7c Mon Sep 17 00:00:00 2001 From: Miki Date: Wed, 12 Jul 2023 12:04:58 -0700 Subject: [PATCH] Sync with `main` * Manually sync CHANGELOG.md, release-drafter.yml, RELEASING.md, and USER_GUIDE.md * Version Bump: 2.3.0 (#546) * Upgrade and secure the backport workflow (#547) * Add serialization and deserialization of numerals larger than `Number.MAX_SAFE_INTEGER` (#544) * Add upgrading NPM to all workflows running older Node.js versions (#545) * Bump @types/node from 20.1.4 to 20.2.5 (#528) * Bump @aws-sdk/types from 3.329.0 to 3.341.0 (#527) * Bump ora from 6.3.0 to 6.3.1 (#524) * Bump node-fetch from 3.2.10 to 3.3.1 (#526) * Bump eslint from 8.39.0 to 8.41.0 (#525) * Bump @types/node from 18.16.0 to 20.1.4 (#518) * Bump xmlbuilder2 from 3.1.0 to 3.1.1 (#519) * Bump semver from 7.3.8 to 7.5.1 (#520) * Added timursaurus to MAINTAINERS.md (#517) * Bump @aws-sdk/types from 3.257.0 to 3.329.0 (#516) * Bump @babel/eslint-parser from 7.21.3 to 7.21.8 (#513) * Bump simple-git from 3.17.0 to 3.18.0 (#512) * Bump xmlbuilder2 from 3.0.2 to 3.1.0 (#503) * Bump eslint from 8.38.0 to 8.39.0 (#504) * Bump @types/node from 18.15.11 to 18.16.0 (#499) * Bump ora from 6.1.2 to 6.3.0 (#500) * Bump prettier from 2.8.7 to 2.8.8 (#501) * Implemented Docker Image caching for `integration-unreleased` workflow (#498) * [Bug] Fixed bundler.yml (#497) * Bumped Version 2.2.1 In preparation for release (#495) * Bump @types/node from 18.15.10 to 18.15.11 (#493) * Bump eslint from 8.33.0 to 8.38.0 (#494) * Bump rimraf from 4.4.0 to 5.0.0 (#492) * [CCI] feat: add missing createConnection type (#490) * Add Search guide (#489) * Create search guide (#488) * [CCI] Create advanced index actions guide (#483) * [CCI] Connection `request` method callback (#478) * feat: NotCompatibleError (#484) * Bump @babel/eslint-parser from 7.19.1 to 7.21.3 (#486) * Bump jsdoc from 4.0.0 to 4.0.2 (#485) * Bump prettier from 2.8.4 to 2.8.7 (#487) * Create document lifecycle guide (#481) * Create index lifecycle guide (#482) * Create bulk guide (#480) * [CCI] Create index_template guide (#479) * Bump split2 from 4.1.0 to 4.2.0 (#467) * Bump deepmerge from 4.3.0 to 4.3.1 (#468) * Bump @types/node from 18.15.3 to 18.15.10 (#462) * Bump eslint-config-prettier from 8.6.0 to 8.8.0 (#463) * [CCI] Update developerGuide regarding yarn troubleshoot steps (#456) * [CCI] Bump caniuse-lite from 1.0.30001249 to 1.0.30001469 (#459) * added the solution for the possible error during yarn installation on Windows OS (#453) * Fixed deprecation warnings (#446) * [CCI] Don't run tests on PRs with doc changes only (#441) * [CCI] Add pull request template (#440) * Bump @types/node from 17.0.45 to 18.15.3 (#448) * Bump simple-git from 3.16.0 to 3.17.0 (#447) * [CCI] Update Developer Guide (#436) * [CCI] Remove waitCluster in Integration Tests (#423) * Bump tsd from 0.25.0 to 0.27.0 (#431) * Bump rimraf from 4.1.1 to 4.4.0 (#432) * [CCI] doc: fix grammar (#427) * Fix deprecated folder mapping "./" in the "exports" field (#416) * [CCI] fix: pass required `data` argument to SerializationError class (#419) * Bump tap from 16.3.0 to 16.3.4 (#413) * [CCI] Refactor: Remove unnecessary `data` argument when invoking `OpenSearchClientError` (#421) * Bump deepmerge from 4.2.2 to 4.3.0 (#414) * Updated Maintainers list and changelogs (#409) * Downgraded @types/node to 17 from 18 due to breaking changes. (#405) * Bump aws4 from 1.11.0 to 1.12.0 (#406) * Bump prettier from 2.8.3 to 2.8.4 (#407) * Bump minimist from 1.2.7 to 1.2.8 (#388) * Bump tsd from 0.24.1 to 0.25.0 (#389) * Add missing types for AwsSigv4SignerOptions.service (#377) * Created untriaged issue workflow. (#386) Daniel (dB.) Doubrovkine* 2/14/23, 12:14 PM * Bump dezalgo from 1.0.3 to 1.0.4 (#383) * Bump simple-statistics from 7.7.0 to 7.8.3 (#384) * Bump eslint from 8.32.0 to 8.33.0 (#379) * Allow fields in BulkOperation to be optional (#378) * Bump @types/node from 18.11.18 to 18.11.19 (#380) * Bump ora from 5.4.1 to 6.1.2 (#376) * Bump @aws-sdk/types from 3.226.0 to 3.257.0 (#375) * Bump secure-json-parse from 2.4.0 to 2.7.0 (#369) * Bump simple-git from 3.15.1 to 3.16.0 (#373) * Updated user guide to include Amazon OpenSearch Serverless (#372) * Added Support for AOSS (#366) * Bump rimraf from 3.0.2 to 4.1.1 (#370) * Bump eslint-config-prettier from 8.5.0 to 8.6.0 (#368) * Bump hpagent from 0.1.2 to 1.2.0 (#361) * Bump eslint from 8.30.0 to 8.32.0 (#362) * Fixed missing namespace for API-PIT endpoints (#364) * Bump prettier from 2.7.1 to 2.8.3 (#363) * Ensure Dependabot PR workflow retriggers on label change (#360) * Added point in time APIs (#348) * Bump @types/node from 15.14.7 to 18.11.18 (#353) * Bump split2 from 3.2.2 to 4.1.0 (#354) * Bump json5 from 2.2.0 to 2.2.3 (#359) * Bump @aws-sdk/types from 3.190.0 to 3.226.0 (#355) * Updated MAINTAINERS.md to match recommended opensearch-project format. (#358) Daniel (dB.) Doubrovkine* 1/6/23, 8:36 AM * Bump minimist from 1.2.6 to 1.2.7 (#350) * Bump eslint from 7.32.0 to 8.30.0 (#346) * Bump eslint-plugin-prettier from 4.0.0 to 4.2.1 (#351) * Removed test artifacts from gh_pages workflow (#347) * Bump minimatch from 3.0.4 to 3.1.2 (#345) * Bump xmlbuilder2 from 2.4.1 to 3.0.2 (#321) * Implement JSDOC (#337) * Added skip-changelog label (#339) * Bumps simple-git from 3.4.0 to 3.15.0 (#341) * [FEATURE] Allow overriding the aws service identifier in AwsSigv4Signer (#333) * Add release details and bump the jenkins lib version (#319) * Bump Version from 2.1.0 to 2.1.1 (#318) * Bump semver from 7.3.7 to 7.3.8 (#313) * Add release workflows (#317) * issue #291 mutability of headers (#311) * Bump tsd from 0.22.0 to 0.24.1 (#312) * Add changelog and changelog verifier (#306) * Bump prettier from 2.6.2 to 2.7.1 (#310) * Bump @aws-sdk/types from 3.160.0 to 3.190.0 (#309) * Bump node-fetch from 2.6.7 to 3.2.10 (#281) * Update Maintainers List (#308) * Implemented Retry for OpenSearch Container (#304) * Feature/add default credentials provider (#295) * Fix new line problem between diffs (#302) * Removed Unused Variables (#301) * fix awssigv4signer.test.js tests not running (#294) * fix: support TS resolution for .mjs (#296) * Add AwsSigV4 signing functionality (#279) * Fix #253 Cannot read property 'then' of null in Transport.js issue. (#283) * Bump simple-git from 3.5.0 to 3.13.0 (#286) * Bump semver from 7.3.5 to 7.3.7 (#280) * Adds bulk example to README (#277) * Adding Dependabot configuration (#278) * Removing OpenDistro integration tests (#271) * Upgrade dependencies (#272) * fix: add missing memory circuit breaker options (#266) * feat: allow `doc` overwrite in `onDocument` (#263) * Adding link checker workflow (#262) * Using standardized templates from .github (#249) * Adding new OpenSearch versions and updating compatibility matrix (#257) Signed-off-by: Miki --- .github/workflows/release-drafter.yml | 14 +++++++++++++- CHANGELOG.md | 2 ++ RELEASING.md | 3 ++- USER_GUIDE.md | 19 +++++++++++++++++-- 4 files changed, 34 insertions(+), 4 deletions(-) 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 +}); +```