From 1611daa367096410de1969d40c543e625bcc451c Mon Sep 17 00:00:00 2001 From: "Michael Maeng (AWS)" <83842446+mmaeng@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:02:30 -0700 Subject: [PATCH 1/4] chore(CI): fix integretion tests on macos and ubuntu (#116) * update brew tap command for docker * update success log search * update python and node --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 282b560..97d04c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,14 +10,14 @@ jobs: steps: - uses: actions/setup-python@v4 with: - python-version: 3.7 + python-version: 3.9 os_build: runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest, macos-latest ] - python: [ 3.7, 3.8, 3.9 ] - node: [ 14 ] + python: [ 3.8, 3.9 ] + node: [ 18 ] env: SAM_CLI_TELEMETRY: "0" AWS_REGION: "us-east-1" @@ -32,8 +32,8 @@ jobs: - name: Update Homebrew and save docker version if: runner.os == 'macOS' run: | - brew update --preinstall - cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/docker.rb" > .github/brew-formulae + brew tap homebrew/core + cat "$(brew --repository)/Library/Taps/homebrew/homebrew-core/Formula/d/docker.rb" > .github/brew-formulae - name: Configure Homebrew docker cache files uses: actions/cache@v3 if: runner.os == 'macOS' @@ -121,7 +121,7 @@ jobs: sam build --debug --build-dir ./build TypeFunction sam build --debug --build-dir ./build TestEntrypoint sam local invoke -t ./build/template.yaml --debug --event ./sam-tests/create.json --log-file ./sam.log TestEntrypoint - grep -q '"status":"SUCCESS"' sam.log + grep -q '"SUCCESS"' sam.log - name: Gather Debug Logs id: gather_logs continue-on-error: true From 578459f0667e1c5623bf480f3c8882221727f74d Mon Sep 17 00:00:00 2001 From: Divya Raj Date: Thu, 26 Oct 2023 09:54:03 -0700 Subject: [PATCH 2/4] Stop logging event data (#117) * Stop logging event data --------- Co-authored-by: Divya Raj --- src/resource.ts | 1 - tests/lib/resource.test.ts | 15 +-------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/resource.ts b/src/resource.ts index 7f81b7b..7992ccb 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -586,7 +586,6 @@ export abstract class BaseResource< this.prepareCredentialsFilter(this.callerSession) ); } - this.log('EVENT DATA\n', eventData); progress = await this.invokeHandler( this.callerSession, request, diff --git a/tests/lib/resource.test.ts b/tests/lib/resource.test.ts index a41d6e8..3c28ad1 100644 --- a/tests/lib/resource.test.ts +++ b/tests/lib/resource.test.ts @@ -249,7 +249,7 @@ describe('when getting resource', () => { }); test('entrypoint redacting credentials', async () => { - expect.assertions(13); + expect.assertions(5); const spyPublishLogEvent = jest.spyOn( LogPublisher.prototype, 'publishLogEvent' @@ -283,19 +283,6 @@ describe('when getting resource', () => { expect(spyPrepareLogStream).toBeCalledTimes(1); expect(spyPublishLogEvent).toHaveBeenCalled(); expect(mockPublishMessage).toHaveBeenCalled(); - mockPublishMessage.mock.calls.forEach((value: any[]) => { - const message = value[0] as string; - if (message && message.startsWith('EVENT DATA')) { - expect(message).toMatch(/bearerToken: ''/); - expect(message).toMatch( - /providerCredentials: {\s+accessKeyId: '',\s+secretAccessKey: '',\s+sessionToken: ''\s+}/ - ); - expect(message).toMatch( - /callerCredentials: {\s+accessKeyId: '',\s+secretAccessKey: '',\s+sessionToken: ''\s+}/ - ); - expect(message).toMatch(/stack\/sample-stack\//); - } - }); }); test('entrypoint with callback context', async () => { From c71dde5c2bc0794b60a2a234c821f8015822cdd9 Mon Sep 17 00:00:00 2001 From: Divya Raj Date: Thu, 26 Oct 2023 14:00:50 -0700 Subject: [PATCH 3/4] Bump version to 1.0.5 (#118) * Bump version to 1.0.5 --------- Co-authored-by: Divya Raj --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e02731a..205f8a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@amazon-web-services-cloudformation/cloudformation-cli-typescript-lib", - "version": "1.0.4", + "version": "1.0.5", "description": "The CloudFormation Resource Provider Development Kit (RPDK) allows you to author your own resource providers that can be used by CloudFormation. This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation.", "private": false, "main": "dist/index.js", From 98fd8522d1f8a91bd51d7e64fb701a747fd51d6f Mon Sep 17 00:00:00 2001 From: Divya Raj Date: Thu, 26 Oct 2023 14:48:51 -0700 Subject: [PATCH 4/4] Tooling version bump to 1.0.3 (#119) * Tooling version bump to 1.0.3 --------- Co-authored-by: Divya Raj --- python/rpdk/typescript/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/rpdk/typescript/__init__.py b/python/rpdk/typescript/__init__.py index 909b71e..c136502 100644 --- a/python/rpdk/typescript/__init__.py +++ b/python/rpdk/typescript/__init__.py @@ -1,5 +1,5 @@ import logging -__version__ = "1.0.2" +__version__ = "1.0.3" logging.getLogger(__name__).addHandler(logging.NullHandler())