From 7a1b0602b880e76a9993c36a00256b06d40f2100 Mon Sep 17 00:00:00 2001 From: crystall-bitquill <97126568+crystall-bitquill@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:04:17 -0700 Subject: [PATCH] chore: draft release workflow (#264) --- .github/workflows/aurora_performance.yml | 2 +- .github/workflows/integration_tests.yml | 2 +- .../workflows/integration_tests_latest.yml | 2 +- .github/workflows/main.yml | 2 +- .../workflows/multi_az_integration_tests.yml | 2 +- .github/workflows/release_draft.yml | 55 +++++++++++++++++++ CHANGELOG.md | 11 ++++ .../aws_secrets_manager_plugin_factory.ts | 2 +- .../aws_dev_postgresql_example.ts | 6 +- mysql/lib/client.ts | 2 +- 10 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/release_draft.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/aurora_performance.yml b/.github/workflows/aurora_performance.yml index 301cee34..4a170b81 100644 --- a/.github/workflows/aurora_performance.yml +++ b/.github/workflows/aurora_performance.yml @@ -24,7 +24,7 @@ jobs: distribution: "corretto" java-version: 8 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "20.x" - name: Install dependencies diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 3cb0f9d8..95440701 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -28,7 +28,7 @@ jobs: distribution: "corretto" java-version: 8 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "20.x" - name: Install dependencies diff --git a/.github/workflows/integration_tests_latest.yml b/.github/workflows/integration_tests_latest.yml index 2a234b78..4eb6213d 100644 --- a/.github/workflows/integration_tests_latest.yml +++ b/.github/workflows/integration_tests_latest.yml @@ -31,7 +31,7 @@ jobs: distribution: "corretto" java-version: 8 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "20.x" - name: Install dependencies diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ede10613..13345247 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "20.x" - name: Install dependencies diff --git a/.github/workflows/multi_az_integration_tests.yml b/.github/workflows/multi_az_integration_tests.yml index 10029099..6a1c4c31 100644 --- a/.github/workflows/multi_az_integration_tests.yml +++ b/.github/workflows/multi_az_integration_tests.yml @@ -32,7 +32,7 @@ jobs: distribution: "corretto" java-version: 8 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: "20.x" - name: Install dependencies diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml new file mode 100644 index 00000000..ccbda144 --- /dev/null +++ b/.github/workflows/release_draft.yml @@ -0,0 +1,55 @@ +name: "Release Draft" + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + +permissions: + actions: write + contents: write + deployments: write + packages: write + pull-requests: write + repository-projects: write + +jobs: + ubuntu-latest-nodejs-wrapper-release-gh-draft: + name: "Build And Release Draft" + runs-on: ubuntu-latest + steps: + - name: "Clone Repository" + uses: actions/checkout@v4 + with: + fetch-depth: 50 + - name: "Set up Node.js" + uses: actions/setup-node@v4 + with: + node-version: "20.x" + - name: "Install dependencies" + run: npm install --no-save + - name: "Run eslint - linting" + run: npm run lint + - name: "Check formatting" + run: npm run check + - name: "Run unit tests" + run: npm test + - name: "Package Wrapper" + run: mkdir ./build | npm pack --pack-destination ./build + - name: "Set Version Env Variable" + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: "Get Release Details" + run: | + export RELEASE_DETAILS="$(awk -vN=2 'n RELEASE_DETAILS.md + - name: "Upload to Draft Release" + uses: ncipollo/release-action@v1 + with: + draft: true + name: "AWS Advanced NodeJS Wrapper - v${{ env.RELEASE_VERSION }}" + bodyFile: RELEASE_DETAILS.md + artifacts: ./build/* + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..233049eb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200). + +## [1.0.0] + +The Amazon Web Services (AWS) Advanced NodeJS Wrapper allows an application to take advantage of the features of clustered Aurora databases. + +[0.0.1]: https://github.com/awslabs/aws-advanced-nodejs-wrapper/releases/tag/0.0.1 diff --git a/common/lib/authentication/aws_secrets_manager_plugin_factory.ts b/common/lib/authentication/aws_secrets_manager_plugin_factory.ts index 8acca31e..cd3d64d5 100644 --- a/common/lib/authentication/aws_secrets_manager_plugin_factory.ts +++ b/common/lib/authentication/aws_secrets_manager_plugin_factory.ts @@ -31,7 +31,7 @@ export class AwsSecretsManagerPluginFactory implements ConnectionPluginFactory { logger.error(error); throw new AwsWrapperError(Messages.get("ConnectionPluginChainBuilder.errorImportingPlugin", "AwsSecretsManagerPlugin")); } - throw error; + throw error; } } } diff --git a/examples/aws_driver_example/aws_dev_postgresql_example.ts b/examples/aws_driver_example/aws_dev_postgresql_example.ts index e887080a..9d06b1da 100644 --- a/examples/aws_driver_example/aws_dev_postgresql_example.ts +++ b/examples/aws_driver_example/aws_dev_postgresql_example.ts @@ -45,7 +45,7 @@ ErrorSimulatorManager.raiseErrorOnNextConnect(errorToRaise); try { await client.connect(); } catch { - // Handle errorToRaise. + // Handle errorToRaise. } // Another connection. Goes normal with no error. @@ -59,7 +59,7 @@ simulator.raiseErrorOnNextCall(errorToRaise, "query"); try { const result = await client.query("select 1"); } catch { - // Handle errorToRaise. + // Handle errorToRaise. } // Query executes normally without error. @@ -84,7 +84,7 @@ const mismatch = await client.query("select 2"); try { const match = await client.query("select 1"); } catch { - // Handle errorToRaise. + // Handle errorToRaise. } // Close connection. diff --git a/mysql/lib/client.ts b/mysql/lib/client.ts index 4dbb53da..701a57c9 100644 --- a/mysql/lib/client.ts +++ b/mysql/lib/client.ts @@ -216,7 +216,7 @@ export class AwsMySQLClient extends AwsClient { // This might happen if end is called in a finally block when an error occurred while initializing the first connection. return; } - + const hostInfo: HostInfo | null = this.pluginService.getCurrentHostInfo(); const result = await this.pluginManager.execute( this.pluginService.getCurrentHostInfo(),