From 9f209bef86a2e01ce794e42505c64fc2f0be1e10 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Mon, 3 Apr 2023 14:18:17 -0700 Subject: [PATCH 001/172] Revert "chore(master): release java-function-invoker 1.2.2-SNAPSHOT (#180)" (#184) This reverts commit 89b57bf5a1c7006d9bfd323e93180d255ed77fd4. --- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index dc1e3172..c12bf37e 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.2.2-SNAPSHOT + 1.2.1 com.google.cloud.functions.invoker conformance - 1.2.2-SNAPSHOT + 1.2.1 GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 08ade5e3..6420cf93 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.2-SNAPSHOT + 1.2.1 com.google.cloud.functions.invoker java-function-invoker - 1.2.2-SNAPSHOT + 1.2.1 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -114,7 +114,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.2.2-SNAPSHOT + 1.2.1 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index b1017747..49815646 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -10,7 +10,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.2-SNAPSHOT + 1.2.1 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 61730b65..ce9bdb5d 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.2-SNAPSHOT + 1.2.1 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.2.2-SNAPSHOT + 1.2.1 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From 8db1e85ce7defb9eab32cfa3e23499cdb5d6858f Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Mon, 3 Apr 2023 15:22:15 -0700 Subject: [PATCH 002/172] Revert "Revert "chore(master): release java-function-invoker 1.2.2-SNAPSHOT (#180)" (#184)" (#185) This reverts commit 9f209bef86a2e01ce794e42505c64fc2f0be1e10. --- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index c12bf37e..dc1e3172 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.2.1 + 1.2.2-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.2.1 + 1.2.2-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 6420cf93..08ade5e3 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.1 + 1.2.2-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.2.1 + 1.2.2-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -114,7 +114,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.2.1 + 1.2.2-SNAPSHOT test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 49815646..b1017747 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -10,7 +10,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.1 + 1.2.2-SNAPSHOT pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index ce9bdb5d..61730b65 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.1 + 1.2.2-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.2.1 + 1.2.2-SNAPSHOT Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From e4820d96d3fd747767b0df3db592e84f0d114d1a Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Thu, 6 Apr 2023 11:59:30 -0700 Subject: [PATCH 003/172] chore: address some scorecard findings on github actions (#183) --- .github/workflows/buildpack-integration-test.yml | 4 ++++ .github/workflows/conformance.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index 6d290f64..35e9b6c7 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -5,6 +5,10 @@ on: branches: - master workflow_dispatch: + +# Declare default permissions as read only. +permissions: read-all + jobs: java11-buildpack-test: uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 5fdeae65..14b5e066 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -4,6 +4,10 @@ on: branches: - master pull_request: + +# Declare default permissions as read only. +permissions: read-all + jobs: build: runs-on: ubuntu-latest From de61196b6211dab6bec023e553f7015c7afe2790 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Thu, 13 Apr 2023 11:08:10 -0700 Subject: [PATCH 004/172] chore: Configure blunderbuss.yml (#188) --- .github/blunderbuss.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/blunderbuss.yml diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml new file mode 100644 index 00000000..61347444 --- /dev/null +++ b/.github/blunderbuss.yml @@ -0,0 +1,5 @@ +assign_prs: + - GoogleCloudPlatform/functions-framework-google + +assign_issues: + - GoogleCloudPlatform/functions-framework-google From fdbdfcecaf263ec0b3d8b88553ef764a5762f2e9 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Thu, 13 Apr 2023 11:16:24 -0700 Subject: [PATCH 005/172] chore: Create renovate bot config (#187) * chore: Create renovate bot config * Update renovate.json --- .github/renovate.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/renovate.json diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..7287767f --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["group:allNonMajor", "schedule:monthly"], + "packageRules": [ + { + "description": "Create a PR whenever there is a new major version", + "matchUpdateTypes": [ + "major" + ] + } + ] +} From 3e3129eeae86c5fddd5253e9bcf14e5e561bca79 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Tue, 2 May 2023 11:10:27 -0700 Subject: [PATCH 006/172] chore: Update blunderbuss.yml according to preference (#189) --- .github/blunderbuss.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 61347444..4234009b 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,5 +1,9 @@ assign_prs: - - GoogleCloudPlatform/functions-framework-google + - janell-chen + - HKWinterhalter + - garethgeorge assign_issues: - - GoogleCloudPlatform/functions-framework-google + - janell-chen + - HKWinterhalter + - garethgeorge From a3712448c09e59e7cf71de9f19aad8f21bb511a0 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Tue, 2 May 2023 13:45:33 -0700 Subject: [PATCH 007/172] chore: fix ci lint errors (#195) --- .../com/google/cloud/functions/plugin/DeployFunction.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/DeployFunction.java b/function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/DeployFunction.java index f36fa984..35dab3f8 100644 --- a/function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/DeployFunction.java +++ b/function-maven-plugin/src/main/java/com/google/cloud/functions/plugin/DeployFunction.java @@ -182,36 +182,42 @@ public class DeployFunction extends CloudSdkMojo { */ @Parameter(alias = "deploy.vpcconnector", property = "function.deploy.vpcconnector") String vpcConnector; + /** * Sets the maximum number of instances for the function. A function execution that would exceed * max-instances times out. */ @Parameter(alias = "deploy.maxinstances", property = "function.deploy.maxinstances") Integer maxInstances; + /** * List of key-value pairs to set as environment variables. All existing environment variables * will be removed first. */ @Parameter(alias = "deploy.setenvvars", property = "function.deploy.setenvvars") Map environmentVariables; + /** * Path to a local YAML file with definitions for all environment variables. All existing * environment variables will be removed before the new environment variables are added. */ @Parameter(alias = "deploy.envvarsfile", property = "function.deploy.envvarsfile") String envVarsFile; + /** * List of key-value pairs to set as build environment variables. All existing environment * variables will be removed first. */ @Parameter(alias = "deploy.setbuildenvvars", property = "function.deploy.setbuildenvvars") Map buildEnvironmentVariables; + /** * Path to a local YAML file with definitions for all build environment variables. All existing * environment variables will be removed before the new environment variables are added. */ @Parameter(alias = "deploy.buildenvvarsfile", property = "function.deploy.buildenvvarsfile") String buildEnvVarsFile; + /** If true, deploys the function in the 2nd Generation Environment. */ @Parameter(alias = "deploy.gen2", property = "function.deploy.gen2", defaultValue = "false") boolean gen2; From aadefa5fc09aa94da937f11f8f5cbfcd708c95bd Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 May 2023 21:22:50 +0200 Subject: [PATCH 008/172] chore(deps): update actions/checkout action to v3 (#192) --- .github/workflows/conformance.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/unit.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 14b5e066..0ee3236e 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -24,7 +24,7 @@ jobs: with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 78ef3450..d559d9f7 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,7 +17,7 @@ jobs: with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3 with: diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index b510fef7..405a9b57 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -22,7 +22,7 @@ jobs: with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0 + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf # v2.5.0 with: From f3220ce5304add7d198c2a60cf76ae64e9fb0791 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 15 May 2023 22:16:31 +0200 Subject: [PATCH 009/172] chore(deps): update actions/setup-go action to v4 (#193) --- .github/workflows/conformance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 0ee3236e..20a14c9d 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -32,7 +32,7 @@ jobs: java-version: ${{ matrix.java }} - name: Setup Go - uses: actions/setup-go@bfdd3570ce990073878bf10f6b2d79082de49492 # v2.2.0 + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 with: go-version: '1.16' From 94ed3bfcdcb57d4452aa2e3307acee1e4a48c28f Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 16 May 2023 12:06:03 -0700 Subject: [PATCH 010/172] chore(deps): update actions/setup-java to v3 (#196) --- .github/workflows/conformance.yaml | 3 ++- .github/workflows/lint.yaml | 3 ++- .github/workflows/unit.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 20a14c9d..8cda2e27 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -27,9 +27,10 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: ${{ matrix.java }} + distribution: temurin - name: Setup Go uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d559d9f7..291ab619 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -19,9 +19,10 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK - uses: actions/setup-java@d202f5dbf7256730fb690ec59f6381650114feb2 # v1.4.3 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: 11.x + distribution: temurin - name: Build API with Maven run: (cd functions-framework-api/ && mvn install) - name: Lint Functions Framework API diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 405a9b57..22668053 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@f0bb91606209742fe3ea40199be2f3ef195ecabf # v2.5.0 + uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: java-version: ${{ matrix.java }} distribution: temurin From d6396d10388217993278d35a3c902856dfd89e9c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 17 May 2023 19:17:56 +0200 Subject: [PATCH 011/172] chore(deps): update all non-major dependencies (#191) --- .github/workflows/codeql.yml | 10 +++++----- .github/workflows/conformance.yaml | 10 +++++----- .github/workflows/lint.yaml | 6 +++--- .github/workflows/scorecard.yml | 8 ++++---- .github/workflows/unit.yaml | 2 +- function-maven-plugin/pom.xml | 20 ++++++++++---------- functions-framework-api/pom.xml | 8 ++++---- invoker/conformance/pom.xml | 6 +++--- invoker/core/pom.xml | 28 ++++++++++++++-------------- invoker/pom.xml | 4 ++-- invoker/testfunction/pom.xml | 6 +++--- 11 files changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f41dd57a..45f6540c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,16 +28,16 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: Checkout repository - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + uses: github/codeql-action/init@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -51,12 +51,12 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - name: Autobuild - uses: github/codeql-action/autobuild@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 with: working-directory: ${{ matrix.working-directory }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 + uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 8cda2e27..77bf6860 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -20,7 +20,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs @@ -44,7 +44,7 @@ jobs: run: (cd invoker/ && mvn install) - name: Run HTTP conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@c52662e612b2685a027b1c3e02224306517722fc # v1.6.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0 with: version: 'v1.6.0' functionType: 'http' @@ -53,7 +53,7 @@ jobs: startDelay: 10 - name: Run background event conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@c52662e612b2685a027b1c3e02224306517722fc # v1.6.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0 with: version: 'v1.6.0' functionType: 'legacyevent' @@ -63,7 +63,7 @@ jobs: startDelay: 10 - name: Run cloudevent conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@c52662e612b2685a027b1c3e02224306517722fc # v1.6.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0 with: version: 'v1.6.0' functionType: 'cloudevent' @@ -73,7 +73,7 @@ jobs: startDelay: 10 - name: Run HTTP concurrency conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@c52662e612b2685a027b1c3e02224306517722fc # v1.6.0 + uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0 with: version: 'v1.6.0' functionType: 'http' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 291ab619..8ece5d60 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs @@ -35,11 +35,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 # v2 minimum required + - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 49d3d2ba..f87e3f7f 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -25,17 +25,17 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: "Checkout code" - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d # v2.0.6 + uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 with: results_file: results.sarif results_format: sarif @@ -47,6 +47,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@807578363a7869ca324a79039e6db9c843e0e100 # v2.1.27 + uses: github/codeql-action/upload-sarif@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 22668053..6f4dc3d0 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@18bf8ad2ca49c14cbb28b91346d626ccfb00c518 # v2.1.0 + uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index c1f217c3..ca3a98a5 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -29,43 +29,43 @@ org.apache.maven maven-plugin-api - 3.6.3 + 3.9.2 org.apache.maven maven-core - 3.6.3 + 3.9.2 org.apache.maven.plugin-tools maven-plugin-annotations - 3.6.0 + 3.9.0 provided com.google.cloud.functions.invoker java-function-invoker - 1.1.1 + 1.2.1 com.google.cloud.tools appengine-maven-plugin - 2.4.1 + 2.4.4 jar com.google.truth truth - 1.0.1 + 1.1.3 test junit junit - 4.13.1 + 4.13.2 test @@ -75,7 +75,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.6.0 + 3.9.0 help-goal @@ -120,7 +120,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.5.0 attach-javadocs @@ -133,7 +133,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index f8375b76..ebc27ba4 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -30,8 +30,8 @@ UTF-8 - 3.8.0 - 3.1.0 + 3.11.0 + 3.5.0 5.3.2 @@ -54,7 +54,7 @@ io.cloudevents cloudevents-api - 2.0.0.RC2 + 2.5.0 @@ -179,7 +179,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index dc1e3172..553d688e 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -32,17 +32,17 @@ com.google.code.gson gson - 2.8.9 + 2.10.1 io.cloudevents cloudevents-core - 2.2.0 + 2.5.0 io.cloudevents cloudevents-json-jackson - 2.2.0 + 2.5.0 diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 08ade5e3..860c0b4c 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -22,7 +22,7 @@ 5.3.2 11 11 - 2.0.0.RC2 + 2.5.0 @@ -68,12 +68,12 @@ com.google.code.gson gson - 2.8.9 + 2.10.1 com.ryanharter.auto.value auto-value-gson - 1.3.0 + 1.3.1 provided @@ -85,19 +85,19 @@ com.google.auto.value auto-value - 1.7 + 1.10.1 provided com.google.auto.value auto-value-annotations - 1.7 + 1.10.1 provided org.eclipse.jetty jetty-servlet - 9.4.49.v20220914 + 9.4.51.v20230217 org.eclipse.jetty @@ -121,36 +121,36 @@ org.mockito mockito-core - 3.2.4 + 3.12.4 test junit junit - 4.13.1 + 4.13.2 test com.google.re2j re2j - 1.6 + 1.7 com.google.truth truth - 1.0.1 + 1.1.3 test com.google.truth.extensions truth-java8-extension - 1.0.1 + 1.1.3 test org.eclipse.jetty jetty-client - 9.4.26.v20200117 + 9.4.51.v20230217 test @@ -159,7 +159,7 @@ maven-jar-plugin - 3.1.2 + 3.3.0 @@ -171,7 +171,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.2.1 + 3.4.1 package diff --git a/invoker/pom.xml b/invoker/pom.xml index b1017747..7c2b515e 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -82,7 +82,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.0 + 3.5.0 attach-javadocs @@ -95,7 +95,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 61730b65..d6571a6d 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -35,7 +35,7 @@ com.google.code.gson gson - 2.8.9 + 2.10.1 @@ -43,7 +43,7 @@ maven-jar-plugin - 3.1.2 + 3.3.0 @@ -85,7 +85,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0-M1 + 3.1.1 true From 5264e35b2522a789d65f0e0fd9bb5584694529eb Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 23 May 2023 12:12:35 -0700 Subject: [PATCH 012/172] feat: Define strongly typed function interface (#186) Introduces a new Typed signature to the functions framework which provides automatic request deserialization and response serialization. --- .github/workflows/codeql.yml | 12 +- function-maven-plugin/pom.xml | 2 +- functions-framework-api/pom.xml | 2 +- .../google/cloud/functions/TypedFunction.java | 59 +++++++ invoker/conformance/pom.xml | 4 +- invoker/core/pom.xml | 7 +- .../invoker/HttpFunctionExecutor.java | 14 +- .../invoker/TypedFunctionExecutor.java | 165 ++++++++++++++++++ .../invoker/http/HttpResponseImpl.java | 34 ++-- .../functions/invoker/runner/Invoker.java | 37 ++-- .../BackgroundFunctionExecutorTest.java | 1 - .../functions/invoker/IntegrationTest.java | 60 ++++++- .../invoker/TypedFunctionExecutorTest.java | 37 ++++ .../invoker/testfunctions/Typed.java | 25 +++ .../testfunctions/TypedCustomFormat.java | 38 ++++ .../invoker/testfunctions/TypedVoid.java | 12 ++ .../resources/typed_nameconcat_request.json | 4 + invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 5 +- .../java/com/example/functionjar/Typed.java | 25 +++ 20 files changed, 488 insertions(+), 57 deletions(-) create mode 100644 functions-framework-api/src/main/java/com/google/cloud/functions/TypedFunction.java create mode 100644 invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/Typed.java create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedCustomFormat.java create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedVoid.java create mode 100644 invoker/core/src/test/resources/typed_nameconcat_request.json create mode 100644 invoker/testfunction/src/test/java/com/example/functionjar/Typed.java diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 45f6540c..3d013efd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -49,12 +49,12 @@ jobs: # queries: security-extended,security-and-quality - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - - name: Autobuild - uses: github/codeql-action/autobuild@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 - with: - working-directory: ${{ matrix.working-directory }} - + + - name: Build + run: | + (cd functions-framework-api/ && mvn install) + (cd invoker/ && mvn clean install) + (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@29b1f65c5e92e24fe6b6647da1eaabe529cec70f # v2.3.3 diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index ca3a98a5..eab73245 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -46,7 +46,7 @@ com.google.cloud.functions.invoker java-function-invoker - 1.2.1 + 1.2.3-SNAPSHOT diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index ebc27ba4..3bdeffa7 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -26,7 +26,7 @@ com.google.cloud.functions functions-framework-api - 1.0.5-SNAPSHOT + 1.0.6-SNAPSHOT UTF-8 diff --git a/functions-framework-api/src/main/java/com/google/cloud/functions/TypedFunction.java b/functions-framework-api/src/main/java/com/google/cloud/functions/TypedFunction.java new file mode 100644 index 00000000..16baf0b6 --- /dev/null +++ b/functions-framework-api/src/main/java/com/google/cloud/functions/TypedFunction.java @@ -0,0 +1,59 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.cloud.functions; + +import java.lang.reflect.Type; + +/** + * Represents a Cloud Function with a strongly typed interface that is activated by an HTTP request. + */ +@FunctionalInterface +public interface TypedFunction { + /** + * Called to service an incoming HTTP request. This interface is implemented by user code to + * provide the action for a given HTTP function. If this method throws any exception (including + * any {@link Error}) then the HTTP response will have a 500 status code. + * + * @param arg the payload of the event, deserialized from the original JSON string. + * @return invocation result or null to indicate the body of the response should be empty. + * @throws Exception to produce a 500 status code in the HTTP response. + */ + public ResponseT apply(RequestT arg) throws Exception; + + /** + * Called to get the the format object that handles request decoding and response encoding. If + * null is returned a default JSON format is used. + * + * @return the {@link WireFormat} to use for serialization + */ + public default WireFormat getWireFormat() { + return null; + } + + /** + * Describes how to deserialize request object and serialize response objects for an HTTP + * invocation. + */ + public interface WireFormat { + /** Serialize is expected to encode the object to the provided HttpResponse. */ + void serialize(Object object, HttpResponse response) throws Exception; + + /** + * Deserialize is expected to read an object of {@code Type} from the HttpRequest. The Type is + * determined through reflection on the user's function. + */ + Object deserialize(HttpRequest request, Type type) throws Exception; + } +} diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 553d688e..354b3568 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 860c0b4c..dde36f33 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -44,6 +44,7 @@ com.google.cloud.functions functions-framework-api + 1.0.6-SNAPSHOT javax.servlet @@ -114,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.2.2-SNAPSHOT + 1.2.3-SNAPSHOT test-jar test diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java index 7a66fefd..21115666 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java @@ -17,7 +17,6 @@ import com.google.cloud.functions.HttpFunction; import com.google.cloud.functions.invoker.http.HttpRequestImpl; import com.google.cloud.functions.invoker.http.HttpResponseImpl; -import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.http.HttpServlet; @@ -72,18 +71,7 @@ public void service(HttpServletRequest req, HttpServletResponse res) { res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } finally { Thread.currentThread().setContextClassLoader(oldContextLoader); - try { - // We can't use HttpServletResponse.flushBuffer() because we wrap the PrintWriter - // returned by HttpServletResponse in our own BufferedWriter to match our API. - // So we have to flush whichever of getWriter() or getOutputStream() works. - try { - respImpl.getOutputStream().flush(); - } catch (IllegalStateException e) { - respImpl.getWriter().flush(); - } - } catch (IOException e) { - // Too bad, can't flush. - } + respImpl.flush(); } } } diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java new file mode 100644 index 00000000..a6edfc32 --- /dev/null +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/TypedFunctionExecutor.java @@ -0,0 +1,165 @@ +package com.google.cloud.functions.invoker; + +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import com.google.cloud.functions.TypedFunction; +import com.google.cloud.functions.TypedFunction.WireFormat; +import com.google.cloud.functions.invoker.http.HttpRequestImpl; +import com.google.cloud.functions.invoker.http.HttpResponseImpl; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.Optional; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +public class TypedFunctionExecutor extends HttpServlet { + private static final String APPLY_METHOD = "apply"; + private static final Logger logger = Logger.getLogger("com.google.cloud.functions.invoker"); + + private final Type argType; + private final TypedFunction function; + private final WireFormat format; + + private TypedFunctionExecutor( + Type argType, TypedFunction func, WireFormat format) { + this.argType = argType; + this.function = func; + this.format = format; + } + + public static TypedFunctionExecutor forClass(Class functionClass) { + if (!TypedFunction.class.isAssignableFrom(functionClass)) { + throw new RuntimeException( + "Class " + + functionClass.getName() + + " does not implement " + + TypedFunction.class.getName()); + } + @SuppressWarnings("unchecked") + Class> typedFunctionClass = + (Class>) functionClass.asSubclass(TypedFunction.class); + + Optional argType = handlerTypeArgument(typedFunctionClass); + if (argType.isEmpty()) { + throw new RuntimeException( + "Class " + + typedFunctionClass.getName() + + " does not implement " + + TypedFunction.class.getName()); + } + + TypedFunction typedFunction; + try { + typedFunction = typedFunctionClass.getDeclaredConstructor().newInstance(); + } catch (Exception e) { + throw new RuntimeException( + "Class " + + typedFunctionClass.getName() + + " must declare a valid default constructor to be usable as a strongly typed" + + " function. Could not use constructor: " + + e.toString()); + } + + WireFormat format = typedFunction.getWireFormat(); + if (format == null) { + format = LazyDefaultFormatHolder.defaultFormat; + } + + @SuppressWarnings("unchecked") + TypedFunctionExecutor executor = + new TypedFunctionExecutor( + argType.orElseThrow(), (TypedFunction) typedFunction, format); + return executor; + } + + /** + * Returns the {@code ReqT} of a concrete class that implements {@link TypedFunction + * TypedFunction}. Returns an empty {@link Optional} if {@code ReqT} can't be + * determined. + */ + static Optional handlerTypeArgument(Class> functionClass) { + return Arrays.stream(functionClass.getMethods()) + .filter(method -> method.getName().equals(APPLY_METHOD) && method.getParameterCount() == 1) + .map(method -> method.getGenericParameterTypes()[0]) + .filter(type -> type != Object.class) + .findFirst(); + } + + /** Executes the user's method, can handle all HTTP type methods. */ + @Override + public void service(HttpServletRequest req, HttpServletResponse res) { + HttpRequestImpl reqImpl = new HttpRequestImpl(req); + HttpResponseImpl resImpl = new HttpResponseImpl(res); + ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader(); + + try { + Thread.currentThread().setContextClassLoader(function.getClass().getClassLoader()); + handleRequest(reqImpl, resImpl); + } finally { + Thread.currentThread().setContextClassLoader(oldContextClassLoader); + resImpl.flush(); + } + } + + private void handleRequest(HttpRequest req, HttpResponse res) { + Object reqObj; + try { + reqObj = format.deserialize(req, argType); + } catch (Throwable t) { + logger.log(Level.SEVERE, "Failed to parse request for " + function.getClass().getName(), t); + res.setStatusCode(HttpServletResponse.SC_BAD_REQUEST); + return; + } + + Object resObj; + try { + resObj = function.apply(reqObj); + } catch (Throwable t) { + logger.log(Level.SEVERE, "Failed to execute " + function.getClass().getName(), t); + res.setStatusCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + return; + } + + try { + format.serialize(resObj, res); + } catch (Throwable t) { + logger.log( + Level.SEVERE, "Failed to serialize response for " + function.getClass().getName(), t); + res.setStatusCode(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + return; + } + } + + private static class LazyDefaultFormatHolder { + static final WireFormat defaultFormat = new GsonWireFormat(); + } + + private static class GsonWireFormat implements TypedFunction.WireFormat { + private final Gson gson = new GsonBuilder().create(); + + @Override + public void serialize(Object object, HttpResponse response) throws Exception { + if (object == null) { + response.setStatusCode(HttpServletResponse.SC_NO_CONTENT); + return; + } + try (BufferedWriter bodyWriter = response.getWriter()) { + gson.toJson(object, bodyWriter); + } + } + + @Override + public Object deserialize(HttpRequest request, Type type) throws Exception { + try (BufferedReader bodyReader = request.getReader()) { + return gson.fromJson(bodyReader, type); + } + } + } +} diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/HttpResponseImpl.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/HttpResponseImpl.java index b455eb47..c02246f0 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/HttpResponseImpl.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/HttpResponseImpl.java @@ -86,22 +86,32 @@ public OutputStream getOutputStream() throws IOException { @Override public synchronized BufferedWriter getWriter() throws IOException { if (writer == null) { - // Unfortunately this means that we get two intermediate objects between the - // object we return - // and the underlying Writer that response.getWriter() wraps. We could try - // accessing the - // PrintWriter.out field via reflection, but that sort of access to non-public - // fields of - // platform classes is now frowned on and may draw warnings or even fail in - // subsequent - // versions. - // We could instead wrap the OutputStream, but that would require us to deduce - // the appropriate - // Charset, using logic like this: + // Unfortunately this means that we get two intermediate objects between the object we return + // and the underlying Writer that response.getWriter() wraps. We could try accessing the + // PrintWriter.out field via reflection, but that sort of access to non-public fields of + // platform classes is now frowned on and may draw warnings or even fail in subsequent + // versions. We could instead wrap the OutputStream, but that would require us to deduce the + // appropriate Charset, using logic like this: // https://github.com/eclipse/jetty.project/blob/923ec38adf/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java#L731 // We may end up doing that if performance is an issue. writer = new BufferedWriter(response.getWriter()); } return writer; } + + public void flush() { + try { + // We can't use HttpServletResponse.flushBuffer() because we wrap the + // PrintWriter returned by HttpServletResponse in our own BufferedWriter + // to match our API. So we have to flush whichever of getWriter() or + // getOutputStream() works. + try { + getOutputStream().flush(); + } catch (IllegalStateException e) { + getWriter().flush(); + } + } catch (IOException e) { + // Too bad, can't flush. + } + } } diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java index d35e21ea..4936da4e 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java @@ -20,8 +20,10 @@ import com.beust.jcommander.Parameter; import com.beust.jcommander.ParameterException; import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.TypedFunction; import com.google.cloud.functions.invoker.BackgroundFunctionExecutor; import com.google.cloud.functions.invoker.HttpFunctionExecutor; +import com.google.cloud.functions.invoker.TypedFunctionExecutor; import com.google.cloud.functions.invoker.gcf.JsonLogHandler; import java.io.File; import java.io.IOException; @@ -81,9 +83,10 @@ public class Invoker { static { if (isGcf()) { - // If we're running with Google Cloud Functions, we'll get better-looking logs if we arrange - // for them to be formatted using StackDriver's "structured logging" JSON format. Remove the - // JDK's standard logger and replace it with the JSON one. + // If we're running with Google Cloud Functions, we'll get better-looking logs + // if we arrange for them to be formatted using StackDriver's "structured + // logging" JSON format. Remove the JDK's standard logger and replace it with + // the JSON one. for (Handler handler : rootLogger.getHandlers()) { rootLogger.removeHandler(handler); } @@ -252,11 +255,10 @@ public void startServer() throws Exception { *
{@code
    * // Create an invoker
    * Invoker invoker = new Invoker(
-   *         8081,
-   *         "org.example.MyHttpFunction",
-   *         "http",
-   *         Thread.currentThread().getContextClassLoader()
-   * );
+   *     8081,
+   *     "org.example.MyHttpFunction",
+   *     "http",
+   *     Thread.currentThread().getContextClassLoader());
    *
    * // Start the test server
    * invoker.startTestServer();
@@ -303,6 +305,9 @@ private void startServer(boolean join) throws Exception {
         case "cloudevent":
           servlet = BackgroundFunctionExecutor.forClass(functionClass);
           break;
+        case "typed":
+          servlet = TypedFunctionExecutor.forClass(functionClass);
+          break;
         default:
           String error =
               String.format(
@@ -350,9 +355,9 @@ private Class loadFunctionClass() throws ClassNotFoundException {
         if (firstException == null) {
           firstException = e;
         }
-        // This might be a nested class like com.example.Foo.Bar. That will actually appear as
-        // com.example.Foo$Bar as far as Class.forName is concerned. So we try to replace every dot
-        // from the last to the first with a $ in the hope of finding a class we can load.
+        // This might be a nested class like com.example.Foo.Bar. That will actually
+        // appear as com.example.Foo$Bar as far as Class.forName is concerned. So we try to replace
+        // every dot from the last to the first with a $ in the hope of finding a class we can load.
         int lastDot = target.lastIndexOf('.');
         if (lastDot < 0) {
           throw firstException;
@@ -366,6 +371,9 @@ private HttpServlet servletForDeducedSignatureType(Class functionClass) {
     if (HttpFunction.class.isAssignableFrom(functionClass)) {
       return HttpFunctionExecutor.forClass(functionClass);
     }
+    if (TypedFunction.class.isAssignableFrom(functionClass)) {
+      return TypedFunctionExecutor.forClass(functionClass);
+    }
     Optional maybeExecutor =
         BackgroundFunctionExecutor.maybeForClass(functionClass);
     if (maybeExecutor.isPresent()) {
@@ -432,8 +440,8 @@ private void logServerInfo() {
   }
 
   private static boolean isGcf() {
-    // This environment variable is set in the GCF environment but won't be set when invoking
-    // the Functions Framework directly. We don't use its value, just whether it is set.
+    // This environment variable is set in the GCF environment but won't be set when invoking the
+    // Functions Framework directly. We don't use its value, just whether it is set.
     return System.getenv("K_SERVICE") != null;
   }
 
@@ -509,7 +517,8 @@ private static boolean isCloudEventsApiClass(String name) {
 
     private static ClassLoader getSystemOrBootstrapClassLoader() {
       try {
-        // We're still building against the Java 8 API, so we have to use reflection for now.
+        // We're still building against the Java 8 API, so we have to use reflection for
+        // now.
         Method getPlatformClassLoader = ClassLoader.class.getMethod("getPlatformClassLoader");
         return (ClassLoader) getPlatformClassLoader.invoke(null);
       } catch (ReflectiveOperationException e) {
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java
index d00b0b4f..2b7211c9 100644
--- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java
@@ -100,7 +100,6 @@ public void parseLegacyEventPubSubEmulator() throws IOException {
       assertThat(context.eventType()).isEqualTo("google.pubsub.topic.publish");
       assertThat(context.eventId()).isEqualTo("1");
       assertThat(context.timestamp()).isNotNull();
-      ;
 
       JsonObject data = event.getData().getAsJsonObject();
       assertThat(data.get("data").getAsString()).isEqualTo("eyJmb28iOiJiYXIifQ==");
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java
index 335cc7de..f84ddbdd 100644
--- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java
@@ -383,6 +383,46 @@ public void typedBackground() throws Exception {
     }
   }
 
+  @Test
+  public void typedFunction() throws Exception {
+    URL resourceUrl = getClass().getResource("/typed_nameconcat_request.json");
+    assertThat(resourceUrl).isNotNull();
+    String originalJson = Resources.toString(resourceUrl, StandardCharsets.UTF_8);
+    testFunction(
+        SignatureType.TYPED,
+        fullTarget("Typed"),
+        ImmutableList.of(),
+        ImmutableList.of(
+            TestCase.builder()
+                .setRequestText(originalJson)
+                .setExpectedResponseText("{\"fullName\":\"JohnDoe\"}")
+                .build()));
+  }
+
+  @Test
+  public void typedVoidFunction() throws Exception {
+    testFunction(
+        SignatureType.TYPED,
+        fullTarget("TypedVoid"),
+        ImmutableList.of(),
+        ImmutableList.of(
+            TestCase.builder().setRequestText("{}").setExpectedResponseCode(204).build()));
+  }
+
+  @Test
+  public void typedCustomFormat() throws Exception {
+    testFunction(
+        SignatureType.TYPED,
+        fullTarget("TypedCustomFormat"),
+        ImmutableList.of(),
+        ImmutableList.of(
+            TestCase.builder()
+                .setRequestText("abc\n123\n$#@\n")
+                .setExpectedResponseText("abc123$#@")
+                .setExpectedResponseCode(200)
+                .build()));
+  }
+
   private void backgroundTest(String target) throws Exception {
     File snoopFile = snoopFile();
     String gcfRequestText = sampleLegacyEvent(snoopFile);
@@ -571,6 +611,23 @@ public void classpathOptionBackground() throws Exception {
         ImmutableList.of(TestCase.builder().setRequestText(json.toString()).build()));
   }
 
+  /** Like {@link #classpathOptionHttp} but for typed functions. */
+  @Test
+  public void classpathOptionTyped() throws Exception {
+    URL resourceUrl = getClass().getResource("/typed_nameconcat_request.json");
+    assertThat(resourceUrl).isNotNull();
+    String originalJson = Resources.toString(resourceUrl, StandardCharsets.UTF_8);
+    testFunction(
+        SignatureType.TYPED,
+        "com.example.functionjar.Typed",
+        ImmutableList.of("--classpath", functionJarString()),
+        ImmutableList.of(
+            TestCase.builder()
+                .setRequestText(originalJson)
+                .setExpectedResponseText("{\"fullName\":\"JohnDoe\"}")
+                .build()));
+  }
+
   // In these tests, we test a number of different functions that express the same functionality
   // in different ways. Each function is invoked with a complete HTTP body that looks like a real
   // event. We start with a fixed body and insert into its JSON an extra property that tells the
@@ -659,7 +716,8 @@ private void testFunction(
   private enum SignatureType {
     HTTP("http"),
     BACKGROUND("event"),
-    CLOUD_EVENT("cloudevent");
+    CLOUD_EVENT("cloudevent"),
+    TYPED("typed");
 
     private final String name;
 
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java
new file mode 100644
index 00000000..969d1dcc
--- /dev/null
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java
@@ -0,0 +1,37 @@
+package com.google.cloud.functions.invoker;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth8.assertThat;
+
+import com.google.cloud.functions.TypedFunction;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class TypedFunctionExecutorTest {
+  private static class NameConcatRequest {
+    String firstName;
+    String lastName;
+  }
+
+  private static class NameConcatResponse {
+    String fullName;
+  }
+
+  private static class NameConcatFunction
+      implements TypedFunction {
+    @Override
+    public NameConcatResponse apply(NameConcatRequest arg) throws Exception {
+      NameConcatResponse resp = new NameConcatResponse();
+      resp.fullName = arg.firstName + arg.lastName;
+      return resp;
+    }
+  }
+
+  @Test
+  public void canDetermineTypeArgument() {
+    assertThat(TypedFunctionExecutor.handlerTypeArgument(NameConcatFunction.class))
+        .hasValue(NameConcatRequest.class);
+  }
+}
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/Typed.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/Typed.java
new file mode 100644
index 00000000..af1c9356
--- /dev/null
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/Typed.java
@@ -0,0 +1,25 @@
+package com.google.cloud.functions.invoker.testfunctions;
+
+import com.google.cloud.functions.TypedFunction;
+
+public class Typed implements TypedFunction {
+
+  @Override
+  public NameConcatResponse apply(NameConcatRequest arg) throws Exception {
+    return new NameConcatResponse().setFullName(arg.firstName + arg.lastName);
+  }
+}
+
+class NameConcatRequest {
+  String firstName;
+  String lastName;
+}
+
+class NameConcatResponse {
+  String fullName;
+
+  NameConcatResponse setFullName(String fullName) {
+    this.fullName = fullName;
+    return this;
+  }
+}
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedCustomFormat.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedCustomFormat.java
new file mode 100644
index 00000000..4597f216
--- /dev/null
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedCustomFormat.java
@@ -0,0 +1,38 @@
+package com.google.cloud.functions.invoker.testfunctions;
+
+import com.google.cloud.functions.HttpRequest;
+import com.google.cloud.functions.HttpResponse;
+import com.google.cloud.functions.TypedFunction;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.List;
+
+public class TypedCustomFormat implements TypedFunction, String> {
+
+  @Override
+  public String apply(List arg) throws Exception {
+    return String.join("", arg);
+  }
+
+  @Override
+  public WireFormat getWireFormat() {
+    return new CustomFormat();
+  }
+}
+
+class CustomFormat implements TypedFunction.WireFormat {
+  @Override
+  public Object deserialize(HttpRequest request, Type type) throws Exception {
+    List req = new ArrayList<>();
+    String line;
+    while ((line = request.getReader().readLine()) != null) {
+      req.add(line);
+    }
+    return req;
+  }
+
+  @Override
+  public void serialize(Object object, HttpResponse response) throws Exception {
+    response.getWriter().write((String) object);
+  }
+}
diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedVoid.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedVoid.java
new file mode 100644
index 00000000..8e0cd00a
--- /dev/null
+++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TypedVoid.java
@@ -0,0 +1,12 @@
+package com.google.cloud.functions.invoker.testfunctions;
+
+import com.google.cloud.functions.TypedFunction;
+
+public class TypedVoid implements TypedFunction {
+  @Override
+  public Void apply(Request arg) throws Exception {
+    return null;
+  }
+}
+
+class Request {}
diff --git a/invoker/core/src/test/resources/typed_nameconcat_request.json b/invoker/core/src/test/resources/typed_nameconcat_request.json
new file mode 100644
index 00000000..f6b4d425
--- /dev/null
+++ b/invoker/core/src/test/resources/typed_nameconcat_request.json
@@ -0,0 +1,4 @@
+{
+  "firstName": "John",
+  "lastName": "Doe"
+}
\ No newline at end of file
diff --git a/invoker/pom.xml b/invoker/pom.xml
index 7c2b515e..498db704 100644
--- a/invoker/pom.xml
+++ b/invoker/pom.xml
@@ -10,7 +10,7 @@
 
   com.google.cloud.functions.invoker
   java-function-invoker-parent
-  1.2.2-SNAPSHOT
+  1.2.3-SNAPSHOT
   pom
   GCF Java Invoker Parent
   
diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml
index d6571a6d..72a0126a 100644
--- a/invoker/testfunction/pom.xml
+++ b/invoker/testfunction/pom.xml
@@ -4,12 +4,12 @@
   
     com.google.cloud.functions.invoker
     java-function-invoker-parent
-    1.2.2-SNAPSHOT
+    1.2.3-SNAPSHOT
   
 
   com.google.cloud.functions.invoker
   java-function-invoker-testfunction
-  1.2.2-SNAPSHOT
+  1.2.3-SNAPSHOT
   Example GCF Function Jar
   
     An example of a GCF function packaged into a jar. We use this in tests.
@@ -19,6 +19,7 @@
     
       com.google.cloud.functions
       functions-framework-api
+      1.0.6-SNAPSHOT
     
     
       
-
+
   4.0.0
 
   
@@ -26,7 +24,7 @@
 
   com.google.cloud.functions
   functions-framework-api
-  1.0.6-SNAPSHOT
+  1.1.0
 
   
     UTF-8
diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml
index e71bcf20..8cd6254e 100644
--- a/invoker/core/pom.xml
+++ b/invoker/core/pom.xml
@@ -46,7 +46,7 @@
     
       com.google.cloud.functions
       functions-framework-api
-      1.0.6-SNAPSHOT
+      1.1.0
     
     
       javax.servlet
diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml
index 72a0126a..85a0d6a6 100644
--- a/invoker/testfunction/pom.xml
+++ b/invoker/testfunction/pom.xml
@@ -19,7 +19,7 @@
     
       com.google.cloud.functions
       functions-framework-api
-      1.0.6-SNAPSHOT
+      1.1.0
     
     
       
       com.google.escapevelocity
       escapevelocity
-      0.9.1
+      1.1
     
     
       com.google.guava

From e30ace5d45dd598a3865e1b9b72e816b9b1a0fb4 Mon Sep 17 00:00:00 2001
From: janell-chen <122311137+janell-chen@users.noreply.github.com>
Date: Mon, 12 Jun 2023 21:33:32 -0700
Subject: [PATCH 026/172] chore(deps): upgrade maven version to fix integ test
 (#211)

---
 functions-framework-api/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml
index ceb34856..24ac5a35 100644
--- a/functions-framework-api/pom.xml
+++ b/functions-framework-api/pom.xml
@@ -151,7 +151,7 @@
           
             org.apache.maven.plugins
             maven-source-plugin
-            3.3.0
+            3.6.0
             
               
                 attach-sources
@@ -203,4 +203,4 @@
       
     
   
-
\ No newline at end of file
+

From b3045ad380cd23e37f5edec0d758031438bcb568 Mon Sep 17 00:00:00 2001
From: Gareth 
Date: Tue, 27 Jun 2023 11:04:49 -0700
Subject: [PATCH 027/172] fix: typed declaration works correctly with http
 trigger (#212)

* Configure typed function conformance test

* fix: typed function signature should be compatible with 'http' signature type

* apply google-java-format fixes
---
 .github/workflows/conformance.yaml            | 29 ++++++++++++++-----
 invoker/conformance/pom.xml                   |  3 +-
 .../conformance/TypedConformanceFunction.java | 26 +++++++++++++++++
 .../functions/invoker/runner/Invoker.java     |  6 +++-
 4 files changed, 54 insertions(+), 10 deletions(-)
 create mode 100644 invoker/conformance/src/main/java/com/google/cloud/functions/conformance/TypedConformanceFunction.java

diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml
index 446029c3..b9404cfc 100644
--- a/.github/workflows/conformance.yaml
+++ b/.github/workflows/conformance.yaml
@@ -51,19 +51,32 @@ jobs:
     - name: Build invoker with Maven
       run: (cd invoker/ && mvn install)
 
+    - name: Build invoker Maven Plugin
+      run: (cd function-maven-plugin/ && mvn install)
+
     - name: Run HTTP conformance tests
-      uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0
+      uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2
       with:
-        version: 'v1.6.0'
+        version: 'v1.8.2'
         functionType: 'http'
         useBuildpacks: false
         cmd: "'mvn -f invoker/conformance/pom.xml function:run -Drun.functionTarget=com.google.cloud.functions.conformance.HttpConformanceFunction'"
         startDelay: 10
 
+    - name: Run Typed conformance tests
+      uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2
+      with:
+        version: 'v1.8.2'
+        functionType: 'http'
+        declarativeType: 'typed'
+        useBuildpacks: false
+        cmd: "'mvn -f invoker/conformance/pom.xml function:run -Drun.functionTarget=com.google.cloud.functions.conformance.TypedConformanceFunction'"
+        startDelay: 10
+
     - name: Run background event conformance tests
-      uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0
+      uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2
       with:
-        version: 'v1.6.0'
+        version: 'v1.8.2'
         functionType: 'legacyevent'
         useBuildpacks: false
         validateMapping: true
@@ -71,9 +84,9 @@ jobs:
         startDelay: 10
 
     - name: Run cloudevent conformance tests
-      uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0
+      uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2
       with:
-        version: 'v1.6.0'
+        version: 'v1.8.2'
         functionType: 'cloudevent'
         useBuildpacks: false
         validateMapping: true
@@ -81,9 +94,9 @@ jobs:
         startDelay: 10
 
     - name: Run HTTP concurrency conformance tests
-      uses: GoogleCloudPlatform/functions-framework-conformance/action@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0
+      uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2
       with:
-        version: 'v1.6.0'
+        version: 'v1.8.2'
         functionType: 'http'
         useBuildpacks: false
         validateConcurrency: true
diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml
index 1c0d59a8..8296836b 100644
--- a/invoker/conformance/pom.xml
+++ b/invoker/conformance/pom.xml
@@ -28,6 +28,7 @@
     
       com.google.cloud.functions
       functions-framework-api
+      1.1.1-SNAPSHOT
     
     
       com.google.code.gson
@@ -52,7 +53,7 @@
         
           com.google.cloud.functions
           function-maven-plugin
-          0.10.1
+          0.11.1-SNAPSHOT
         
       
     
diff --git a/invoker/conformance/src/main/java/com/google/cloud/functions/conformance/TypedConformanceFunction.java b/invoker/conformance/src/main/java/com/google/cloud/functions/conformance/TypedConformanceFunction.java
new file mode 100644
index 00000000..7b57c6ae
--- /dev/null
+++ b/invoker/conformance/src/main/java/com/google/cloud/functions/conformance/TypedConformanceFunction.java
@@ -0,0 +1,26 @@
+package com.google.cloud.functions.conformance;
+
+import com.google.cloud.functions.TypedFunction;
+import com.google.gson.annotations.SerializedName;
+
+public class TypedConformanceFunction
+    implements TypedFunction {
+  @Override
+  public ConformanceResponse apply(ConformanceRequest req) throws Exception {
+    return new ConformanceResponse(req);
+  }
+}
+
+class ConformanceRequest {
+  @SerializedName("message")
+  public String message;
+}
+
+class ConformanceResponse {
+  @SerializedName("payload")
+  public ConformanceRequest payload = null;
+
+  ConformanceResponse(ConformanceRequest payload) {
+    this.payload = payload;
+  }
+}
diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java
index 4936da4e..ebc70718 100644
--- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java
+++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java
@@ -299,7 +299,11 @@ private void startServer(boolean join) throws Exception {
     } else {
       switch (functionSignatureType) {
         case "http":
-          servlet = HttpFunctionExecutor.forClass(functionClass);
+          if (TypedFunction.class.isAssignableFrom(functionClass)) {
+            servlet = TypedFunctionExecutor.forClass(functionClass);
+          } else {
+            servlet = HttpFunctionExecutor.forClass(functionClass);
+          }
           break;
         case "event":
         case "cloudevent":

From 4e19904e4c4dddda6f4ded8d732e1394a10aee3b Mon Sep 17 00:00:00 2001
From: HKWinterhalter 
Date: Fri, 7 Jul 2023 16:13:57 -0700
Subject: [PATCH 028/172] ci: fix function-maven-plugin release (#217)

Developer and license information was missing from the pom and is required to publish to the Maven
central repo.
---
 function-maven-plugin/pom.xml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml
index d6b8e5a1..87ac3459 100644
--- a/function-maven-plugin/pom.xml
+++ b/function-maven-plugin/pom.xml
@@ -1,6 +1,12 @@
 
   4.0.0
 
+  
+    org.sonatype.oss
+    oss-parent
+    9
+  
+
   com.google.cloud.functions
   function-maven-plugin
   maven-plugin
@@ -17,6 +23,14 @@
     HEAD
   
 
+  
+    
+      Apache License, Version 2.0
+      http://www.apache.org/licenses/LICENSE-2.0.txt
+      repo
+    
+  
+
   
     11
     11
@@ -157,4 +171,4 @@
       
     
   
-
\ No newline at end of file
+

From 9970a4d35557d8489c33bf6d3600d8e4ad0dcbe4 Mon Sep 17 00:00:00 2001
From: HKWinterhalter 
Date: Mon, 17 Jul 2023 15:40:17 -0700
Subject: [PATCH 029/172] ci: rename master branch to main (#219)

---
 .github/workflows/buildpack-integration-test.yml              | 2 +-
 .github/workflows/codeql.yml                                  | 4 ++--
 .github/workflows/conformance.yaml                            | 2 +-
 .github/workflows/lint.yaml                                   | 2 +-
 .github/workflows/scorecard.yml                               | 2 +-
 .github/workflows/unit.yaml                                   | 2 +-
 .../java/com/google/cloud/functions/BackgroundFunction.java   | 2 +-
 .../com/google/cloud/functions/RawBackgroundFunction.java     | 2 +-
 invoker/pom.xml                                               | 2 +-
 9 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml
index 35e9b6c7..6a7c3677 100644
--- a/.github/workflows/buildpack-integration-test.yml
+++ b/.github/workflows/buildpack-integration-test.yml
@@ -3,7 +3,7 @@ name: Buildpack Integration Test
 on:
   push:
     branches:
-      - master
+      - main
   workflow_dispatch:
 
 # Declare default permissions as read only.
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index f68b594b..afdbcc5c 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -2,10 +2,10 @@ name: "CodeQL"
 
 on:
   push:
-    branches: [ "master" ]
+    branches: [ "main" ]
   pull_request:
     # The branches below must be a subset of the branches above
-    branches: [ "master" ]
+    branches: [ "main" ]
 
 permissions:
   contents: read
diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml
index b9404cfc..b8d86b87 100644
--- a/.github/workflows/conformance.yaml
+++ b/.github/workflows/conformance.yaml
@@ -2,7 +2,7 @@ name: Java Conformance CI
 on:
   push:
     branches:
-    - master
+    - main
   pull_request:
 
 # Declare default permissions as read only.
diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index bfb7350d..7992931a 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -2,7 +2,7 @@ name: Java Lint CI
 on:
   push:
     branches:
-    - master
+    - main
   pull_request:
   workflow_dispatch:
 permissions:
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
index 3ab2cbec..03f47547 100644
--- a/.github/workflows/scorecard.yml
+++ b/.github/workflows/scorecard.yml
@@ -8,7 +8,7 @@ on:
   schedule:
     - cron: '0 */12 * * *'
   push:
-    branches: [ "master" ]
+    branches: [ "main" ]
   workflow_dispatch:
 
 # Declare default permissions as read only.
diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml
index 763456d0..c4751a83 100644
--- a/.github/workflows/unit.yaml
+++ b/.github/workflows/unit.yaml
@@ -2,7 +2,7 @@ name: Java Unit CI
 on:
   push:
     branches:
-    - master
+    - main
   pull_request:
 permissions:
   contents: read
diff --git a/functions-framework-api/src/main/java/com/google/cloud/functions/BackgroundFunction.java b/functions-framework-api/src/main/java/com/google/cloud/functions/BackgroundFunction.java
index 5052b7b6..5dc0a97e 100644
--- a/functions-framework-api/src/main/java/com/google/cloud/functions/BackgroundFunction.java
+++ b/functions-framework-api/src/main/java/com/google/cloud/functions/BackgroundFunction.java
@@ -18,7 +18,7 @@
  * Represents a Cloud Function that is activated by an event and parsed into a user-supplied class.
  * The payload of the event is a JSON object, which is deserialized into a user-defined class as
  * described for Gson.
+ * href="https://github.com/google/gson/blob/main/UserGuide.md#TOC-Object-Examples">Gson.
  *
  * 

Here is an example of an implementation that accesses the {@code messageId} property from a * payload that matches a user-defined {@code PubSubMessage} class: diff --git a/functions-framework-api/src/main/java/com/google/cloud/functions/RawBackgroundFunction.java b/functions-framework-api/src/main/java/com/google/cloud/functions/RawBackgroundFunction.java index e27624ed..5f9706ba 100644 --- a/functions-framework-api/src/main/java/com/google/cloud/functions/RawBackgroundFunction.java +++ b/functions-framework-api/src/main/java/com/google/cloud/functions/RawBackgroundFunction.java @@ -17,7 +17,7 @@ /** * Represents a Cloud Function that is activated by an event. The payload of the event is a JSON * object, which can be parsed using a JSON package such as GSON. + * href="https://github.com/google/gson/blob/main/UserGuide.md">GSON. * *

Here is an example of an implementation that parses the JSON payload using Gson, to access its * {@code messageId} property: diff --git a/invoker/pom.xml b/invoker/pom.xml index 6009e322..73ba5d34 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -15,7 +15,7 @@ Parent POM for the GCF Java Invoker. The project is structured like this so that we can have modules that build jar files for use in tests. - https://github.com/GoogleCloudPlatform/functions-framework-java/tree/master/invoker + https://github.com/GoogleCloudPlatform/functions-framework-java/tree/main/invoker http://github.com/GoogleCloudPlatform/functions-framework-java From 04f04590492d4240c67cb2a8021fb0be34ee8b59 Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Thu, 20 Jul 2023 13:14:16 -0700 Subject: [PATCH 030/172] ci: retarget buildpack integration test to main instead of release version (#222) --- .github/workflows/buildpack-integration-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index 6a7c3677..11d53282 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -11,7 +11,7 @@ permissions: read-all jobs: java11-buildpack-test: - uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 + uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main with: http-builder-source: '/tmp/tests/conformance' http-builder-target: 'com.google.cloud.functions.conformance.HttpConformanceFunction' @@ -20,7 +20,7 @@ jobs: prerun: 'invoker/conformance/prerun.sh' builder-runtime: 'java11' java17-buildpack-test: - uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@v1.8.0 + uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main with: http-builder-source: '/tmp/tests/conformance' http-builder-target: 'com.google.cloud.functions.conformance.HttpConformanceFunction' From 03bc0325b3f232146aee531471885f5cec802230 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Tue, 25 Jul 2023 11:18:26 -0700 Subject: [PATCH 031/172] chore: run buildpack tests on pull request (#218) --- .github/workflows/buildpack-integration-test.yml | 10 +++++++++- invoker/conformance/prerun.sh | 7 ++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index 11d53282..728f5a0f 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -4,7 +4,11 @@ on: push: branches: - main + pull_request: workflow_dispatch: + # Runs every day on 12:00 AM PST + schedule: + - cron: "0 0 * * *" # Declare default permissions as read only. permissions: read-all @@ -19,6 +23,8 @@ jobs: cloudevent-builder-target: 'com.google.cloud.functions.conformance.CloudEventsConformanceFunction' prerun: 'invoker/conformance/prerun.sh' builder-runtime: 'java11' + builder-runtime-version: '11' + builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest java17-buildpack-test: uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main with: @@ -27,4 +33,6 @@ jobs: cloudevent-builder-source: '/tmp/tests/conformance' cloudevent-builder-target: 'com.google.cloud.functions.conformance.CloudEventsConformanceFunction' prerun: 'invoker/conformance/prerun.sh' - builder-runtime: 'java17' \ No newline at end of file + builder-runtime: 'java17' + builder-runtime-version: '17' + builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest \ No newline at end of file diff --git a/invoker/conformance/prerun.sh b/invoker/conformance/prerun.sh index d5614357..504e3aa8 100755 --- a/invoker/conformance/prerun.sh +++ b/invoker/conformance/prerun.sh @@ -14,11 +14,10 @@ # - Copy the conformance tests folder into temp # - Build java-function-invoker with version 0.0.0-SNAPSHOT into artifacts # folder -# - Build functions-framework-api with version 0.0.0-SNAPSHOT into artifacts +# - Build functions-framework-api with version 0.0.0-SNAPSHOT into artifacts # folder # - Ensure that we use the buildpack_pom.xml file by renaming it to pom.xml - set -e REPO_ROOT=$(git rev-parse --show-toplevel) @@ -36,7 +35,7 @@ function get_mvn_version() { } # Must first install a local version of the API package -cd $REPO_ROOT/functions-framework-api +cd $REPO_ROOT/functions-framework-api mvn install -Dmaven.repo.local=/tmp/tests/conformance/artifacts FRAMEWORK_API_VERSION=$(get_mvn_version) @@ -50,3 +49,5 @@ mv /tmp/tests/conformance/buildpack_pom.xml /tmp/tests/conformance/pom.xml sed -i "s/FRAMEWORK-API-VERSION/${FRAMEWORK_API_VERSION}/g" /tmp/tests/conformance/pom.xml sed -i "s/INVOKER-VERSION/${INVOKER_VERSION}/g" /tmp/tests/conformance/pom.xml + +cat /tmp/tests/conformance/pom.xml From f3fe2ce46fcb1885137cdf504649612e7c31dc4c Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 25 Jul 2023 15:39:15 -0700 Subject: [PATCH 032/172] fix(functions): include Implementation-Version key in invoker package manifest (#221) --- invoker/core/pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 2308f93b..bdae9e4e 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -165,6 +165,8 @@ com.google.cloud.functions.invoker.runner.Invoker + true + true @@ -184,4 +186,4 @@ - \ No newline at end of file + From 8ff911462bd811fbb10da7f3db25eb1e5b5aaef5 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Tue, 5 Sep 2023 18:37:49 -0700 Subject: [PATCH 033/172] chore: add missing egress endpoint to codeql ACL (#223) --- .github/workflows/codeql.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index afdbcc5c..6dba3407 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -39,6 +39,7 @@ jobs: proxy.golang.org:443 repo.maven.apache.org:443 storage.googleapis.com:443 + uploads.github.com:443 - name: Checkout repository uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 From 8ae7d850f5e26964b3a8b52b0494be587e946fdc Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 12 Sep 2023 19:50:01 +0200 Subject: [PATCH 034/172] chore(deps): update all non-major dependencies (#228) Co-authored-by: Kenneth Rosario --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/conformance.yaml | 25 ++++++++++--------------- .github/workflows/lint.yaml | 10 +++++----- .github/workflows/scorecard.yml | 8 ++++---- .github/workflows/unit.yaml | 6 +++--- function-maven-plugin/pom.xml | 6 +++--- invoker/core/pom.xml | 16 ++++++++-------- 7 files changed, 37 insertions(+), 42 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6dba3407..e9c002ec 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: disable-sudo: true egress-policy: block @@ -42,11 +42,11 @@ jobs: uploads.github.com:443 - name: Checkout repository - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 + uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 + uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b8d86b87..0edd3720 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -20,7 +20,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: disable-sudo: true egress-policy: block @@ -32,18 +32,18 @@ jobs: repo.maven.apache.org:443 storage.googleapis.com:443 - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 + uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 with: java-version: ${{ matrix.java }} distribution: temurin - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 with: - go-version: '1.16' + go-version: '1.21' - name: Build API with Maven run: (cd functions-framework-api/ && mvn install) @@ -55,18 +55,16 @@ jobs: run: (cd function-maven-plugin/ && mvn install) - name: Run HTTP conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2 + uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main with: - version: 'v1.8.2' functionType: 'http' useBuildpacks: false cmd: "'mvn -f invoker/conformance/pom.xml function:run -Drun.functionTarget=com.google.cloud.functions.conformance.HttpConformanceFunction'" startDelay: 10 - name: Run Typed conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2 + uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main with: - version: 'v1.8.2' functionType: 'http' declarativeType: 'typed' useBuildpacks: false @@ -74,9 +72,8 @@ jobs: startDelay: 10 - name: Run background event conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2 + uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main with: - version: 'v1.8.2' functionType: 'legacyevent' useBuildpacks: false validateMapping: true @@ -84,9 +81,8 @@ jobs: startDelay: 10 - name: Run cloudevent conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2 + uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main with: - version: 'v1.8.2' functionType: 'cloudevent' useBuildpacks: false validateMapping: true @@ -94,9 +90,8 @@ jobs: startDelay: 10 - name: Run HTTP concurrency conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@2f5f319c06a3531be7f75dc5acf6bd00417ff76e # v1.8.2 + uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main with: - version: 'v1.8.2' functionType: 'http' useBuildpacks: false validateConcurrency: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7992931a..518c3c3d 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,16 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 + uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 with: java-version: 11.x distribution: temurin @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 # v2 minimum required + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 03f47547..087d9842 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: disable-sudo: true egress-policy: block @@ -44,12 +44,12 @@ jobs: rekor.sigstore.dev:443 - name: "Checkout code" - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@80e868c13c90f172d68d1f4501dee99e2479f7af # v2.1.3 + uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 with: results_file: results.sarif results_format: sarif @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6 + uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index c4751a83..d88af609 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -18,16 +18,16 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 + - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 + uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 87ac3459..913b9ccf 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -41,12 +41,12 @@ org.apache.maven maven-plugin-api - 3.9.2 + 3.9.4 org.apache.maven maven-core - 3.9.2 + 3.9.4 org.apache.maven.plugin-tools @@ -71,7 +71,7 @@ com.google.truth truth - 1.1.4 + 1.1.5 test diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index bdae9e4e..837b4cf8 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -86,24 +86,24 @@ com.google.auto.value auto-value - 1.10.1 + 1.10.4 provided com.google.auto.value auto-value-annotations - 1.10.1 + 1.10.4 provided org.eclipse.jetty jetty-servlet - 9.4.51.v20230217 + 9.4.52.v20230823 org.eclipse.jetty jetty-server - 9.4.51.v20230217 + 9.4.52.v20230823 com.beust @@ -139,19 +139,19 @@ com.google.truth truth - 1.1.4 + 1.1.5 test com.google.truth.extensions truth-java8-extension - 1.1.4 + 1.1.5 test org.eclipse.jetty jetty-client - 9.4.51.v20230217 + 9.4.52.v20230823 test @@ -174,7 +174,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.5.0 package From 6ece5604faf31a9375710d43d6aa530efd23e0b1 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Wed, 13 Sep 2023 10:47:58 -0700 Subject: [PATCH 035/172] chore: add egress endpoint to allow list (#233) --- .github/workflows/scorecard.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 087d9842..08480f05 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -42,6 +42,7 @@ jobs: oss-fuzz-build-logs.storage.googleapis.com:443 sigstore-tuf-root.storage.googleapis.com:443 rekor.sigstore.dev:443 + www.bestpractices.dev:443 - name: "Checkout code" uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 From 89b3b92f4d5efeea08256dc56a34d2f4bde57d01 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 16:10:44 -0700 Subject: [PATCH 036/172] chore(main): release java-function-invoker 1.3.1 (#220) * chore(main): release java-function-invoker 1.3.1 * patch maven-plugin package manifest for release --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Gareth George --- .github/.release-please-manifest.json | 2 +- function-maven-plugin/pom.xml | 2 +- invoker/CHANGELOG.md | 8 ++++++++ invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index b3d335ae..c2ee81e0 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.0","invoker":"1.3.0","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.0","invoker":"1.3.1","function-maven-plugin":"0.11.0"} diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 913b9ccf..20cc5882 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -58,7 +58,7 @@ com.google.cloud.functions.invoker java-function-invoker - 1.3.1-SNAPSHOT + 1.3.1 diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index 2646cd1b..2800c114 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.3.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.0...java-function-invoker-v1.3.1) (2023-09-13) + + +### Bug Fixes + +* **functions:** include Implementation-Version key in invoker package manifest ([#221](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/221)) ([f3fe2ce](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/f3fe2ce46fcb1885137cdf504649612e7c31dc4c)) +* typed declaration works correctly with http trigger ([#212](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/212)) ([b3045ad](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/b3045ad380cd23e37f5edec0d758031438bcb568)) + ## [1.3.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.2.1...java-function-invoker-v1.3.0) (2023-06-01) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 8296836b..67e36ae0 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker conformance - 1.3.1-SNAPSHOT + 1.3.1 GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 837b4cf8..63596639 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker java-function-invoker - 1.3.1-SNAPSHOT + 1.3.1 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1-SNAPSHOT + 1.3.1 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 73ba5d34..e3159883 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index fa29218b..660e6f05 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1-SNAPSHOT + 1.3.1 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From 9f7586944034fa63d0f55e6a897d9921b6379049 Mon Sep 17 00:00:00 2001 From: Gareth Date: Fri, 22 Sep 2023 11:54:31 -0700 Subject: [PATCH 037/172] Revert "chore(main): release java-function-invoker 1.3.1 (#220)" (#236) This reverts commit 89b3b92f4d5efeea08256dc56a34d2f4bde57d01. --- .github/.release-please-manifest.json | 2 +- function-maven-plugin/pom.xml | 2 +- invoker/CHANGELOG.md | 8 -------- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 7 files changed, 10 insertions(+), 18 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index c2ee81e0..b3d335ae 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.0","invoker":"1.3.1","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.0","invoker":"1.3.0","function-maven-plugin":"0.11.0"} diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 20cc5882..913b9ccf 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -58,7 +58,7 @@ com.google.cloud.functions.invoker java-function-invoker - 1.3.1 + 1.3.1-SNAPSHOT diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index 2800c114..2646cd1b 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,13 +1,5 @@ # Changelog -## [1.3.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.0...java-function-invoker-v1.3.1) (2023-09-13) - - -### Bug Fixes - -* **functions:** include Implementation-Version key in invoker package manifest ([#221](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/221)) ([f3fe2ce](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/f3fe2ce46fcb1885137cdf504649612e7c31dc4c)) -* typed declaration works correctly with http trigger ([#212](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/212)) ([b3045ad](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/b3045ad380cd23e37f5edec0d758031438bcb568)) - ## [1.3.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.2.1...java-function-invoker-v1.3.0) (2023-06-01) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 67e36ae0..8296836b 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.1 + 1.3.1-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.3.1 + 1.3.1-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 63596639..837b4cf8 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.1-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.3.1 + 1.3.1-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1 + 1.3.1-SNAPSHOT test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index e3159883..73ba5d34 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.1-SNAPSHOT pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 660e6f05..fa29218b 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.1-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1 + 1.3.1-SNAPSHOT Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From bc1ca57738ade76cff8544c3e0dd0bcbd160ae72 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Mon, 25 Sep 2023 11:38:11 -0700 Subject: [PATCH 038/172] chore: fix scorecard action acls (#238) --- .github/workflows/scorecard.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 08480f05..dc3c7c0b 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -31,18 +31,17 @@ jobs: disable-sudo: true egress-policy: block allowed-endpoints: > - api.github.com:443 api.osv.dev:443 api.securityscorecards.dev:443 auth.docker.io:443 bestpractices.coreinfrastructure.org:443 - fulcio.sigstore.dev:443 github.com:443 index.docker.io:443 oss-fuzz-build-logs.storage.googleapis.com:443 sigstore-tuf-root.storage.googleapis.com:443 - rekor.sigstore.dev:443 www.bestpractices.dev:443 + *.sigstore.dev:443 + *.github.com:443 - name: "Checkout code" uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 From 5795b1261d39845f36142b97cb05360cb202a4df Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Sep 2023 20:43:51 +0200 Subject: [PATCH 039/172] chore(deps): update dependency javax.servlet:javax.servlet-api to v4 (#229) --- invoker/core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 837b4cf8..9d809a6a 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -49,7 +49,7 @@ javax.servlet javax.servlet-api - 3.1.0 + 4.0.1 io.cloudevents From 7df8be83040252bbeeba0bae09cd8dca4e58eb24 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 25 Sep 2023 20:47:54 +0200 Subject: [PATCH 040/172] chore(deps): update dependency org.apache.maven.plugins:maven-release-plugin to v3 (#230) --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 24ac5a35..14a940c3 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-release-plugin - 2.5.3 + 3.0.1 default From 6dfc3c74d7bbc40fdb02568a7ddf6b352260cd3a Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 26 Sep 2023 13:50:43 -0700 Subject: [PATCH 041/172] Reapply "chore(main): release java-function-invoker 1.3.1 (#220)" (#236) (#237) This reverts commit 9f7586944034fa63d0f55e6a897d9921b6379049. --- .github/.release-please-manifest.json | 2 +- function-maven-plugin/pom.xml | 2 +- invoker/CHANGELOG.md | 8 ++++++++ invoker/conformance/pom.xml | 6 +++--- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index b3d335ae..c2ee81e0 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.0","invoker":"1.3.0","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.0","invoker":"1.3.1","function-maven-plugin":"0.11.0"} diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 913b9ccf..20cc5882 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -58,7 +58,7 @@ com.google.cloud.functions.invoker java-function-invoker - 1.3.1-SNAPSHOT + 1.3.1 diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index 2646cd1b..2800c114 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## [1.3.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.0...java-function-invoker-v1.3.1) (2023-09-13) + + +### Bug Fixes + +* **functions:** include Implementation-Version key in invoker package manifest ([#221](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/221)) ([f3fe2ce](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/f3fe2ce46fcb1885137cdf504649612e7c31dc4c)) +* typed declaration works correctly with http trigger ([#212](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/212)) ([b3045ad](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/b3045ad380cd23e37f5edec0d758031438bcb568)) + ## [1.3.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.2.1...java-function-invoker-v1.3.0) (2023-06-01) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 8296836b..43894042 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker conformance - 1.3.1-SNAPSHOT + 1.3.1 GCF Confromance Tests @@ -28,7 +28,7 @@ com.google.cloud.functions functions-framework-api - 1.1.1-SNAPSHOT + 1.1.0 com.google.code.gson diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 9d809a6a..f5f4dced 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker java-function-invoker - 1.3.1-SNAPSHOT + 1.3.1 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1-SNAPSHOT + 1.3.1 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 73ba5d34..e3159883 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index fa29218b..660e6f05 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1-SNAPSHOT + 1.3.1 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1-SNAPSHOT + 1.3.1 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From 9f7155b77574ec980ecf9e6dffbd2ee0398db8a7 Mon Sep 17 00:00:00 2001 From: Gareth Date: Thu, 28 Sep 2023 10:25:47 -0700 Subject: [PATCH 042/172] fix: set Thread Context ClassLoader correctly when invoking handler constructor (#239) --- .../invoker/HttpFunctionExecutor.java | 4 +++ .../invoker/HttpFunctionExecutorTest.java | 36 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/HttpFunctionExecutorTest.java diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java index 21115666..401e22a2 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java @@ -48,12 +48,16 @@ public static HttpFunctionExecutor forClass(Class functionClass) { + HttpFunction.class.getName()); } Class httpFunctionClass = functionClass.asSubclass(HttpFunction.class); + ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader(); try { + Thread.currentThread().setContextClassLoader(httpFunctionClass.getClassLoader()); HttpFunction httpFunction = httpFunctionClass.getConstructor().newInstance(); return new HttpFunctionExecutor(httpFunction); } catch (ReflectiveOperationException e) { throw new RuntimeException( "Could not construct an instance of " + functionClass.getName() + ": " + e, e); + } finally { + Thread.currentThread().setContextClassLoader(oldContextLoader); } } diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/HttpFunctionExecutorTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/HttpFunctionExecutorTest.java new file mode 100644 index 00000000..080e3851 --- /dev/null +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/HttpFunctionExecutorTest.java @@ -0,0 +1,36 @@ +package com.google.cloud.functions.invoker; + +import static com.google.common.truth.Truth.assertThat; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class HttpFunctionExecutorTest { + private static ClassLoader customClassLoader = + new ClassLoader(ClassLoader.getSystemClassLoader()) {}; + + public static class ClassLoaderVerifier implements HttpFunction { + public ClassLoaderVerifier() { + assertThat(Thread.currentThread().getContextClassLoader()) + .isNotSameInstanceAs(customClassLoader); + } + + @Override + public void service(HttpRequest request, HttpResponse response) throws Exception { + throw new UnsupportedOperationException("Not implemented"); + } + } + + @Test + public void usesCorrectClassLoaderOverride() { + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(customClassLoader); + HttpFunctionExecutor.forClass(ClassLoaderVerifier.class); + Thread.currentThread().setContextClassLoader(oldClassLoader); + } +} From fca867667db593699193da01b69a4cca7ca48fc8 Mon Sep 17 00:00:00 2001 From: Alberto Date: Fri, 29 Sep 2023 00:35:39 +0200 Subject: [PATCH 043/172] fix: avoid executing function when /favicon.ico or /robots.txt is called (#226) --- .../java/com/google/cloud/functions/invoker/runner/Invoker.java | 1 + 1 file changed, 1 insertion(+) diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java index ebc70718..892d6038 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java @@ -474,6 +474,7 @@ public void handle( throws IOException, ServletException { if (NOT_FOUND_PATHS.contains(request.getRequestURI())) { response.sendError(HttpStatus.NOT_FOUND_404, "Not Found"); + return; } super.handle(target, baseRequest, request, response); } From bef9b6de039945aec71ba0999db3367eab20e4ab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:42:01 -0700 Subject: [PATCH 044/172] chore(main): release java-function-invoker 1.3.2-SNAPSHOT (#234) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 43894042..56dfcf68 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.1 + 1.3.2-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.3.1 + 1.3.2-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index f5f4dced..0ffdd993 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.2-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.3.1 + 1.3.2-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1 + 1.3.2-SNAPSHOT test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index e3159883..71b2f643 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.2-SNAPSHOT pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 660e6f05..856674a4 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.1 + 1.3.2-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.1 + 1.3.2-SNAPSHOT Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From b89ba197384a5790c8b4c9a1af70f808dd382914 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 19 Oct 2023 20:18:12 +0200 Subject: [PATCH 045/172] chore(deps): update all non-major dependencies (#242) --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/conformance.yaml | 4 ++-- .github/workflows/lint.yaml | 6 +++--- .github/workflows/scorecard.yml | 6 +++--- .github/workflows/unit.yaml | 4 ++-- function-maven-plugin/pom.xml | 8 ++++---- functions-framework-api/pom.xml | 2 +- invoker/core/pom.xml | 8 ++++---- invoker/pom.xml | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e9c002ec..a7a71ab5 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: disable-sudo: true egress-policy: block @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 + uses: github/codeql-action/init@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 + uses: github/codeql-action/analyze@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 0edd3720..80704601 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -20,7 +20,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: disable-sudo: true egress-policy: block @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 518c3c3d..bc964f52 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: disable-sudo: true egress-policy: block @@ -22,7 +22,7 @@ jobs: repo.maven.apache.org:443 - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK - uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: java-version: 11.x distribution: temurin @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index dc3c7c0b..ef772cc0 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: disable-sudo: true egress-policy: block @@ -49,7 +49,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 + uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0 with: results_file: results.sarif results_format: sarif @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5 + uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index d88af609..987c4e4f 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 with: disable-sudo: true egress-policy: block @@ -27,7 +27,7 @@ jobs: repo.maven.apache.org:443 - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 20cc5882..c4bd7c6c 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -41,12 +41,12 @@ org.apache.maven maven-plugin-api - 3.9.4 + 3.9.5 org.apache.maven maven-core - 3.9.4 + 3.9.5 org.apache.maven.plugin-tools @@ -64,7 +64,7 @@ com.google.cloud.tools appengine-maven-plugin - 2.4.4 + 2.5.0 jar @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 14a940c3..53dba4d1 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -29,7 +29,7 @@ UTF-8 3.11.0 - 3.5.0 + 3.6.0 5.3.2 diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 0ffdd993..baf0543f 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -98,12 +98,12 @@ org.eclipse.jetty jetty-servlet - 9.4.52.v20230823 + 9.4.53.v20231009 org.eclipse.jetty jetty-server - 9.4.52.v20230823 + 9.4.53.v20231009 com.beust @@ -151,7 +151,7 @@ org.eclipse.jetty jetty-client - 9.4.52.v20230823 + 9.4.53.v20231009 test @@ -174,7 +174,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.0 + 3.5.1 package diff --git a/invoker/pom.xml b/invoker/pom.xml index 71b2f643..68a80e46 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs From e4445930ec3031dc1eff8d2fa872953e553ea517 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 19 Oct 2023 20:19:18 +0200 Subject: [PATCH 046/172] chore(deps): update actions/checkout action to v4 (#243) --- .github/workflows/codeql.yml | 2 +- .github/workflows/conformance.yaml | 2 +- .github/workflows/lint.yaml | 4 ++-- .github/workflows/scorecard.yml | 2 +- .github/workflows/unit.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a7a71ab5..d5bb2684 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,7 +42,7 @@ jobs: uploads.github.com:443 - name: Checkout repository - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 80704601..b53b1c73 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -32,7 +32,7 @@ jobs: repo.maven.apache.org:443 storage.googleapis.com:443 - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index bc964f52..fd5f6262 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,7 +20,7 @@ jobs: allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: @@ -42,7 +42,7 @@ jobs: with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 # v2 minimum required + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index ef772cc0..1fabef33 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -44,7 +44,7 @@ jobs: *.github.com:443 - name: "Checkout code" - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: persist-credentials: false diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 987c4e4f..7a7f63a6 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -25,7 +25,7 @@ jobs: allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 with: From 0f35dea72744f1e60332f2ea18e5cc2535a1b594 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 1 Nov 2023 07:23:42 +0100 Subject: [PATCH 047/172] chore(deps): update all non-major dependencies (#247) --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/scorecard.yml | 4 ++-- function-maven-plugin/pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d5bb2684..d6b2d934 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 + uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 + uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 1fabef33..c8626a6c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -49,7 +49,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@483ef80eb98fb506c348f7d62e28055e49fe2398 # v2.3.0 + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 with: results_file: results.sarif results_format: sarif @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@0116bc2df50751f9724a2e35ef1f24d22f90e4e1 # v2.22.3 + uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 with: sarif_file: results.sarif diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index c4bd7c6c..fff56345 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -51,7 +51,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.9.0 + 3.10.1 provided @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.9.0 + 3.10.1 help-goal From 4c454f40aa5d1266821ee9d9d313a41c4225dd69 Mon Sep 17 00:00:00 2001 From: Gareth Date: Tue, 7 Nov 2023 11:48:14 -0800 Subject: [PATCH 048/172] chore: add test coverage for Java 21 (#227) * chore: add test coverage for Java 21 * allowlist api.adoptium.net:443 --------- Co-authored-by: Kenneth Rosario --- .github/workflows/buildpack-integration-test.yml | 2 +- .github/workflows/conformance.yaml | 4 +--- .github/workflows/unit.yaml | 5 ++++- .../com/google/cloud/functions/invoker/IntegrationTest.java | 4 ++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index 728f5a0f..2c320a6e 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -35,4 +35,4 @@ jobs: prerun: 'invoker/conformance/prerun.sh' builder-runtime: 'java17' builder-runtime-version: '17' - builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest \ No newline at end of file + builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b53b1c73..f997ebd9 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -14,9 +14,7 @@ jobs: strategy: matrix: java: [ - 11.x - # 12.x, - # 13.x + 11.x, ] steps: - name: Harden Runner diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 7a7f63a6..54f15429 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -14,7 +14,8 @@ jobs: matrix: java: [ 11.x, - 17.x + 17.x, + 21-ea ] steps: - name: Harden Runner @@ -25,6 +26,8 @@ jobs: allowed-endpoints: > github.com:443 repo.maven.apache.org:443 + api.adoptium.net:443 + *.githubusercontent.com:443 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index f84ddbdd..3f3de837 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -363,6 +363,10 @@ private static int getJavaVersion() { if (dot != -1) { version = version.substring(0, dot); } + int dash = version.indexOf("-"); + if (dash != -1) { + version = version.substring(0, dash); + } } return Integer.parseInt(version); } From 9518d96d44a3eb227080f76696d9335bb0935006 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Tue, 7 Nov 2023 11:59:43 -0800 Subject: [PATCH 049/172] chore: Update blunderbuss.yml (#252) --- .github/blunderbuss.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 4234009b..45d57ef1 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,9 +1,9 @@ assign_prs: - janell-chen - HKWinterhalter - - garethgeorge + - kenneth-rosario assign_issues: - janell-chen - HKWinterhalter - - garethgeorge + - kenneth-rosario From c704548cc693310137ddcc552c25e27f2762eaf3 Mon Sep 17 00:00:00 2001 From: Andras Kerekes Date: Tue, 2 Jan 2024 12:02:06 -0800 Subject: [PATCH 050/172] Update README.md (#257) fix package and class name for examples --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9b117033..e4c543a4 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ You can configure the plugin in `pom.xml`: function-maven-plugin 0.10.1 - com.example.function.Echo + com.example.HelloWorld ``` @@ -178,7 +178,7 @@ You can alternatively configure the plugin with properties on the command line: ```sh mvn com.google.cloud.functions:function-maven-plugin:0.10.1:run \ - -Drun.functionTarget=com.example.function.Echo + -Drun.functionTarget=com.example.HelloWorld ``` ### Running the Functions Framework directly From fd73d6dfb6f7aef5e0ce7a667c8623ac0854f0b9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 9 Jan 2024 16:50:44 +0100 Subject: [PATCH 051/172] chore(deps): update actions/setup-java action to v4 (#256) Co-authored-by: Kenneth Rosario --- .github/workflows/conformance.yaml | 2 +- .github/workflows/lint.yaml | 2 +- .github/workflows/unit.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index f997ebd9..d559b3da 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index fd5f6262..dea46927 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,7 +22,7 @@ jobs: repo.maven.apache.org:443 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 with: java-version: 11.x distribution: temurin diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 54f15429..19184d88 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -30,7 +30,7 @@ jobs: *.githubusercontent.com:443 - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 with: java-version: ${{ matrix.java }} distribution: temurin From 9756755c319ea9b921e1300998caf2173591d147 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 18 Jan 2024 23:57:32 +0100 Subject: [PATCH 052/172] chore(deps): update dependency com.google.guava:guava to v32 [security] (#253) Co-authored-by: Kenneth Rosario --- invoker/testfunction/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 856674a4..ade019aa 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -31,7 +31,7 @@ com.google.guava guava - 29.0-jre + 32.0.0-android com.google.code.gson From b8b35b5534a5dbea9e9d61fc8055441861d7696b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 00:01:43 +0100 Subject: [PATCH 053/172] chore(deps): update all non-major dependencies (#255) --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/conformance.yaml | 2 +- .github/workflows/lint.yaml | 4 ++-- .github/workflows/scorecard.yml | 4 ++-- .github/workflows/unit.yaml | 2 +- function-maven-plugin/pom.xml | 14 +++++++------- functions-framework-api/pom.xml | 4 ++-- invoker/core/pom.xml | 4 ++-- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d6b2d934..6476579b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: disable-sudo: true egress-policy: block @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 + uses: github/codeql-action/init@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 + uses: github/codeql-action/analyze@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index d559b3da..76965b70 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: disable-sudo: true egress-policy: block diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index dea46927..448eb910 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: disable-sudo: true egress-policy: block @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c8626a6c..f9c7efce 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: disable-sudo: true egress-policy: block @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5 + uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 19184d88..d8c12f2a 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0 + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 with: disable-sudo: true egress-policy: block diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index fff56345..b37754e6 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -41,17 +41,17 @@ org.apache.maven maven-plugin-api - 3.9.5 + 3.9.6 org.apache.maven maven-core - 3.9.5 + 3.9.6 org.apache.maven.plugin-tools maven-plugin-annotations - 3.10.1 + 3.11.0 provided @@ -64,14 +64,14 @@ com.google.cloud.tools appengine-maven-plugin - 2.5.0 + 2.6.0 jar com.google.truth truth - 1.1.5 + 1.2.0 test @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.10.1 + 3.11.0 help-goal @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.0 + 3.6.3 attach-javadocs diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 53dba4d1..01e9d22d 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -28,8 +28,8 @@ UTF-8 - 3.11.0 - 3.6.0 + 3.12.1 + 3.6.3 5.3.2 diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index baf0543f..febfd39c 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -139,13 +139,13 @@ com.google.truth truth - 1.1.5 + 1.2.0 test com.google.truth.extensions truth-java8-extension - 1.1.5 + 1.2.0 test diff --git a/invoker/pom.xml b/invoker/pom.xml index 68a80e46..b9b94e60 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.0 + 3.6.3 attach-javadocs diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index ade019aa..a19349ce 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -31,7 +31,7 @@ com.google.guava guava - 32.0.0-android + 32.1.3-jre com.google.code.gson From 7757265759327c64c9e8a817c2f668906645991c Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 00:09:15 +0100 Subject: [PATCH 054/172] chore(deps): update actions/setup-go action to v5 (#258) Co-authored-by: HKWinterhalter --- .github/workflows/conformance.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 76965b70..b946eeeb 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -39,7 +39,7 @@ jobs: distribution: temurin - name: Setup Go - uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0 + uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 with: go-version: '1.21' From f2d4f89c980a69e3c3bb4005c68ac6acff713702 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 00:16:45 +0100 Subject: [PATCH 055/172] chore(deps): update github/codeql-action action to v3 (#259) Co-authored-by: HKWinterhalter --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/scorecard.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6476579b..d09610e0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 + uses: github/codeql-action/init@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 + uses: github/codeql-action/analyze@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index f9c7efce..d0d20ff2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4759df8df70c5ebe7042c3029bbace20eee13edd # v2.23.1 + uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 with: sarif_file: results.sarif From a9b2a2c69376e987f7034d32ce8401f923948b12 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 19 Jan 2024 00:21:11 +0100 Subject: [PATCH 056/172] chore(deps): update dependency org.mockito:mockito-core to v5 (#250) Co-authored-by: HKWinterhalter --- invoker/core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index febfd39c..c1501eb6 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -122,7 +122,7 @@ org.mockito mockito-core - 3.12.4 + 5.7.0 test From a290d09a1178cb85d8de0061386ba9bcbf1dc9b5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 15:09:48 +0100 Subject: [PATCH 057/172] chore(deps): update all non-major dependencies (#264) --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/conformance.yaml | 2 +- .github/workflows/lint.yaml | 4 ++-- .github/workflows/scorecard.yml | 4 ++-- .github/workflows/unit.yaml | 2 +- function-maven-plugin/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d09610e0..9b2d50ba 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: disable-sudo: true egress-policy: block @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 + uses: github/codeql-action/init@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 + uses: github/codeql-action/analyze@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b946eeeb..a38ab081 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: disable-sudo: true egress-policy: block diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 448eb910..47fdb814 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: disable-sudo: true egress-policy: block @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index d0d20ff2..36390246 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: disable-sudo: true egress-policy: block @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@0b21cf2492b6b02c465a3e5d7c473717ad7721ba # v3.23.1 + uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index d8c12f2a..7e1e91d1 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 + uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 with: disable-sudo: true egress-policy: block diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index b37754e6..e8874a93 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -64,14 +64,14 @@ com.google.cloud.tools appengine-maven-plugin - 2.6.0 + 2.8.0 jar com.google.truth truth - 1.2.0 + 1.4.0 test diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index c1501eb6..dbf10306 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -122,7 +122,7 @@ org.mockito mockito-core - 5.7.0 + 5.10.0 test @@ -139,13 +139,13 @@ com.google.truth truth - 1.2.0 + 1.4.0 test com.google.truth.extensions truth-java8-extension - 1.2.0 + 1.4.0 test From 6e4fb6881529aa9ebd113329a2e0fd271ffa8167 Mon Sep 17 00:00:00 2001 From: Kenneth Rosario Date: Mon, 1 Apr 2024 22:31:47 -0700 Subject: [PATCH 058/172] chore: Update blunderbuss.yml (#269) --- .github/blunderbuss.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 45d57ef1..cafaa0ce 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,9 +1,7 @@ assign_prs: - janell-chen - HKWinterhalter - - kenneth-rosario assign_issues: - janell-chen - HKWinterhalter - - kenneth-rosario From f99decfad7eb050dfbab57a916d9cb57f34b0ad2 Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Sun, 2 Jun 2024 23:59:10 -0700 Subject: [PATCH 059/172] chore: Update blunderbuss.yml (#273) * Update blunderbuss.yml * chore: Update blunderbuss.yml * chore: Update blunderbuss.yml Remove assignees - to be replaced with other mechanism * Update blunderbuss.yml --- .github/blunderbuss.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index cafaa0ce..8b137891 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1,7 +1 @@ -assign_prs: - - janell-chen - - HKWinterhalter -assign_issues: - - janell-chen - - HKWinterhalter From 5a66df34ab06a75c277bab874f23042117f59756 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 01:25:01 +0200 Subject: [PATCH 060/172] chore(deps): update dependency io.cloudevents:cloudevents-json-jackson to v3 (#271) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/conformance/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 56dfcf68..964f3bf9 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -43,7 +43,7 @@ io.cloudevents cloudevents-json-jackson - 2.5.0 + 3.0.0 From 0415a6b123d0e5f1aa5dadc366c1c222b87bd4bb Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 02:10:24 +0200 Subject: [PATCH 061/172] chore(deps): update dependency io.cloudevents:cloudevents-api to v3 (#268) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 01e9d22d..183a6184 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -52,7 +52,7 @@ io.cloudevents cloudevents-api - 2.5.0 + 3.0.0 From a2665683e1ec3df4ae078f60e7fa418ce4d09dd9 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 02:24:13 +0200 Subject: [PATCH 062/172] chore(deps): update dependency com.google.guava:guava to v33 (#266) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/testfunction/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index a19349ce..6958ad2d 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -31,7 +31,7 @@ com.google.guava guava - 32.1.3-jre + 33.2.1-jre com.google.code.gson From e095e1d114d0641c8468cf37469be0125387821f Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 02:27:53 +0200 Subject: [PATCH 063/172] chore(deps): update dependency io.cloudevents:cloudevents-core to v3 (#270) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/conformance/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 964f3bf9..054af20e 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -38,7 +38,7 @@ io.cloudevents cloudevents-core - 2.5.0 + 3.0.0 io.cloudevents From 3fd0521d4999c17ea45ba6ae47a8cea29d9b6ad8 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 02:38:13 +0200 Subject: [PATCH 064/172] chore(deps): update cloudevents.sdk.version to v3 (#267) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index dbf10306..9a879c0c 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -22,7 +22,7 @@ 5.3.2 11 11 - 2.5.0 + 3.0.0 From 8d44947c7524cca045906aa444bc3eb48bbbff85 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 02:58:19 +0200 Subject: [PATCH 065/172] chore(deps): update all non-major dependencies (#265) * chore(deps): update all non-major dependencies * remove all references to truth8 --------- Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Co-authored-by: Jeremy Fehr --- .github/workflows/codeql.yml | 8 +++---- .github/workflows/conformance.yaml | 8 +++---- .github/workflows/lint.yaml | 10 ++++----- .github/workflows/scorecard.yml | 8 +++---- .github/workflows/unit.yaml | 6 ++--- function-maven-plugin/pom.xml | 18 +++++++-------- functions-framework-api/pom.xml | 12 +++++----- invoker/conformance/pom.xml | 2 +- invoker/core/pom.xml | 22 +++++++++---------- .../BackgroundFunctionExecutorTest.java | 1 - .../invoker/TypedFunctionExecutorTest.java | 1 - .../functions/invoker/http/HttpTest.java | 1 - .../functions/invoker/runner/InvokerTest.java | 1 - invoker/pom.xml | 8 +++---- invoker/testfunction/pom.xml | 6 ++--- 15 files changed, 54 insertions(+), 58 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 9b2d50ba..a974e193 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block @@ -42,11 +42,11 @@ jobs: uploads.github.com:443 - name: Checkout repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 + uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 + uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index a38ab081..c914263e 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block @@ -30,16 +30,16 @@ jobs: repo.maven.apache.org:443 storage.googleapis.com:443 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: ${{ matrix.java }} distribution: temurin - name: Setup Go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version: '1.21' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 47fdb814..a712703e 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,16 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up JDK - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: 11.x distribution: temurin @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 # v2 minimum required + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 36390246..728eb127 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block @@ -44,12 +44,12 @@ jobs: *.github.com:443 - name: "Checkout code" - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1 + uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 with: results_file: results.sarif results_format: sarif @@ -61,6 +61,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@e8893c57a1f3a2b659b6b55564fdfdbbd2982911 # v3.24.0 + uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 7e1e91d1..64821a08 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 + uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 with: disable-sudo: true egress-policy: block @@ -28,9 +28,9 @@ jobs: repo.maven.apache.org:443 api.adoptium.net:443 *.githubusercontent.com:443 - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index e8874a93..ac6c3552 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -41,17 +41,17 @@ org.apache.maven maven-plugin-api - 3.9.6 + 3.9.8 org.apache.maven maven-core - 3.9.6 + 3.9.8 org.apache.maven.plugin-tools maven-plugin-annotations - 3.11.0 + 3.13.1 provided @@ -71,7 +71,7 @@ com.google.truth truth - 1.4.0 + 1.4.2 test @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.11.0 + 3.13.1 help-goal @@ -119,7 +119,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -145,7 +145,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.4 sign-artifacts @@ -159,7 +159,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-snapshots diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 183a6184..b9fec533 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -28,8 +28,8 @@ UTF-8 - 3.12.1 - 3.6.3 + 3.13.0 + 3.7.0 5.3.2 @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.1 + 3.1.0 default @@ -177,7 +177,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.4 sign-artifacts @@ -191,7 +191,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-snapshots diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 054af20e..a4c6820e 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -33,7 +33,7 @@ com.google.code.gson gson - 2.10.1 + 2.11.0 io.cloudevents diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 9a879c0c..7351b402 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -69,7 +69,7 @@ com.google.code.gson gson - 2.10.1 + 2.11.0 com.ryanharter.auto.value @@ -86,24 +86,24 @@ com.google.auto.value auto-value - 1.10.4 + 1.11.0 provided com.google.auto.value auto-value-annotations - 1.10.4 + 1.11.0 provided org.eclipse.jetty jetty-servlet - 9.4.53.v20231009 + 9.4.54.v20240208 org.eclipse.jetty jetty-server - 9.4.53.v20231009 + 9.4.54.v20240208 com.beust @@ -122,7 +122,7 @@ org.mockito mockito-core - 5.10.0 + 5.12.0 test @@ -139,19 +139,19 @@ com.google.truth truth - 1.4.0 + 1.4.2 test com.google.truth.extensions truth-java8-extension - 1.4.0 + 1.4.2 test org.eclipse.jetty jetty-client - 9.4.53.v20231009 + 9.4.54.v20240208 test @@ -160,7 +160,7 @@ maven-jar-plugin - 3.3.0 + 3.4.2 @@ -174,7 +174,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.5.1 + 3.6.0 package diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java index 2b7211c9..87b9bd31 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutorTest.java @@ -2,7 +2,6 @@ import static com.google.cloud.functions.invoker.BackgroundFunctionExecutor.backgroundFunctionTypeArgument; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import com.google.cloud.functions.BackgroundFunction; import com.google.cloud.functions.Context; diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java index 969d1dcc..668d60c8 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/TypedFunctionExecutorTest.java @@ -1,7 +1,6 @@ package com.google.cloud.functions.invoker; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import com.google.cloud.functions.TypedFunction; import org.junit.Test; diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/http/HttpTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/http/HttpTest.java index e52ec62a..e0ca4675 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/http/HttpTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/http/HttpTest.java @@ -15,7 +15,6 @@ package com.google.cloud.functions.invoker.http; import static com.google.common.truth.Truth.assertThat; -import static com.google.common.truth.Truth8.assertThat; import static org.junit.Assert.fail; import com.google.cloud.functions.HttpRequest; diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/runner/InvokerTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/runner/InvokerTest.java index b3569e4e..c1a7ca29 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/runner/InvokerTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/runner/InvokerTest.java @@ -2,7 +2,6 @@ import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertWithMessage; -import static com.google.common.truth.Truth8.assertThat; import static java.util.stream.Collectors.joining; import java.io.ByteArrayOutputStream; diff --git a/invoker/pom.xml b/invoker/pom.xml index b9b94e60..f23ff693 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -67,7 +67,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.3 + 3.7.0 attach-javadocs @@ -93,7 +93,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.4 sign-artifacts @@ -107,7 +107,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.13 + 1.7.0 true sonatype-nexus-snapshots diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 6958ad2d..7160841b 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -36,7 +36,7 @@ com.google.code.gson gson - 2.10.1 + 2.11.0 @@ -44,7 +44,7 @@ maven-jar-plugin - 3.3.0 + 3.4.2 @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.1 + 3.1.2 true From c3a3161204707e0952e0de9df53044bcf42d893b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 21 Jun 2024 03:08:21 +0200 Subject: [PATCH 066/172] chore(deps): update googlecloudplatform/functions-framework-conformance digest to 1041a97 (#263) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- .github/workflows/conformance.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index c914263e..b58ae762 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -53,7 +53,7 @@ jobs: run: (cd function-maven-plugin/ && mvn install) - name: Run HTTP conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main + uses: GoogleCloudPlatform/functions-framework-conformance/action@1041a97e93a463d9efb17dda821f3ddc0bf0024f # main with: functionType: 'http' useBuildpacks: false @@ -61,7 +61,7 @@ jobs: startDelay: 10 - name: Run Typed conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main + uses: GoogleCloudPlatform/functions-framework-conformance/action@1041a97e93a463d9efb17dda821f3ddc0bf0024f # main with: functionType: 'http' declarativeType: 'typed' @@ -70,7 +70,7 @@ jobs: startDelay: 10 - name: Run background event conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main + uses: GoogleCloudPlatform/functions-framework-conformance/action@1041a97e93a463d9efb17dda821f3ddc0bf0024f # main with: functionType: 'legacyevent' useBuildpacks: false @@ -79,7 +79,7 @@ jobs: startDelay: 10 - name: Run cloudevent conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main + uses: GoogleCloudPlatform/functions-framework-conformance/action@1041a97e93a463d9efb17dda821f3ddc0bf0024f # main with: functionType: 'cloudevent' useBuildpacks: false @@ -88,7 +88,7 @@ jobs: startDelay: 10 - name: Run HTTP concurrency conformance tests - uses: GoogleCloudPlatform/functions-framework-conformance/action@72a4f36b10f1c6435ab1a86a9ea24bda464cc262 # main + uses: GoogleCloudPlatform/functions-framework-conformance/action@1041a97e93a463d9efb17dda821f3ddc0bf0024f # main with: functionType: 'http' useBuildpacks: false From 2e823c62876b3b26b1e9704b47cf852e2e32e2e0 Mon Sep 17 00:00:00 2001 From: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Date: Thu, 27 Jun 2024 08:49:26 -0700 Subject: [PATCH 067/172] fix: update scorecard.yml (#276) --- .github/workflows/scorecard.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 728eb127..74ce67bb 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -32,6 +32,7 @@ jobs: egress-policy: block allowed-endpoints: > api.osv.dev:443 + api.scorecard.dev:443 api.securityscorecards.dev:443 auth.docker.io:443 bestpractices.coreinfrastructure.org:443 From 7e4ca5d15d5b200787b999f82da6d6cd1cbd4b7e Mon Sep 17 00:00:00 2001 From: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:02:37 -0700 Subject: [PATCH 068/172] fix: release 1.1.1 (#277) Release-As: 1.1.1 --- functions-framework-api/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/functions-framework-api/CHANGELOG.md b/functions-framework-api/CHANGELOG.md index 1ab28e74..469c198b 100644 --- a/functions-framework-api/CHANGELOG.md +++ b/functions-framework-api/CHANGELOG.md @@ -11,3 +11,4 @@ ### Bug Fixes * remove warnings from mvn install ([#66](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/66)) ([270f4ec](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/270f4ec7936239eff9c00b8d3ff0f09a8615b9c9)) + From cb4d76dd384d076f66c10fa5fdb151e556369cd7 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:30:18 -0700 Subject: [PATCH 069/172] chore(main): release functions-framework-api 1.1.1 (#278) * chore(main): release functions-framework-api 1.1.1 * Update CHANGELOG.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- functions-framework-api/CHANGELOG.md | 8 +++++++- functions-framework-api/pom.xml | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index c2ee81e0..efcd0568 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.0","invoker":"1.3.1","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.1","invoker":"1.3.1","function-maven-plugin":"0.11.0"} diff --git a/functions-framework-api/CHANGELOG.md b/functions-framework-api/CHANGELOG.md index 469c198b..e999fd1d 100644 --- a/functions-framework-api/CHANGELOG.md +++ b/functions-framework-api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.0...functions-framework-api-v1.1.1) (2024-06-27) + + +### Bug Fixes + +* release 1.1.1; this updates transitive dependencies on jackson ([#277](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/277)) ([7e4ca5d](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/7e4ca5d15d5b200787b999f82da6d6cd1cbd4b7e)) + ## [1.1.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.0.4...functions-framework-api-v1.1.0) (2023-05-31) @@ -11,4 +18,3 @@ ### Bug Fixes * remove warnings from mvn install ([#66](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/66)) ([270f4ec](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/270f4ec7936239eff9c00b8d3ff0f09a8615b9c9)) - diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index b9fec533..576df30c 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.1-SNAPSHOT + 1.1.1 UTF-8 From dc9bc1f03c90a60e8007bc4f61f78ade61d97817 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 13:52:52 -0700 Subject: [PATCH 070/172] chore(main): release functions-framework-api 1.1.2-SNAPSHOT (#279) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 576df30c..7c08e00f 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.1 + 1.1.2-SNAPSHOT UTF-8 From 9e91f57b12d73c655e3d7e226d21d54ccec32b73 Mon Sep 17 00:00:00 2001 From: janell-chen <122311137+janell-chen@users.noreply.github.com> Date: Mon, 8 Jul 2024 11:01:21 -0700 Subject: [PATCH 071/172] fix: server times out when specified by CLOUD_RUN_TIMEOUT_SECONDS (#275) * fix: server times out when specified by CLOUD_RUN_TIMEOUT_SECONDS --- .../functions/invoker/http/TimeoutFilter.java | 71 +++++++++++++++++++ .../functions/invoker/runner/Invoker.java | 17 +++++ .../functions/invoker/IntegrationTest.java | 71 +++++++++++++++---- .../invoker/testfunctions/TimeoutHttp.java | 18 +++++ 4 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 invoker/core/src/main/java/com/google/cloud/functions/invoker/http/TimeoutFilter.java create mode 100644 invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TimeoutHttp.java diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/TimeoutFilter.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/TimeoutFilter.java new file mode 100644 index 00000000..e0577f9b --- /dev/null +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/http/TimeoutFilter.java @@ -0,0 +1,71 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.cloud.functions.invoker.http; + +import java.io.IOException; +import java.util.Timer; +import java.util.TimerTask; +import java.util.logging.Logger; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletResponse; + +public class TimeoutFilter implements Filter { + + private static final Logger logger = Logger.getLogger(TimeoutFilter.class.getName()); + private final int timeoutMs; + + public TimeoutFilter(int timeoutSeconds) { + this.timeoutMs = timeoutSeconds * 1000; // Convert seconds to milliseconds + } + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + Timer timer = new Timer(true); + TimerTask timeoutTask = + new TimerTask() { + @Override + public void run() { + if (response instanceof HttpServletResponse) { + try { + ((HttpServletResponse) response) + .sendError(HttpServletResponse.SC_REQUEST_TIMEOUT, "Request timed out"); + } catch (IOException e) { + logger.warning("Error while sending HTTP response: " + e.toString()); + } + } else { + try { + response.getWriter().write("Request timed out"); + } catch (IOException e) { + logger.warning("Error while writing response: " + e.toString()); + } + } + } + }; + + timer.schedule(timeoutTask, timeoutMs); + + try { + chain.doFilter(request, response); + timeoutTask.cancel(); + } finally { + timer.purge(); + } + } +} diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java index 892d6038..da5e72ec 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/runner/Invoker.java @@ -25,6 +25,7 @@ import com.google.cloud.functions.invoker.HttpFunctionExecutor; import com.google.cloud.functions.invoker.TypedFunctionExecutor; import com.google.cloud.functions.invoker.gcf.JsonLogHandler; +import com.google.cloud.functions.invoker.http.TimeoutFilter; import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; @@ -38,6 +39,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.EnumSet; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -48,6 +50,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Stream; +import javax.servlet.DispatcherType; import javax.servlet.MultipartConfigElement; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -59,6 +62,7 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.HandlerWrapper; +import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.util.thread.QueuedThreadPool; @@ -324,6 +328,7 @@ private void startServer(boolean join) throws Exception { ServletHolder servletHolder = new ServletHolder(servlet); servletHolder.getRegistration().setMultipartConfig(new MultipartConfigElement("")); servletContextHandler.addServlet(servletHolder, "/*"); + servletContextHandler = addTimerFilterForRequestTimeout(servletContextHandler); server.start(); logServerInfo(); @@ -393,6 +398,18 @@ private HttpServlet servletForDeducedSignatureType(Class functionClass) { throw new RuntimeException(error); } + private ServletContextHandler addTimerFilterForRequestTimeout( + ServletContextHandler servletContextHandler) { + String timeoutSeconds = System.getenv("CLOUD_RUN_TIMEOUT_SECONDS"); + if (timeoutSeconds == null) { + return servletContextHandler; + } + int seconds = Integer.parseInt(timeoutSeconds); + FilterHolder holder = new FilterHolder(new TimeoutFilter(seconds)); + servletContextHandler.addFilter(holder, "/*", EnumSet.of(DispatcherType.REQUEST)); + return servletContextHandler; + } + static URL[] classpathToUrls(String classpath) { String[] components = classpath.split(File.pathSeparator); List urls = new ArrayList<>(); diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index 3f3de837..82197547 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -51,6 +51,7 @@ import java.time.OffsetDateTime; import java.time.ZoneOffset; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; @@ -252,6 +253,34 @@ public void helloWorld() throws Exception { ROBOTS_TXT_TEST_CASE)); } + @Test + public void timeoutHttpSuccess() throws Exception { + testFunction( + SignatureType.HTTP, + fullTarget("TimeoutHttp"), + ImmutableList.of(), + ImmutableList.of( + TestCase.builder() + .setExpectedResponseText("finished\n") + .setExpectedResponseText(Optional.empty()) + .build()), + ImmutableMap.of("CLOUD_RUN_TIMEOUT_SECONDS", "3")); + } + + @Test + public void timeoutHttpTimesOut() throws Exception { + testFunction( + SignatureType.HTTP, + fullTarget("TimeoutHttp"), + ImmutableList.of(), + ImmutableList.of( + TestCase.builder() + .setExpectedResponseCode(408) + .setExpectedResponseText(Optional.empty()) + .build()), + ImmutableMap.of("CLOUD_RUN_TIMEOUT_SECONDS", "1")); + } + @Test public void exceptionHttp() throws Exception { String exceptionExpectedOutput = @@ -290,7 +319,8 @@ public void exceptionBackground() throws Exception { .setRequestText(gcfRequestText) .setExpectedResponseCode(500) .setExpectedOutput(exceptionExpectedOutput) - .build())); + .build()), + Collections.emptyMap()); } @Test @@ -400,7 +430,8 @@ public void typedFunction() throws Exception { TestCase.builder() .setRequestText(originalJson) .setExpectedResponseText("{\"fullName\":\"JohnDoe\"}") - .build())); + .build()), + Collections.emptyMap()); } @Test @@ -410,7 +441,8 @@ public void typedVoidFunction() throws Exception { fullTarget("TypedVoid"), ImmutableList.of(), ImmutableList.of( - TestCase.builder().setRequestText("{}").setExpectedResponseCode(204).build())); + TestCase.builder().setRequestText("{}").setExpectedResponseCode(204).build()), + Collections.emptyMap()); } @Test @@ -424,7 +456,8 @@ public void typedCustomFormat() throws Exception { .setRequestText("abc\n123\n$#@\n") .setExpectedResponseText("abc123$#@") .setExpectedResponseCode(200) - .build())); + .build()), + Collections.emptyMap()); } private void backgroundTest(String target) throws Exception { @@ -595,7 +628,8 @@ public void classpathOptionHttp() throws Exception { SignatureType.HTTP, "com.example.functionjar.Foreground", ImmutableList.of("--classpath", functionJarString()), - ImmutableList.of(testCase)); + ImmutableList.of(testCase), + Collections.emptyMap()); } /** Like {@link #classpathOptionHttp} but for background functions. */ @@ -612,7 +646,8 @@ public void classpathOptionBackground() throws Exception { SignatureType.BACKGROUND, "com.example.functionjar.Background", ImmutableList.of("--classpath", functionJarString()), - ImmutableList.of(TestCase.builder().setRequestText(json.toString()).build())); + ImmutableList.of(TestCase.builder().setRequestText(json.toString()).build()), + Collections.emptyMap()); } /** Like {@link #classpathOptionHttp} but for typed functions. */ @@ -629,7 +664,8 @@ public void classpathOptionTyped() throws Exception { TestCase.builder() .setRequestText(originalJson) .setExpectedResponseText("{\"fullName\":\"JohnDoe\"}") - .build())); + .build()), + Collections.emptyMap()); } // In these tests, we test a number of different functions that express the same functionality @@ -643,7 +679,12 @@ private void backgroundTest( for (TestCase testCase : testCases) { File snoopFile = testCase.snoopFile().get(); snoopFile.delete(); - testFunction(signatureType, functionTarget, ImmutableList.of(), ImmutableList.of(testCase)); + testFunction( + signatureType, + functionTarget, + ImmutableList.of(), + ImmutableList.of(testCase), + Collections.emptyMap()); String snooped = new String(Files.readAllBytes(snoopFile.toPath()), StandardCharsets.UTF_8); Gson gson = new Gson(); JsonObject snoopedJson = gson.fromJson(snooped, JsonObject.class); @@ -667,16 +708,18 @@ private void checkSnoopFile(TestCase testCase) throws IOException { } private void testHttpFunction(String target, List testCases) throws Exception { - testFunction(SignatureType.HTTP, target, ImmutableList.of(), testCases); + testFunction(SignatureType.HTTP, target, ImmutableList.of(), testCases, Collections.emptyMap()); } private void testFunction( SignatureType signatureType, String target, ImmutableList extraArgs, - List testCases) + List testCases, + Map environmentVariables) throws Exception { - ServerProcess serverProcess = startServer(signatureType, target, extraArgs); + ServerProcess serverProcess = + startServer(signatureType, target, extraArgs, environmentVariables); try { HttpClient httpClient = new HttpClient(); httpClient.start(); @@ -772,7 +815,10 @@ public void close() { } private ServerProcess startServer( - SignatureType signatureType, String target, ImmutableList extraArgs) + SignatureType signatureType, + String target, + ImmutableList extraArgs, + Map environmentVariables) throws IOException, InterruptedException { File javaHome = new File(System.getProperty("java.home")); assertThat(javaHome.exists()).isTrue(); @@ -798,6 +844,7 @@ private ServerProcess startServer( "FUNCTION_TARGET", target); processBuilder.environment().putAll(environment); + processBuilder.environment().putAll(environmentVariables); Process serverProcess = processBuilder.start(); CountDownLatch ready = new CountDownLatch(1); StringBuilder output = new StringBuilder(); diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TimeoutHttp.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TimeoutHttp.java new file mode 100644 index 00000000..c73e52d2 --- /dev/null +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/testfunctions/TimeoutHttp.java @@ -0,0 +1,18 @@ +package com.google.cloud.functions.invoker.testfunctions; + +import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.HttpRequest; +import com.google.cloud.functions.HttpResponse; + +public class TimeoutHttp implements HttpFunction { + + @Override + public void service(HttpRequest request, HttpResponse response) throws Exception { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + response.getWriter().close(); + } + response.getWriter().write("finished\n"); + } +} From b7a5d05f4ee362508a546c906bfa1a3c44d93d7f Mon Sep 17 00:00:00 2001 From: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Date: Wed, 18 Sep 2024 09:00:38 -0700 Subject: [PATCH 072/172] chore: Update blunderbuss.yml (#286) --- .github/blunderbuss.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 8b137891..2dfa51ed 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -1 +1,10 @@ +assign_prs: + - HKwinterhalter + - dixuswe + - janell-chen +assign_issues: + - HKwinterhalter + - dixuswe + - janell-chen + From 023ceff31315e324a38a1782e5d7fcae6b00131d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 28 Sep 2024 01:10:22 +0200 Subject: [PATCH 073/172] chore(deps): update dependency io.cloudevents:cloudevents-json-jackson to v4 (#285) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/conformance/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index a4c6820e..4ff8fa05 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -43,7 +43,7 @@ io.cloudevents cloudevents-json-jackson - 3.0.0 + 4.0.1 From fe6da26cd9af4ceb0efab92609fcae5921720525 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 28 Sep 2024 01:10:32 +0200 Subject: [PATCH 074/172] chore(deps): update cloudevents.sdk.version to v4 (#282) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/core/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 7351b402..64e2fe24 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -22,7 +22,7 @@ 5.3.2 11 11 - 3.0.0 + 4.0.1 From fd33779cc8633a3d09ecee99ca20a624f0efc676 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 28 Sep 2024 01:10:42 +0200 Subject: [PATCH 075/172] chore(deps): update dependency io.cloudevents:cloudevents-core to v4 (#284) Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- invoker/conformance/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 4ff8fa05..d94dbf8a 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -38,7 +38,7 @@ io.cloudevents cloudevents-core - 3.0.0 + 4.0.1 io.cloudevents From 744996348029857d7054753b83a62f172e8fa5e5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 28 Sep 2024 01:11:10 +0200 Subject: [PATCH 076/172] chore(deps): update all non-major dependencies (#280) --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/conformance.yaml | 8 ++++---- .github/workflows/lint.yaml | 10 +++++----- .github/workflows/scorecard.yml | 8 ++++---- .github/workflows/unit.yaml | 6 +++--- function-maven-plugin/pom.xml | 16 ++++++++-------- functions-framework-api/pom.xml | 6 +++--- invoker/core/pom.xml | 12 ++++++------ invoker/pom.xml | 4 ++-- invoker/testfunction/pom.xml | 4 ++-- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a974e193..518a5853 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: disable-sudo: true egress-policy: block @@ -42,11 +42,11 @@ jobs: uploads.github.com:443 - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index b58ae762..1745c330 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: disable-sudo: true egress-policy: block @@ -30,16 +30,16 @@ jobs: repo.maven.apache.org:443 storage.googleapis.com:443 - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 with: java-version: ${{ matrix.java }} distribution: temurin - name: Setup Go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version: '1.21' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index a712703e..7b32858c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,16 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up JDK - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 with: java-version: 11.x distribution: temurin @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 # v2 minimum required + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 74ce67bb..c90435f2 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: disable-sudo: true egress-policy: block @@ -45,12 +45,12 @@ jobs: *.github.com:443 - name: "Checkout code" - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3 + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 with: results_file: results.sarif results_format: sarif @@ -62,6 +62,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 + uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 64821a08..c970fd3e 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: disable-sudo: true egress-policy: block @@ -28,9 +28,9 @@ jobs: repo.maven.apache.org:443 api.adoptium.net:443 *.githubusercontent.com:443 - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 + uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index ac6c3552..bab9524c 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -41,17 +41,17 @@ org.apache.maven maven-plugin-api - 3.9.8 + 3.9.9 org.apache.maven maven-core - 3.9.8 + 3.9.9 org.apache.maven.plugin-tools maven-plugin-annotations - 3.13.1 + 3.15.0 provided @@ -64,14 +64,14 @@ com.google.cloud.tools appengine-maven-plugin - 2.8.0 + 2.8.1 jar com.google.truth truth - 1.4.2 + 1.4.4 test @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.13.1 + 3.15.0 help-goal @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.7.0 + 3.10.0 attach-javadocs @@ -145,7 +145,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.7 sign-artifacts diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 7c08e00f..603b7c72 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -29,7 +29,7 @@ UTF-8 3.13.0 - 3.7.0 + 3.10.0 5.3.2 @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-release-plugin - 3.1.0 + 3.1.1 default @@ -177,7 +177,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.7 sign-artifacts diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 64e2fe24..4202e33c 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -98,12 +98,12 @@ org.eclipse.jetty jetty-servlet - 9.4.54.v20240208 + 9.4.56.v20240826 org.eclipse.jetty jetty-server - 9.4.54.v20240208 + 9.4.56.v20240826 com.beust @@ -122,7 +122,7 @@ org.mockito mockito-core - 5.12.0 + 5.14.0 test @@ -139,19 +139,19 @@ com.google.truth truth - 1.4.2 + 1.4.4 test com.google.truth.extensions truth-java8-extension - 1.4.2 + 1.4.4 test org.eclipse.jetty jetty-client - 9.4.54.v20240208 + 9.4.56.v20240826 test diff --git a/invoker/pom.xml b/invoker/pom.xml index f23ff693..c0432cf8 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.7.0 + 3.10.0 attach-javadocs @@ -93,7 +93,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.7 sign-artifacts diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 7160841b..c90f121f 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -31,7 +31,7 @@ com.google.guava guava - 33.2.1-jre + 33.3.1-jre com.google.code.gson @@ -86,7 +86,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.2 + 3.1.3 true From 34b763ef9bc68b962876fc47be4885354a0a5ca1 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 28 Sep 2024 01:14:22 +0200 Subject: [PATCH 077/172] chore(deps): update dependency io.cloudevents:cloudevents-api to v4 (#283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.cloudevents:cloudevents-api](https://cloudevents.github.io/sdk-java/) ([source](https://redirect.github.com/cloudevents/sdk-java)) | `3.0.0` -> `4.0.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.cloudevents:cloudevents-api/4.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.cloudevents:cloudevents-api/4.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.cloudevents:cloudevents-api/3.0.0/4.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.cloudevents:cloudevents-api/3.0.0/4.0.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the warning logs for more information. --- ### Release Notes

cloudevents/sdk-java (io.cloudevents:cloudevents-api) ### [`v4.0.1`](https://redirect.github.com/cloudevents/sdk-java/releases/tag/v4.0.1) [Compare Source](https://redirect.github.com/cloudevents/sdk-java/compare/v4.0.0...v4.0.1) #### What's Changed - \[4.0] Make CloudEventValidatorProvider thread safe ([#​650](https://redirect.github.com/cloudevents/sdk-java/issues/650)) by [@​pierDipi](https://redirect.github.com/pierDipi) in [https://togithub.com/cloudevents/sdk-java/pull/651](https://redirect.github.com/cloudevents/sdk-java/pull/651) **Full Changelog**: https://togithub.com/cloudevents/sdk-java/compare/v4.0.0...v4.0.1 ### [`v4.0.0`](https://redirect.github.com/cloudevents/sdk-java/releases/tag/v4.0.0) [Compare Source](https://redirect.github.com/cloudevents/sdk-java/compare/3.0.0...v4.0.0) #### What's Changed - Support CloudEvents SQL v1 (CE SQL) by [@​Cali0707](https://redirect.github.com/Cali0707) in [https://togithub.com/cloudevents/sdk-java/pull/641](https://redirect.github.com/cloudevents/sdk-java/pull/641) - doc: update & uniformize package version by [@​BoboTiG](https://redirect.github.com/BoboTiG) in [https://togithub.com/cloudevents/sdk-java/pull/640](https://redirect.github.com/cloudevents/sdk-java/pull/640) - fix: invalid automatic module name by [@​Jummartinezro](https://redirect.github.com/Jummartinezro) in [https://togithub.com/cloudevents/sdk-java/pull/639](https://redirect.github.com/cloudevents/sdk-java/pull/639) - Bump io.vertx:vertx-core from 4.3.7 to 4.5.3 in /http/vertx by [@​dependabot](https://redirect.github.com/dependabot) in [https://togithub.com/cloudevents/sdk-java/pull/622](https://redirect.github.com/cloudevents/sdk-java/pull/622) - Bump nokogiri from 1.16.3 to 1.16.5 in /docs by [@​dependabot](https://redirect.github.com/dependabot) in [https://togithub.com/cloudevents/sdk-java/pull/632](https://redirect.github.com/cloudevents/sdk-java/pull/632) - Bump org.xmlunit:xmlunit-core from 2.9.0 to 2.10.0 in /formats/xml by [@​dependabot](https://redirect.github.com/dependabot) in [https://togithub.com/cloudevents/sdk-java/pull/631](https://redirect.github.com/cloudevents/sdk-java/pull/631) #### New Contributors - [@​BoboTiG](https://redirect.github.com/BoboTiG) made their first contribution in [https://togithub.com/cloudevents/sdk-java/pull/640](https://redirect.github.com/cloudevents/sdk-java/pull/640) - [@​Jummartinezro](https://redirect.github.com/Jummartinezro) made their first contribution in [https://togithub.com/cloudevents/sdk-java/pull/639](https://redirect.github.com/cloudevents/sdk-java/pull/639) **Full Changelog**: https://togithub.com/cloudevents/sdk-java/compare/3.0.0...v4.0.0
--- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/GoogleCloudPlatform/functions-framework-java). --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 603b7c72..3b87a18d 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -52,7 +52,7 @@ io.cloudevents cloudevents-api - 3.0.0 + 4.0.1 From f8c1d575660312101532a1f579c0492593248f37 Mon Sep 17 00:00:00 2001 From: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:18:22 -0700 Subject: [PATCH 078/172] fix: use a version of maven-source-plugin that's available in mavencentral (#288) --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 3b87a18d..31d5c735 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -151,7 +151,7 @@ org.apache.maven.plugins maven-source-plugin - 3.6.0 + 3.3.1 attach-sources From f82b70174513edf3e21752aa4739e3b6636e0604 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:31:42 -0700 Subject: [PATCH 079/172] chore(main): release java-function-invoker 1.3.2 (#240) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- invoker/CHANGELOG.md | 9 +++++++++ invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index efcd0568..3c2d06fd 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.1","invoker":"1.3.1","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.1","invoker":"1.3.2","function-maven-plugin":"0.11.0"} diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index 2800c114..c9661841 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [1.3.2](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.1...java-function-invoker-v1.3.2) (2024-09-18) + + +### Bug Fixes + +* avoid executing function when /favicon.ico or /robots.txt is called ([#226](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/226)) ([fca8676](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/fca867667db593699193da01b69a4cca7ca48fc8)) +* server times out when specified by CLOUD_RUN_TIMEOUT_SECONDS ([#275](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/275)) ([9e91f57](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/9e91f57b12d73c655e3d7e226d21d54ccec32b73)) +* set Thread Context ClassLoader correctly when invoking handler constructor ([#239](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/239)) ([9f7155b](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/9f7155b77574ec980ecf9e6dffbd2ee0398db8a7)) + ## [1.3.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.0...java-function-invoker-v1.3.1) (2023-09-13) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index d94dbf8a..d4f41397 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.2-SNAPSHOT + 1.3.2 com.google.cloud.functions.invoker conformance - 1.3.2-SNAPSHOT + 1.3.2 GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 4202e33c..b2de93e5 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2-SNAPSHOT + 1.3.2 com.google.cloud.functions.invoker java-function-invoker - 1.3.2-SNAPSHOT + 1.3.2 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.2-SNAPSHOT + 1.3.2 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index c0432cf8..6b61101a 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2-SNAPSHOT + 1.3.2 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index c90f121f..152d8f94 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2-SNAPSHOT + 1.3.2 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.2-SNAPSHOT + 1.3.2 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From ec709f645c92a48a4db887b3b3ccd6d1354c7b4b Mon Sep 17 00:00:00 2001 From: Jeremy Fehr <117788025+jrmfg@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:47:44 -0700 Subject: [PATCH 080/172] fix: update readme with newer versions (and release 1.1.2) (#289) --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e4c543a4..4b4da494 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ that supports Maven to create the Maven project. Add this dependency in the com.google.cloud.functions functions-framework-api - 1.0.4 + 1.1.2 provided ``` @@ -51,7 +51,7 @@ Framework dependency in your `build.gradle` project file as follows: ```groovy dependencies { - implementation 'com.google.cloud.functions:functions-framework-api:1.0.4' + implementation 'com.google.cloud.functions:functions-framework-api:1.1.2' } ``` @@ -188,7 +188,7 @@ Copy the Functions Framework jar to a local location like this: ```sh mvn dependency:copy \ - -Dartifact='com.google.cloud.functions.invoker:java-function-invoker:1.1.1' \ + -Dartifact='com.google.cloud.functions.invoker:java-function-invoker:1.3.2' \ -DoutputDirectory=. ``` @@ -196,7 +196,7 @@ In this example we use the current directory `.` but you can specify any other directory to copy to. Then run your function: ```sh -java -jar java-function-invoker-1.1.1 \ +java -jar java-function-invoker-1.3.2 \ --classpath myfunction.jar \ --target com.example.HelloWorld ``` @@ -215,8 +215,8 @@ configurations { } dependencies { - implementation 'com.google.cloud.functions:functions-framework-api:1.0.4' - invoker 'com.google.cloud.functions.invoker:java-function-invoker:1.1.1' + implementation 'com.google.cloud.functions:functions-framework-api:1.1.2' + invoker 'com.google.cloud.functions.invoker:java-function-invoker:1.3.2' } tasks.register("runFunction", JavaExec) { @@ -289,7 +289,7 @@ Framework directly, you must use `--classpath` to indicate how to find the code and its dependencies. For example: ``` -java -jar java-function-invoker-1.1.1 \ +java -jar java-function-invoker-1.3.2 \ --classpath 'myfunction.jar:/some/directory:/some/library/*' \ --target com.example.HelloWorld ``` From 478e5834d93d595f5650bf46909ad86945d20578 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:02:26 -0700 Subject: [PATCH 081/172] chore(main): release functions-framework-api 1.1.2 (#290) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- functions-framework-api/CHANGELOG.md | 7 +++++++ functions-framework-api/pom.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 3c2d06fd..85061204 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.1","invoker":"1.3.2","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.2","invoker":"1.3.2","function-maven-plugin":"0.11.0"} diff --git a/functions-framework-api/CHANGELOG.md b/functions-framework-api/CHANGELOG.md index e999fd1d..7b57f5b6 100644 --- a/functions-framework-api/CHANGELOG.md +++ b/functions-framework-api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.2](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.1...functions-framework-api-v1.1.2) (2024-09-27) + + +### Bug Fixes + +* use a version of maven-source-plugin that's available in mavencentral ([#288](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/288)) ([f8c1d57](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/f8c1d575660312101532a1f579c0492593248f37)) + ## [1.1.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.0...functions-framework-api-v1.1.1) (2024-06-27) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 31d5c735..bd040f3f 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.2-SNAPSHOT + 1.1.2 UTF-8 From b199dcb587c390ef00ff40be60d4d2f45a88c222 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:03:23 -0700 Subject: [PATCH 082/172] chore(main): release java-function-invoker 1.3.3-SNAPSHOT (#291) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index d4f41397..f2ffd4ec 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.2 + 1.3.3-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.3.2 + 1.3.3-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index b2de93e5..ab455d4a 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2 + 1.3.3-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.3.2 + 1.3.3-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.2 + 1.3.3-SNAPSHOT test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 6b61101a..ff2966e1 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2 + 1.3.3-SNAPSHOT pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 152d8f94..2713b478 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.2 + 1.3.3-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.2 + 1.3.3-SNAPSHOT Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From a39c77318cf59ab1c3b358d07e4e8697594664ec Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 17:09:28 -0700 Subject: [PATCH 083/172] chore(main): release functions-framework-api 1.1.3-SNAPSHOT (#292) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index bd040f3f..a4804766 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.2 + 1.1.3-SNAPSHOT UTF-8 From a8a8cad4d9d0a5f7ed71349b2fc36945c3ea0a0a Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:20:27 -0700 Subject: [PATCH 084/172] fix: update Maven version on Kokoro cluster to fix release pipeline (#294) * update Maven version on Kokoro cluster to fix release pipeline * fix: update Maven version on Kokoro cluster to fix release pipeline --- .kokoro/release.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 0a599f31..6bbb8455 100644 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -3,6 +3,16 @@ # Stop execution when any command fails. set -e +# update the Maven version to 3.6.3 +pushd /usr/local +wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.tar.gz +tar -xvzf apache-maven-3.6.3-bin.tar.gz apache-maven-3.6.3 +rm -f /usr/local/apache-maven +ln -s /usr/local/apache-maven-3.6.3 /usr/local/apache-maven +rm apache-maven-3.6.3-bin.tar.gz +popd + + # Get secrets from keystore and set and environment variables. setup_environment_secrets() { export GPG_TTY=$(tty) From 346714a6162adc72fc0f2ae6a2337198742b2197 Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:25:02 -0700 Subject: [PATCH 085/172] fix: update maven-source-plugin version (#295) * update Maven version on Kokoro cluster to fix release pipeline * fix: update Maven version on Kokoro cluster to fix release pipeline * fix: update the dependecy version --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index a4804766..f6a0026c 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -151,7 +151,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.6.0 attach-sources From 8f1fd84ca4cc43b2e93b66fe160f78a868b55ffe Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:08:19 -0700 Subject: [PATCH 086/172] fix: revert maven-source-plugin to 3.2.1 (#297) * update Maven version on Kokoro cluster to fix release pipeline * fix: update Maven version on Kokoro cluster to fix release pipeline * fix: update the dependecy version * fix: revert maven-javadoc-plugin to 3.2.1 --- functions-framework-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index f6a0026c..b7f60a7c 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 attach-sources @@ -151,7 +151,7 @@ org.apache.maven.plugins maven-source-plugin - 3.6.0 + 3.2.1 attach-sources From f909f73652c338493162a92371255f3f8267fa21 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:31:52 -0700 Subject: [PATCH 087/172] chore(main): release functions-framework-api 1.1.3 (#296) * chore(main): release functions-framework-api 1.1.3 * Update CHANGELOG.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: dixuswe <152918466+dixuswe@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- functions-framework-api/CHANGELOG.md | 7 +++++++ functions-framework-api/pom.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 85061204..e6849dfb 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.2","invoker":"1.3.2","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.3","invoker":"1.3.2","function-maven-plugin":"0.11.0"} diff --git a/functions-framework-api/CHANGELOG.md b/functions-framework-api/CHANGELOG.md index 7b57f5b6..497626cf 100644 --- a/functions-framework-api/CHANGELOG.md +++ b/functions-framework-api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.3](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.2...functions-framework-api-v1.1.3) (2024-10-05) + + +### Bug Fixes + +* revert maven-source-plugin to 3.2.1 ([#297](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/297)) ([8f1fd84](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/8f1fd84ca4cc43b2e93b66fe160f78a868b55ffe)) + ## [1.1.2](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.1...functions-framework-api-v1.1.2) (2024-09-27) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index b7f60a7c..43b48830 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.3-SNAPSHOT + 1.1.3 UTF-8 From 066c29e3030a6ff6efa50d2f288bba44e6366738 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:38:23 -0700 Subject: [PATCH 088/172] chore(main): release functions-framework-api 1.1.4-SNAPSHOT (#298) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 43b48830..dd25d18d 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.3 + 1.1.4-SNAPSHOT UTF-8 From c622da956f44be5148cc2aec171a61e4b0f27f1e Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Tue, 19 Nov 2024 15:03:50 -0800 Subject: [PATCH 089/172] fix: update builder image url to correct project repository (#299) * fix: update builder image url to correct project repository the gcr.io/gae-runtimes project is no longer supported, which is causing integration tests to fail in this repo. serverless-runtimes should be used instead. --- .github/workflows/buildpack-integration-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildpack-integration-test.yml b/.github/workflows/buildpack-integration-test.yml index 2c320a6e..41182ce3 100644 --- a/.github/workflows/buildpack-integration-test.yml +++ b/.github/workflows/buildpack-integration-test.yml @@ -24,7 +24,7 @@ jobs: prerun: 'invoker/conformance/prerun.sh' builder-runtime: 'java11' builder-runtime-version: '11' - builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest + builder-url: gcr.io/serverless-runtimes/google-22-full/builder/java:latest java17-buildpack-test: uses: GoogleCloudPlatform/functions-framework-conformance/.github/workflows/buildpack-integration-test.yml@main with: @@ -35,4 +35,4 @@ jobs: prerun: 'invoker/conformance/prerun.sh' builder-runtime: 'java17' builder-runtime-version: '17' - builder-url: gcr.io/gae-runtimes/buildpacks/google-gae-22/java/builder:latest + builder-url: gcr.io/serverless-runtimes/google-22-full/builder/java:latest From ab539e82c6394c64f2dfd1e35e2870cc3dbcb67e Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 20 Nov 2024 00:13:36 +0100 Subject: [PATCH 090/172] chore(deps): update all non-major dependencies (#293) Co-authored-by: HKWinterhalter --- .github/workflows/codeql.yml | 8 ++++---- .github/workflows/conformance.yaml | 8 ++++---- .github/workflows/lint.yaml | 10 +++++----- .github/workflows/scorecard.yml | 6 +++--- .github/workflows/unit.yaml | 6 +++--- function-maven-plugin/pom.xml | 6 +++--- functions-framework-api/pom.xml | 6 +++--- invoker/core/pom.xml | 2 +- invoker/pom.xml | 2 +- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 518a5853..ec4e95c0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: disable-sudo: true egress-policy: block @@ -42,11 +42,11 @@ jobs: uploads.github.com:443 - name: Checkout repository - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 1745c330..2391a71f 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: disable-sudo: true egress-policy: block @@ -30,16 +30,16 @@ jobs: repo.maven.apache.org:443 storage.googleapis.com:443 - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: java-version: ${{ matrix.java }} distribution: temurin - name: Setup Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 with: go-version: '1.21' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7b32858c..0ed43ead 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,16 +13,16 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: disable-sudo: true egress-policy: block allowed-endpoints: > github.com:443 repo.maven.apache.org:443 - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: java-version: 11.x distribution: temurin @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 # v2 minimum required + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # v2 minimum required - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index c90435f2..5d49971e 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: disable-sudo: true egress-policy: block @@ -45,7 +45,7 @@ jobs: *.github.com:443 - name: "Checkout code" - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false @@ -62,6 +62,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@461ef6c76dfe95d5c364de2f431ddbd31a417628 # v3.26.9 + uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index c970fd3e..1767bb9f 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 with: disable-sudo: true egress-policy: block @@ -28,9 +28,9 @@ jobs: repo.maven.apache.org:443 api.adoptium.net:443 *.githubusercontent.com:443 - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0 + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index bab9524c..c78f0265 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -51,7 +51,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.15.0 + 3.15.1 provided @@ -87,7 +87,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.15.0 + 3.15.1 help-goal @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.10.0 + 3.11.1 attach-javadocs diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index dd25d18d..2b937978 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -29,7 +29,7 @@ UTF-8 3.13.0 - 3.10.0 + 3.11.1 5.3.2 @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.1 attach-sources @@ -151,7 +151,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.1 attach-sources diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index ab455d4a..40837faa 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -122,7 +122,7 @@ org.mockito mockito-core - 5.14.0 + 5.14.2 test diff --git a/invoker/pom.xml b/invoker/pom.xml index ff2966e1..8d3182ae 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.10.0 + 3.11.1 attach-javadocs From d93ccf318b096d093c7095442260b3bfec45f8e0 Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Thu, 21 Nov 2024 15:45:59 -0800 Subject: [PATCH 091/172] fix: update lint to use JDK 17 so axel-op/googlejavaformat-action works (#301) * fix: update lint to use JDK 17 so axel-op/googlejavaformat-action works --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 0ed43ead..d1fb2a4b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,7 +24,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: - java-version: 11.x + java-version: 17.x distribution: temurin - name: Build API with Maven run: (cd functions-framework-api/ && mvn install) From 09caeca002e74a92dbfce575b4bdd19da6bcab45 Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Thu, 21 Nov 2024 16:15:48 -0800 Subject: [PATCH 092/172] =?UTF-8?q?fix:=20update=20lint=20formatting=20to?= =?UTF-8?q?=20use=20JDK=2017=20so=20axel-op/googlejavaformat=E2=80=A6=20(#?= =?UTF-8?q?302)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: update lint formatting to use JDK 17 so axel-op/googlejavaformat-action works --- .github/workflows/lint.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d1fb2a4b..59372931 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,7 +24,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 with: - java-version: 17.x + java-version: 11.x distribution: temurin - name: Build API with Maven run: (cd functions-framework-api/ && mvn install) @@ -43,6 +43,11 @@ jobs: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # v2 minimum required + - name: Set up JDK + uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + with: + java-version: 17.x + distribution: temurin - name: Run formatter id: formatter uses: axel-op/googlejavaformat-action@dbff853fb823671ec5781365233bf86543b13215 # v3 From bcce78ed4959e6ec965ee42bc7840a775529b2f0 Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:55:16 -0800 Subject: [PATCH 093/172] fix: update release pipeline to use maven token instead of user:password (#300) --- .kokoro/release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 6bbb8455..66ef1e6d 100644 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -16,8 +16,8 @@ popd # Get secrets from keystore and set and environment variables. setup_environment_secrets() { export GPG_TTY=$(tty) - export SONATYPE_USERNAME=functions-framework-release-bot - export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password) + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f1 -d':') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f2 -d':') export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) # Add the key ring files to $GNUPGHOME to verify the GPG credentials. From 2db9a2bec6ba93e7954e68c2301c5fc2fcc032d8 Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:37:21 -0800 Subject: [PATCH 094/172] fix: revert maven-source-plugin to 3.2.1 (#303) * fix: update release pipeline to use maven token instead of user:password * fix:revert maven-source-plugin to 3.2.1 --- function-maven-plugin/pom.xml | 2 +- functions-framework-api/pom.xml | 2 +- invoker/pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index c78f0265..a48f544c 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -119,7 +119,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 attach-sources diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 2b937978..51d6a67a 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -151,7 +151,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 attach-sources diff --git a/invoker/pom.xml b/invoker/pom.xml index 8d3182ae..28992926 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -67,7 +67,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 attach-sources @@ -119,4 +119,4 @@ - \ No newline at end of file + From 54180ada60ef776e1f720ff12cdf7a2978a8952e Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:06:26 -0800 Subject: [PATCH 095/172] fix: print username for maven repo publish and revert maven-source-plugin to 3.2.1 (#307) * fix: update release pipeline to use maven token instead of user:password * fix:revert maven-source-plugin to 3.2.1 * fix: print username for maven repo publish and revert maven-source-plugin to 3.2.1 --- .kokoro/release.sh | 1 + functions-framework-api/pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 66ef1e6d..929f8ed1 100644 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -19,6 +19,7 @@ setup_environment_secrets() { export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f1 -d':') export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f2 -d':') export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + echo $SONATYPE_USERNAME # Add the key ring files to $GNUPGHOME to verify the GPG credentials. export GNUPGHOME=/tmp/gpg diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 51d6a67a..8e792243 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -73,7 +73,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 attach-sources From 6d2fc846d78de346bafacbaa38587ba8bfc81e7b Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:35:31 -0800 Subject: [PATCH 096/172] fix: remove print maven repo username (#308) * fix: update release pipeline to use maven token instead of user:password * fix:revert maven-source-plugin to 3.2.1 * fix: print username for maven repo publish and revert maven-source-plugin to 3.2.1 * fix: remove print maven repo username --------- Co-authored-by: HKWinterhalter --- .kokoro/release.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 929f8ed1..66ef1e6d 100644 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -19,7 +19,6 @@ setup_environment_secrets() { export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f1 -d':') export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/75669_functions-framework-java-release-bot-sonatype-password | cut -f2 -d':') export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - echo $SONATYPE_USERNAME # Add the key ring files to $GNUPGHOME to verify the GPG credentials. export GNUPGHOME=/tmp/gpg From 150676451da73a9c697af21a3c914a6a32914043 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 15:39:09 -0800 Subject: [PATCH 097/172] chore(main): release functions-framework-api 1.1.4 (#304) * chore(main): release functions-framework-api 1.1.4 * Update CHANGELOG.md --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: dixuswe <152918466+dixuswe@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- functions-framework-api/CHANGELOG.md | 7 +++++++ functions-framework-api/pom.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index e6849dfb..6f51842e 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.3","invoker":"1.3.2","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.4","invoker":"1.3.2","function-maven-plugin":"0.11.0"} diff --git a/functions-framework-api/CHANGELOG.md b/functions-framework-api/CHANGELOG.md index 497626cf..b97246fe 100644 --- a/functions-framework-api/CHANGELOG.md +++ b/functions-framework-api/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.4](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.3...functions-framework-api-v1.1.4) (2024-11-22) + + +### Bug Fixes + +* revert maven-source-plugin to 3.2.1 ([#303](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/303)) ([2db9a2b](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/2db9a2bec6ba93e7954e68c2301c5fc2fcc032d8)) + ## [1.1.3](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/functions-framework-api-v1.1.2...functions-framework-api-v1.1.3) (2024-10-05) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 8e792243..7bc776c4 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.4-SNAPSHOT + 1.1.4 UTF-8 From 32217a10fca464676c8dcc06f4453770debed8bc Mon Sep 17 00:00:00 2001 From: Tomo Suzuki Date: Wed, 27 Nov 2024 12:44:19 -0500 Subject: [PATCH 098/172] ci: release-trigger.yml to specify multiScmName (#311) This adjusts the release configuration to the recent infrastructure upgrade. --- .github/release-trigger.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml index 7fe36225..a97dad2f 100644 --- a/.github/release-trigger.yml +++ b/.github/release-trigger.yml @@ -1 +1,2 @@ -enabled: true \ No newline at end of file +enabled: true +multiScmName: functions-framework-java From 3fc0251ca1c0c00282f1bfc36ae4db962f481565 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:21:37 -0800 Subject: [PATCH 099/172] chore(main): release java-function-invoker 1.3.3 (#306) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- invoker/CHANGELOG.md | 7 +++++++ invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 6f51842e..421fba65 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.4","invoker":"1.3.2","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.4","invoker":"1.3.3","function-maven-plugin":"0.11.0"} diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index c9661841..2ac0970a 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.3.3](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.2...java-function-invoker-v1.3.3) (2024-11-27) + + +### Bug Fixes + +* revert maven-source-plugin to 3.2.1 ([#303](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/303)) ([2db9a2b](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/2db9a2bec6ba93e7954e68c2301c5fc2fcc032d8)) + ## [1.3.2](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.1...java-function-invoker-v1.3.2) (2024-09-18) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index f2ffd4ec..c3c41d4a 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.3-SNAPSHOT + 1.3.3 com.google.cloud.functions.invoker conformance - 1.3.3-SNAPSHOT + 1.3.3 GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 40837faa..3e231706 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3-SNAPSHOT + 1.3.3 com.google.cloud.functions.invoker java-function-invoker - 1.3.3-SNAPSHOT + 1.3.3 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.3-SNAPSHOT + 1.3.3 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 28992926..80eebd42 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3-SNAPSHOT + 1.3.3 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 2713b478..17d99019 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3-SNAPSHOT + 1.3.3 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.3-SNAPSHOT + 1.3.3 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From 7444fef44b860c416ad0e8f51773c58826a18bec Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Wed, 27 Nov 2024 13:56:51 -0800 Subject: [PATCH 100/172] fix: prevent maven-source-plugin from being automatically upgraded (#309) --- .github/renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/renovate.json b/.github/renovate.json index 7287767f..03752847 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,7 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["group:allNonMajor", "schedule:monthly"], + "ignoreDeps": ["org.apache.maven.plugins:maven-source-plugin"] "packageRules": [ { "description": "Create a PR whenever there is a new major version", From f2e3740eaea5c1e1a61d18619adfee429ce949c8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 14:20:31 -0800 Subject: [PATCH 101/172] chore(main): release function-maven-plugin 0.11.1 (#305) * chore(main): release function-maven-plugin 0.11.1 * Remove SNAPSHOT from version in conformance pom.xml --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: dixuswe <152918466+dixuswe@users.noreply.github.com> Co-authored-by: HKWinterhalter --- .github/.release-please-manifest.json | 2 +- function-maven-plugin/CHANGELOG.md | 7 +++++++ function-maven-plugin/pom.xml | 2 +- invoker/conformance/pom.xml | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index 421fba65..ee718aed 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.4","invoker":"1.3.3","function-maven-plugin":"0.11.0"} +{"functions-framework-api":"1.1.4","invoker":"1.3.3","function-maven-plugin":"0.11.1"} diff --git a/function-maven-plugin/CHANGELOG.md b/function-maven-plugin/CHANGELOG.md index fc0c67b1..f1fbe49a 100644 --- a/function-maven-plugin/CHANGELOG.md +++ b/function-maven-plugin/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.11.1](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/function-maven-plugin-v0.11.0...function-maven-plugin-v0.11.1) (2024-11-27) + + +### Bug Fixes + +* revert maven-source-plugin to 3.2.1 ([#303](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/303)) ([2db9a2b](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/2db9a2bec6ba93e7954e68c2301c5fc2fcc032d8)) + ## [0.11.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/function-maven-plugin-v0.10.1...function-maven-plugin-v0.11.0) (2023-05-31) diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index a48f544c..aee89999 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -10,7 +10,7 @@ com.google.cloud.functions function-maven-plugin maven-plugin - 0.11.1-SNAPSHOT + 0.11.1 Functions Framework Plugin A Maven plugin that allows functions to be deployed, and to be run locally using the Java Functions Framework. diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index c3c41d4a..9efbc40a 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -53,9 +53,9 @@ com.google.cloud.functions function-maven-plugin - 0.11.1-SNAPSHOT + 0.11.1 - \ No newline at end of file + From d31b502fc019777a308ad694987c54fd6f6eb0a1 Mon Sep 17 00:00:00 2001 From: HKWinterhalter Date: Mon, 2 Dec 2024 08:54:47 -0800 Subject: [PATCH 102/172] Fix: Update release-please-config to properly version bump functions-maven-plugin for invoker/conformance/pom.xml (#315) * Update release-please-config.json * fix: Update release-please-config to properly version bump functions-maven-plugin for invoker/conformance/pom.xml --- .github/release-please-config.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/release-please-config.json b/.github/release-please-config.json index afc739a2..05f7dc1c 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -46,6 +46,11 @@ "path": "conformance/pom.xml", "xpath": "//*[local-name()='artifactId' and text()='conformance']/parent::*/*[local-name()='version']" }, + { + "type": "xml", + "path": "conformance/pom.xml", + "xpath": "//*[local-name()='artifactId' and text()='function-maven-plugin']/parent::*/*[local-name()='version']" + }, { "type": "xml", "path": "testfunction/pom.xml", @@ -70,4 +75,4 @@ ] } } -} \ No newline at end of file +} From eaa846b66cffa5e29245090bf45912fdd42cad4a Mon Sep 17 00:00:00 2001 From: James Ma Date: Tue, 3 Dec 2024 09:15:37 -0800 Subject: [PATCH 103/172] Update README.md (#316) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4b4da494..850b806c 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,13 @@ ![Security Scorecard](https://api.securityscorecards.dev/projects/github.com/GoogleCloudPlatform/functions-framework-java/badge) An open source FaaS (Function as a service) framework for writing portable -Java functions -- brought to you by the Google Cloud Functions team. +Java functions. The Functions Framework lets you write lightweight functions that run in many different environments, including: -* [Google Cloud Functions](https://cloud.google.com/functions/) +* [Google Cloud Run functions](https://cloud.google.com/functions/) * Your local development machine -* [Cloud Run](https://cloud.google.com/run/) and [Cloud Run for Anthos](https://cloud.google.com/anthos/run/) * [Knative](https://github.com/knative/)-based environments ## Installation From bb3d014eef2abef765740029bc31ab2c93c3a86f Mon Sep 17 00:00:00 2001 From: dixuswe <152918466+dixuswe@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:29:49 -0800 Subject: [PATCH 104/172] fix: renovate.json format (#317) --- .github/renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/renovate.json b/.github/renovate.json index 03752847..2e79135d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,7 +1,7 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", "extends": ["group:allNonMajor", "schedule:monthly"], - "ignoreDeps": ["org.apache.maven.plugins:maven-source-plugin"] + "ignoreDeps": ["org.apache.maven.plugins:maven-source-plugin"], "packageRules": [ { "description": "Create a PR whenever there is a new major version", From 36a156688de9a272c4467a65c82460b8bd621eca Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 18 Dec 2024 10:59:45 -0800 Subject: [PATCH 105/172] chore(main): release functions-framework-api 1.1.5-SNAPSHOT (#310) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- functions-framework-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 7bc776c4..7fbdce19 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -24,7 +24,7 @@ com.google.cloud.functions functions-framework-api - 1.1.4 + 1.1.5-SNAPSHOT UTF-8 From d6fc4a4155c5c56426334e1112f902edbc39d88f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:16:33 -0800 Subject: [PATCH 106/172] chore(main): release java-function-invoker 1.3.4-SNAPSHOT (#312) * chore(main): release java-function-invoker 1.3.4-SNAPSHOT * Update pom.xml We should not bump the version for maven plugin --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Maeve <167252720+maemayve@users.noreply.github.com> --- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 9efbc40a..2f2b8aae 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.3 + 1.3.4-SNAPSHOT com.google.cloud.functions.invoker conformance - 1.3.3 + 1.3.4-SNAPSHOT GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 3e231706..a63cff27 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3 + 1.3.4-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker - 1.3.3 + 1.3.4-SNAPSHOT GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.3 + 1.3.4-SNAPSHOT test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 80eebd42..705aab2d 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3 + 1.3.4-SNAPSHOT pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 17d99019..27e6e595 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.3 + 1.3.4-SNAPSHOT com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.3 + 1.3.4-SNAPSHOT Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From 5ef53174b6cdbc644336121bc19bab6c4b90892d Mon Sep 17 00:00:00 2001 From: Maeve <167252720+maemayve@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:26:11 -0800 Subject: [PATCH 107/172] feat: Add execution id logging to uniquely identify request logs (#319) Adds an execution id for each http. When the LOG_EXECUTION_ID env var is set, the execution id is added as a new field to the json logs. --- .gitignore | 1 + .../invoker/BackgroundFunctionExecutor.java | 14 ++++- .../invoker/HttpFunctionExecutor.java | 4 ++ .../invoker/gcf/ExecutionIdUtil.java | 63 +++++++++++++++++++ .../functions/invoker/gcf/JsonLogHandler.java | 25 ++++++++ .../functions/invoker/IntegrationTest.java | 49 +++++++++++++-- 6 files changed, 150 insertions(+), 6 deletions(-) create mode 100644 invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/ExecutionIdUtil.java diff --git a/.gitignore b/.gitignore index cb8a3b7e..4cd4e4f0 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ # Maven target/ +dependency-reduced-pom.xml # Gradle .gradle diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java index 98b9bc8a..a35f2225 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java @@ -21,6 +21,7 @@ import com.google.cloud.functions.CloudEventsFunction; import com.google.cloud.functions.Context; import com.google.cloud.functions.RawBackgroundFunction; +import com.google.cloud.functions.invoker.gcf.ExecutionIdUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.TypeAdapter; @@ -51,6 +52,7 @@ public final class BackgroundFunctionExecutor extends HttpServlet { private static final Logger logger = Logger.getLogger("com.google.cloud.functions.invoker"); private final FunctionExecutor functionExecutor; + private final ExecutionIdUtil executionIdUtil = new ExecutionIdUtil(); private BackgroundFunctionExecutor(FunctionExecutor functionExecutor) { this.functionExecutor = functionExecutor; @@ -323,6 +325,7 @@ void serviceCloudEvent(CloudEvent cloudEvent) throws Exception { public void service(HttpServletRequest req, HttpServletResponse res) throws IOException { String contentType = req.getContentType(); try { + executionIdUtil.storeExecutionId(req); if ((contentType != null && contentType.startsWith("application/cloudevents+json")) || req.getHeader("ce-specversion") != null) { serviceCloudEvent(req); @@ -333,6 +336,8 @@ public void service(HttpServletRequest req, HttpServletResponse res) throws IOEx } catch (Throwable t) { res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); logger.log(Level.SEVERE, "Failed to execute " + functionExecutor.functionName(), t); + } finally { + executionIdUtil.removeExecutionId(); } } @@ -359,7 +364,14 @@ private void serviceCloudEvent(HttpServletRequest req) throws Exce // ServiceLoader.load // will throw ServiceConfigurationError. At this point we're still running with the default // context ClassLoader, which is the system ClassLoader that has loaded the code here. - runWithContextClassLoader(() -> executor.serviceCloudEvent(reader.toEvent(data -> data))); + try { + executionIdUtil.storeExecutionId(req); + runWithContextClassLoader(() -> executor.serviceCloudEvent(reader.toEvent(data -> data))); + } catch (Throwable t) { + logger.log(Level.SEVERE, "Failed to execute " + executor.functionName(), t); + } finally { + executionIdUtil.removeExecutionId(); + } // The data->data is a workaround for a bug fixed since Milestone 4 of the SDK, in // https://github.com/cloudevents/sdk-java/pull/259. } diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java index 401e22a2..01f07e74 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java @@ -15,6 +15,7 @@ package com.google.cloud.functions.invoker; import com.google.cloud.functions.HttpFunction; +import com.google.cloud.functions.invoker.gcf.ExecutionIdUtil; import com.google.cloud.functions.invoker.http.HttpRequestImpl; import com.google.cloud.functions.invoker.http.HttpResponseImpl; import java.util.logging.Level; @@ -28,6 +29,7 @@ public class HttpFunctionExecutor extends HttpServlet { private static final Logger logger = Logger.getLogger("com.google.cloud.functions.invoker"); private final HttpFunction function; + private final ExecutionIdUtil executionIdUtil = new ExecutionIdUtil(); private HttpFunctionExecutor(HttpFunction function) { this.function = function; @@ -68,6 +70,7 @@ public void service(HttpServletRequest req, HttpServletResponse res) { HttpResponseImpl respImpl = new HttpResponseImpl(res); ClassLoader oldContextLoader = Thread.currentThread().getContextClassLoader(); try { + executionIdUtil.storeExecutionId(req); Thread.currentThread().setContextClassLoader(function.getClass().getClassLoader()); function.service(reqImpl, respImpl); } catch (Throwable t) { @@ -75,6 +78,7 @@ public void service(HttpServletRequest req, HttpServletResponse res) { res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } finally { Thread.currentThread().setContextClassLoader(oldContextLoader); + executionIdUtil.removeExecutionId(); respImpl.flush(); } } diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/ExecutionIdUtil.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/ExecutionIdUtil.java new file mode 100644 index 00000000..7987317d --- /dev/null +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/ExecutionIdUtil.java @@ -0,0 +1,63 @@ +package com.google.cloud.functions.invoker.gcf; + +import java.util.Base64; +import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; +import java.util.logging.Handler; +import java.util.logging.Logger; +import javax.servlet.http.HttpServletRequest; + +/** + * A helper class that either fetches a unique execution id from request HTTP headers or generates a + * random id. + */ +public final class ExecutionIdUtil { + private static final Logger rootLogger = Logger.getLogger(""); + private static final int EXECUTION_ID_LENGTH = 12; + private static final String EXECUTION_ID_HTTP_HEADER = "HTTP_FUNCTION_EXECUTION_ID"; + private static final String LOG_EXECUTION_ID_ENV_NAME = "LOG_EXECUTION_ID"; + + private final Random random = ThreadLocalRandom.current(); + + /** + * Add mapping to root logger from current thread id to execution id. This mapping will be used to + * append the execution id to log lines. + */ + public void storeExecutionId(HttpServletRequest request) { + if (!executionIdLoggingEnabled()) { + return; + } + for (Handler handler : rootLogger.getHandlers()) { + if (handler instanceof JsonLogHandler) { + String id = getOrGenerateExecutionId(request); + ((JsonLogHandler) handler).addExecutionId(Thread.currentThread().getId(), id); + } + } + } + + /** Remove mapping from curent thread to request execution id */ + public void removeExecutionId() { + if (!executionIdLoggingEnabled()) { + return; + } + for (Handler handler : rootLogger.getHandlers()) { + if (handler instanceof JsonLogHandler) { + ((JsonLogHandler) handler).removeExecutionId(Thread.currentThread().getId()); + } + } + } + + private String getOrGenerateExecutionId(HttpServletRequest request) { + String executionId = request.getHeader(EXECUTION_ID_HTTP_HEADER); + if (executionId == null) { + byte[] array = new byte[EXECUTION_ID_LENGTH]; + random.nextBytes(array); + executionId = Base64.getEncoder().encodeToString(array); + } + return executionId; + } + + private boolean executionIdLoggingEnabled() { + return Boolean.parseBoolean(System.getenv().getOrDefault(LOG_EXECUTION_ID_ENV_NAME, "false")); + } +} diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java index 9c94b92a..b21f78a1 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java @@ -5,6 +5,8 @@ import java.io.StringWriter; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.LogRecord; @@ -24,6 +26,14 @@ public final class JsonLogHandler extends Handler { private final PrintStream out; private final boolean closePrintStreamOnClose; + // This map is used to track execution id for currently running Jetty requests. Mapping thread + // id to request works because of an implementation detail of Jetty thread pool handling. + // Jetty worker threads completely handle a request before beginning work on a new request. + // NOTE: Store thread id as a string to avoid comparison failures between int and long. + // + // Jetty Documentation (https://jetty.org/docs/jetty/10/programming-guide/arch/threads.html) + private static final ConcurrentMap executionIdByThreadMap = + new ConcurrentHashMap<>(); public JsonLogHandler(PrintStream out, boolean closePrintStreamOnClose) { this.out = out; @@ -38,6 +48,7 @@ public void publish(LogRecord record) { StringBuilder json = new StringBuilder("{"); appendSeverity(json, record); appendSourceLocation(json, record); + appendExecutionId(json, record); appendMessage(json, record); // must be last, see appendMessage json.append("}"); // We must output the log all at once (should only call println once per call to publish) @@ -96,6 +107,12 @@ private static void appendSourceLocation(StringBuilder json, LogRecord record) { json.append(SOURCE_LOCATION_KEY).append("{").append(String.join(", ", entries)).append("}, "); } + private void appendExecutionId(StringBuilder json, LogRecord record) { + json.append("\"execution_id\": \"") + .append(executionIdByThreadMap.get(Integer.toString(record.getThreadID()))) + .append("\", "); + } + private static String escapeString(String s) { return s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n").replace("\r", "\\r"); } @@ -117,4 +134,12 @@ public void close() throws SecurityException { out.close(); } } + + public void addExecutionId(long threadId, String executionId) { + executionIdByThreadMap.put(Long.toString(threadId), executionId); + } + + public void removeExecutionId(long threadId) { + executionIdByThreadMap.remove(Long.toString(threadId)); + } } diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index 82197547..37d35ebd 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -28,6 +28,8 @@ import com.google.common.truth.Expect; import com.google.gson.Gson; import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.stream.JsonReader; import io.cloudevents.CloudEvent; import io.cloudevents.core.builder.CloudEventBuilder; import io.cloudevents.core.format.EventFormat; @@ -39,6 +41,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.StringReader; import java.io.UncheckedIOException; import java.net.ServerSocket; import java.net.URI; @@ -89,6 +92,8 @@ public class IntegrationTest { @Rule public final TestName testName = new TestName(); private static final String SERVER_READY_STRING = "Started ServerConnector"; + private static final String EXECUTION_ID_HTTP_HEADER = "HTTP_FUNCTION_EXECUTION_ID"; + private static final String EXECUTION_ID = "1234abcd"; private static final ExecutorService EXECUTOR = Executors.newCachedThreadPool(); @@ -286,7 +291,10 @@ public void exceptionHttp() throws Exception { String exceptionExpectedOutput = "\"severity\": \"ERROR\", \"logging.googleapis.com/sourceLocation\": {\"file\":" + " \"com/google/cloud/functions/invoker/HttpFunctionExecutor.java\", \"method\":" - + " \"service\"}, \"message\": \"Failed to execute" + + " \"service\"}, \"execution_id\": \"" + + EXECUTION_ID + + "\"," + + " \"message\": \"Failed to execute" + " com.google.cloud.functions.invoker.testfunctions.ExceptionHttp\\n" + "java.lang.RuntimeException: exception thrown for test"; testHttpFunction( @@ -294,6 +302,7 @@ public void exceptionHttp() throws Exception { ImmutableList.of( TestCase.builder() .setExpectedResponseCode(500) + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) .setExpectedOutput(exceptionExpectedOutput) .build())); } @@ -303,7 +312,10 @@ public void exceptionBackground() throws Exception { String exceptionExpectedOutput = "\"severity\": \"ERROR\", \"logging.googleapis.com/sourceLocation\": {\"file\":" + " \"com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java\", \"method\":" - + " \"service\"}, \"message\": \"Failed to execute" + + " \"service\"}, \"execution_id\": \"" + + EXECUTION_ID + + "\", " + + "\"message\": \"Failed to execute" + " com.google.cloud.functions.invoker.testfunctions.ExceptionBackground\\n" + "java.lang.RuntimeException: exception thrown for test"; @@ -317,6 +329,7 @@ public void exceptionBackground() throws Exception { ImmutableList.of( TestCase.builder() .setRequestText(gcfRequestText) + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) .setExpectedResponseCode(500) .setExpectedOutput(exceptionExpectedOutput) .build()), @@ -359,13 +372,21 @@ public void stackDriverLogging() throws Exception { + "\"logging.googleapis.com/sourceLocation\": " + "{\"file\": \"com/google/cloud/functions/invoker/testfunctions/Log.java\"," + " \"method\": \"service\"}," + + " \"execution_id\": \"" + + EXECUTION_ID + + "\"," + " \"message\": \"blim\"}"; TestCase simpleTestCase = - TestCase.builder().setUrl("/?message=blim").setExpectedOutput(simpleExpectedOutput).build(); + TestCase.builder() + .setUrl("/?message=blim") + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) + .setExpectedOutput(simpleExpectedOutput) + .build(); String quotingExpectedOutput = "\"message\": \"foo\\nbar\\\""; TestCase quotingTestCase = TestCase.builder() .setUrl("/?message=" + URLEncoder.encode("foo\nbar\"", "UTF-8")) + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) .setExpectedOutput(quotingExpectedOutput) .build(); String exceptionExpectedOutput = @@ -373,11 +394,15 @@ public void stackDriverLogging() throws Exception { + "\"logging.googleapis.com/sourceLocation\": " + "{\"file\": \"com/google/cloud/functions/invoker/testfunctions/Log.java\", " + "\"method\": \"service\"}, " + + "\"execution_id\": \"" + + EXECUTION_ID + + "\", " + "\"message\": \"oops\\njava.lang.Exception: disaster\\n" + " at com.google.cloud.functions.invoker.testfunctions.Log.service(Log.java:"; TestCase exceptionTestCase = TestCase.builder() .setUrl("/?message=oops&level=severe&exception=disaster") + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) .setExpectedOutput(exceptionExpectedOutput) .build(); testHttpFunction( @@ -753,7 +778,11 @@ private void testFunction( for (TestCase testCase : testCases) { testCase .expectedOutput() - .ifPresent(output -> expect.that(serverProcess.output()).contains(output)); + .ifPresent( + (output) -> { + expect.that(serverProcess.output()).contains(output); + parseLogJson(serverProcess.output()); + }); } // Wait for the output monitor task to terminate. If it threw an exception, we will get an // ExecutionException here. @@ -842,7 +871,9 @@ private ServerProcess startServer( "FUNCTION_SIGNATURE_TYPE", signatureType.toString(), "FUNCTION_TARGET", - target); + target, + "LOG_EXECUTION_ID", + "true"); processBuilder.environment().putAll(environment); processBuilder.environment().putAll(environmentVariables); Process serverProcess = processBuilder.start(); @@ -879,4 +910,12 @@ private void monitorOutput( throw new UncheckedIOException(e); } } + + // Attempt to parse Json object, throws on parse failure + private void parseLogJson(String json) throws RuntimeException { + System.out.println("trying to parse the following object "); + System.out.println(json); + JsonReader reader = new JsonReader(new StringReader(json)); + JsonParser.parseReader(reader); + } } From d17cc6305b7232129dec48281cca51588ec9dedf Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 15:15:56 -0800 Subject: [PATCH 108/172] chore(main): release java-function-invoker 1.4.0 (#320) * chore(main): release java-function-invoker 1.4.0 * Update pom.xml bot incorrectly bumped function-maven-plugin version --------- Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Maeve <167252720+maemayve@users.noreply.github.com> --- .github/.release-please-manifest.json | 2 +- invoker/CHANGELOG.md | 7 +++++++ invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 6 +++--- invoker/pom.xml | 2 +- invoker/testfunction/pom.xml | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/.release-please-manifest.json b/.github/.release-please-manifest.json index ee718aed..d17a5bf0 100644 --- a/.github/.release-please-manifest.json +++ b/.github/.release-please-manifest.json @@ -1 +1 @@ -{"functions-framework-api":"1.1.4","invoker":"1.3.3","function-maven-plugin":"0.11.1"} +{"functions-framework-api":"1.1.4","invoker":"1.4.0","function-maven-plugin":"0.11.1"} diff --git a/invoker/CHANGELOG.md b/invoker/CHANGELOG.md index 2ac0970a..628267db 100644 --- a/invoker/CHANGELOG.md +++ b/invoker/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.4.0](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.3...java-function-invoker-v1.4.0) (2025-02-12) + + +### Features + +* Add execution id logging to uniquely identify request logs ([#319](https://github.com/GoogleCloudPlatform/functions-framework-java/issues/319)) ([5ef5317](https://github.com/GoogleCloudPlatform/functions-framework-java/commit/5ef53174b6cdbc644336121bc19bab6c4b90892d)) + ## [1.3.3](https://github.com/GoogleCloudPlatform/functions-framework-java/compare/java-function-invoker-v1.3.2...java-function-invoker-v1.3.3) (2024-11-27) diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 2f2b8aae..929b9408 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -4,12 +4,12 @@ java-function-invoker-parent com.google.cloud.functions.invoker - 1.3.4-SNAPSHOT + 1.4.0 com.google.cloud.functions.invoker conformance - 1.3.4-SNAPSHOT + 1.4.0 GCF Confromance Tests diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index a63cff27..35ec377e 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.4-SNAPSHOT + 1.4.0 com.google.cloud.functions.invoker java-function-invoker - 1.3.4-SNAPSHOT + 1.4.0 GCF Java Invoker Application that invokes a GCF Java function. This application is a @@ -115,7 +115,7 @@ com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.4-SNAPSHOT + 1.4.0 test-jar test diff --git a/invoker/pom.xml b/invoker/pom.xml index 705aab2d..7c5c4484 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -8,7 +8,7 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.4-SNAPSHOT + 1.4.0 pom GCF Java Invoker Parent diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index 27e6e595..e8642676 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -4,12 +4,12 @@ com.google.cloud.functions.invoker java-function-invoker-parent - 1.3.4-SNAPSHOT + 1.4.0 com.google.cloud.functions.invoker java-function-invoker-testfunction - 1.3.4-SNAPSHOT + 1.4.0 Example GCF Function Jar An example of a GCF function packaged into a jar. We use this in tests. From e8a3dd2f4eca2d7f0980607795db4edc6b32d1a8 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 10:02:26 -0800 Subject: [PATCH 109/172] chore(main): release function-maven-plugin 0.11.2-SNAPSHOT (#314) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- function-maven-plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index aee89999..11d3baae 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -10,7 +10,7 @@ com.google.cloud.functions function-maven-plugin maven-plugin - 0.11.1 + 0.11.2-SNAPSHOT Functions Framework Plugin A Maven plugin that allows functions to be deployed, and to be run locally using the Java Functions Framework. From 8c7f6d8b8a9587516b68499d6ee2715e6ca0aacd Mon Sep 17 00:00:00 2001 From: Maeve <167252720+maemayve@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:18:28 -0800 Subject: [PATCH 110/172] fix: remove maven-plugin from release-please-config for invoker/conformance/pom.xml (#322) Previous change d31b502 incorrectly added an extra file to the invoker release which is causing automation breakages when the invoker release PRs are created. Move config to the right package. --- .github/release-please-config.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/release-please-config.json b/.github/release-please-config.json index 05f7dc1c..cfe9f42a 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -46,11 +46,6 @@ "path": "conformance/pom.xml", "xpath": "//*[local-name()='artifactId' and text()='conformance']/parent::*/*[local-name()='version']" }, - { - "type": "xml", - "path": "conformance/pom.xml", - "xpath": "//*[local-name()='artifactId' and text()='function-maven-plugin']/parent::*/*[local-name()='version']" - }, { "type": "xml", "path": "testfunction/pom.xml", From d6f71867195bc674e7814f05132c33a02916148e Mon Sep 17 00:00:00 2001 From: Maeve <167252720+maemayve@users.noreply.github.com> Date: Wed, 19 Feb 2025 16:19:21 -0800 Subject: [PATCH 111/172] chore: Update blunderbuss.yml (#323) Add mayv to issue and pr handling --- .github/blunderbuss.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/blunderbuss.yml b/.github/blunderbuss.yml index 2dfa51ed..dcd61b31 100644 --- a/.github/blunderbuss.yml +++ b/.github/blunderbuss.yml @@ -2,9 +2,11 @@ assign_prs: - HKwinterhalter - dixuswe - janell-chen + - mayv assign_issues: - HKwinterhalter - dixuswe - janell-chen + - mayv From 9899a67a9a8cb6ebb27a92cccb740e7e23d48578 Mon Sep 17 00:00:00 2001 From: Maeve <167252720+maemayve@users.noreply.github.com> Date: Thu, 6 Mar 2025 16:45:04 -0800 Subject: [PATCH 112/172] fix: correct Cloud Event retry functionality (#326) * fix: Correct exception handling for CloudEvents A previous change resulted broke exception handling for cloud events so that an exception from the function would not result in a failure response code. Correct error handling for CloudEvents and add a test to cover this case to avoid future breakages. * fix: Do not add execution_id field if logging is disabled Fix logger to not add field if logging is disabled. --- .../invoker/BackgroundFunctionExecutor.java | 9 +---- .../functions/invoker/gcf/JsonLogHandler.java | 13 +++++-- .../functions/invoker/IntegrationTest.java | 37 +++++++++++++++++++ 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java index a35f2225..331c9586 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java @@ -364,14 +364,7 @@ private void serviceCloudEvent(HttpServletRequest req) throws Exce // ServiceLoader.load // will throw ServiceConfigurationError. At this point we're still running with the default // context ClassLoader, which is the system ClassLoader that has loaded the code here. - try { - executionIdUtil.storeExecutionId(req); - runWithContextClassLoader(() -> executor.serviceCloudEvent(reader.toEvent(data -> data))); - } catch (Throwable t) { - logger.log(Level.SEVERE, "Failed to execute " + executor.functionName(), t); - } finally { - executionIdUtil.removeExecutionId(); - } + runWithContextClassLoader(() -> executor.serviceCloudEvent(reader.toEvent(data -> data))); // The data->data is a workaround for a bug fixed since Milestone 4 of the SDK, in // https://github.com/cloudevents/sdk-java/pull/259. } diff --git a/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java index b21f78a1..51aad21a 100644 --- a/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java +++ b/invoker/core/src/main/java/com/google/cloud/functions/invoker/gcf/JsonLogHandler.java @@ -17,6 +17,7 @@ */ public final class JsonLogHandler extends Handler { private static final String SOURCE_LOCATION_KEY = "\"logging.googleapis.com/sourceLocation\": "; + private static final String LOG_EXECUTION_ID_ENV_NAME = "LOG_EXECUTION_ID"; private static final String DEBUG = "DEBUG"; private static final String INFO = "INFO"; @@ -108,9 +109,11 @@ private static void appendSourceLocation(StringBuilder json, LogRecord record) { } private void appendExecutionId(StringBuilder json, LogRecord record) { - json.append("\"execution_id\": \"") - .append(executionIdByThreadMap.get(Integer.toString(record.getThreadID()))) - .append("\", "); + if (executionIdLoggingEnabled()) { + json.append("\"execution_id\": \"") + .append(executionIdByThreadMap.get(Integer.toString(record.getThreadID()))) + .append("\", "); + } } private static String escapeString(String s) { @@ -142,4 +145,8 @@ public void addExecutionId(long threadId, String executionId) { public void removeExecutionId(long threadId) { executionIdByThreadMap.remove(Long.toString(threadId)); } + + private boolean executionIdLoggingEnabled() { + return Boolean.parseBoolean(System.getenv().getOrDefault(LOG_EXECUTION_ID_ENV_NAME, "false")); + } } diff --git a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java index 37d35ebd..2f1d8bc8 100644 --- a/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java +++ b/invoker/core/src/test/java/com/google/cloud/functions/invoker/IntegrationTest.java @@ -577,6 +577,43 @@ public void nativeCloudEvent() throws Exception { ImmutableList.of(cloudEventsStructuredTestCase, cloudEventsBinaryTestCase)); } + /** Tests a CloudEvent being handled by a CloudEvent handler throws exception */ + @Test + public void nativeCloudEventException() throws Exception { + String exceptionExpectedOutput = + "\"severity\": \"ERROR\", \"logging.googleapis.com/sourceLocation\": {\"file\":" + + " \"com/google/cloud/functions/invoker/BackgroundFunctionExecutor.java\", \"method\":" + + " \"service\"}, \"execution_id\": \"" + + EXECUTION_ID + + "\", " + + "\"message\": \"Failed to execute" + + " com.google.cloud.functions.invoker.testfunctions.ExceptionBackground\\n" + + "java.lang.RuntimeException: exception thrown for test"; + File snoopFile = snoopFile(); + CloudEvent cloudEvent = sampleCloudEvent(snoopFile); + EventFormat jsonFormat = + EventFormatProvider.getInstance().resolveFormat(JsonFormat.CONTENT_TYPE); + String cloudEventJson = new String(jsonFormat.serialize(cloudEvent), UTF_8); + + // A CloudEvent using the "structured content mode", where both the metadata and the payload + // are in the body of the HTTP request. + TestCase cloudEventsStructuredTestCase = + TestCase.builder() + .setRequestText(cloudEventJson) + .setHttpContentType("application/cloudevents+json; charset=utf-8") + .setHttpHeaders(ImmutableMap.of(EXECUTION_ID_HTTP_HEADER, EXECUTION_ID)) + .setExpectedResponseCode(500) + .setExpectedOutput(exceptionExpectedOutput) + .build(); + + testFunction( + SignatureType.CLOUD_EVENT, + fullTarget("ExceptionBackground"), + ImmutableList.of(), + ImmutableList.of(cloudEventsStructuredTestCase), + Collections.emptyMap()); + } + @Test public void nested() throws Exception { String testText = "sic transit gloria mundi"; From 185d15f77c4a165ec01950ae11960024b0f27151 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Fri, 7 Mar 2025 18:00:24 +0100 Subject: [PATCH 113/172] chore(deps): update all non-major dependencies (#318) Co-authored-by: Maeve <167252720+maemayve@users.noreply.github.com> --- .github/workflows/codeql.yml | 6 +++--- .github/workflows/conformance.yaml | 6 +++--- .github/workflows/lint.yaml | 8 ++++---- .github/workflows/scorecard.yml | 6 +++--- .github/workflows/unit.yaml | 4 ++-- function-maven-plugin/pom.xml | 6 +++--- functions-framework-api/pom.xml | 4 ++-- invoker/conformance/pom.xml | 4 ++-- invoker/core/pom.xml | 14 +++++++------- invoker/pom.xml | 4 ++-- invoker/testfunction/pom.xml | 8 ++++---- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ec4e95c0..c28404fd 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: disable-sudo: true egress-policy: block @@ -46,7 +46,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/init@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support languages: java @@ -66,6 +66,6 @@ jobs: (cd function-maven-plugin && mvn install) - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/analyze@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: category: ${{ matrix.working-directory }} diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml index 2391a71f..82e50d85 100644 --- a/.github/workflows/conformance.yaml +++ b/.github/workflows/conformance.yaml @@ -18,7 +18,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: disable-sudo: true egress-policy: block @@ -33,13 +33,13 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: java-version: ${{ matrix.java }} distribution: temurin - name: Setup Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0 + uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0 with: go-version: '1.21' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 59372931..ab57ead9 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: disable-sudo: true egress-policy: block @@ -22,7 +22,7 @@ jobs: repo.maven.apache.org:443 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: java-version: 11.x distribution: temurin @@ -38,13 +38,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # v2 minimum required - name: Set up JDK - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: java-version: 17.x distribution: temurin diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 5d49971e..752afbf3 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -26,7 +26,7 @@ jobs: steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: disable-sudo: true egress-policy: block @@ -50,7 +50,7 @@ jobs: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 + uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1 with: results_file: results.sarif results_format: sarif @@ -62,6 +62,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4 + uses: github/codeql-action/upload-sarif@b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d # v3.28.10 with: sarif_file: results.sarif diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 1767bb9f..01522215 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -19,7 +19,7 @@ jobs: ] steps: - name: Harden Runner - uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 + uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 with: disable-sudo: true egress-policy: block @@ -30,7 +30,7 @@ jobs: *.githubusercontent.com:443 - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0 + uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 with: java-version: ${{ matrix.java }} distribution: temurin diff --git a/function-maven-plugin/pom.xml b/function-maven-plugin/pom.xml index 11d3baae..76de071a 100644 --- a/function-maven-plugin/pom.xml +++ b/function-maven-plugin/pom.xml @@ -58,13 +58,13 @@ com.google.cloud.functions.invoker java-function-invoker - 1.3.1 + 1.4.0 com.google.cloud.tools appengine-maven-plugin - 2.8.1 + 2.8.3 jar @@ -132,7 +132,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 attach-javadocs diff --git a/functions-framework-api/pom.xml b/functions-framework-api/pom.xml index 7fbdce19..438f2898 100644 --- a/functions-framework-api/pom.xml +++ b/functions-framework-api/pom.xml @@ -28,8 +28,8 @@ UTF-8 - 3.13.0 - 3.11.1 + 3.14.0 + 3.11.2 5.3.2 diff --git a/invoker/conformance/pom.xml b/invoker/conformance/pom.xml index 929b9408..b7d60325 100644 --- a/invoker/conformance/pom.xml +++ b/invoker/conformance/pom.xml @@ -28,12 +28,12 @@ com.google.cloud.functions functions-framework-api - 1.1.0 + 1.1.4 com.google.code.gson gson - 2.11.0 + 2.12.1 io.cloudevents diff --git a/invoker/core/pom.xml b/invoker/core/pom.xml index 35ec377e..b7f41622 100644 --- a/invoker/core/pom.xml +++ b/invoker/core/pom.xml @@ -44,7 +44,7 @@ com.google.cloud.functions functions-framework-api - 1.1.0 + 1.1.4 javax.servlet @@ -69,7 +69,7 @@ com.google.code.gson gson - 2.11.0 + 2.12.1 com.ryanharter.auto.value @@ -98,12 +98,12 @@ org.eclipse.jetty jetty-servlet - 9.4.56.v20240826 + 9.4.57.v20241219 org.eclipse.jetty jetty-server - 9.4.56.v20240826 + 9.4.57.v20241219 com.beust @@ -122,7 +122,7 @@ org.mockito mockito-core - 5.14.2 + 5.16.0 test @@ -134,7 +134,7 @@ com.google.re2j re2j - 1.7 + 1.8 com.google.truth @@ -151,7 +151,7 @@ org.eclipse.jetty jetty-client - 9.4.56.v20240826 + 9.4.57.v20241219 test diff --git a/invoker/pom.xml b/invoker/pom.xml index 7c5c4484..4151e994 100644 --- a/invoker/pom.xml +++ b/invoker/pom.xml @@ -42,7 +42,7 @@ com.google.cloud.functions functions-framework-api - 1.1.0 + 1.1.4 @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.11.1 + 3.11.2 attach-javadocs diff --git a/invoker/testfunction/pom.xml b/invoker/testfunction/pom.xml index e8642676..44c4f110 100644 --- a/invoker/testfunction/pom.xml +++ b/invoker/testfunction/pom.xml @@ -19,7 +19,7 @@ com.google.cloud.functions functions-framework-api - 1.1.0 + 1.1.4 + + airlock-mirror + Airlock Maven Central mirror + https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p-trusted + * + + + + + + airlock-mirror + oauth2accesstoken + ${MAVEN_TOKEN} + + + + exit-gate-ar + oauth2accesstoken + ${MAVEN_TOKEN} + + + +EOF + +# ============================================================================== +# 2. Retrieve GPG keys from Secret Manager +# ============================================================================== +GPG_KEYRING="${KOKORO_ARTIFACTS_DIR}/gpg-keyring" +GPG_PASSPHRASE_FILE="${KOKORO_ARTIFACTS_DIR}/gpg-passphrase" + +# Read names from environment variables injected by Louhi +PROJECT_ID="${_LOUHI_SECRET_PROJECT_ID}" +KEYRING_NAME="${_LOUHI_GPG_KEYRING_SECRET_NAME}" +PASSPHRASE_NAME="${_LOUHI_GPG_PASSPHRASE_SECRET_NAME}" + +echo "Fetching secrets from project: ${PROJECT_ID}" +gcloud secrets versions access latest --secret="${KEYRING_NAME}" --project="${PROJECT_ID}" > "${GPG_KEYRING}" +gcloud secrets versions access latest --secret="${PASSPHRASE_NAME}" --project="${PROJECT_ID}" > "${GPG_PASSPHRASE_FILE}" + +export GPG_TTY=$(tty) +export GPG_PASSPHRASE=$(cat "${GPG_PASSPHRASE_FILE}") +export GNUPGHOME=/tmp/gpg +mkdir -p "${GNUPGHOME}" +gpg --batch --import "${GPG_KEYRING}" + +# ============================================================================== +# 3. Build, Sign, and Deploy +# ============================================================================== +# Detect which package to build based on the Louhi trigger tag +if [[ -n "${_LOUHI_REF_NAME:-}" ]]; then + echo "Triggered by Louhi tag: ${_LOUHI_REF_NAME}" + if [[ "${_LOUHI_REF_NAME}" == *functions-framework-api* ]]; then + PACKAGE_DIR="functions-framework-api" + elif [[ "${_LOUHI_REF_NAME}" == *function-maven-plugin* ]]; then + PACKAGE_DIR="function-maven-plugin" + elif [[ "${_LOUHI_REF_NAME}" == *java-function-invoker* ]]; then + PACKAGE_DIR="invoker" + else + echo "Unknown tag format: ${_LOUHI_REF_NAME}. Defaulting to invoker." + PACKAGE_DIR="invoker" + fi +else + # Fallback for manual/non-tag builds (e.g. testing) + echo "No Louhi tag detected. Falling back to KOKORO_JOB_NAME detection." + if [[ $KOKORO_JOB_NAME == *"function-maven-plugin"* ]]; then + PACKAGE_DIR="function-maven-plugin" + elif [[ $KOKORO_JOB_NAME == *"functions-framework-api"* ]]; then + PACKAGE_DIR="functions-framework-api" + else + PACKAGE_DIR="invoker" + fi +fi + +echo "Building package in directory: ${PACKAGE_DIR}" +cd "${PACKAGE_DIR}" + +# Run maven deploy using the temporary settings.xml +# We use altDeploymentRepository to override the deploy target without editing pom.xml +mvn clean deploy -B \ + -P sonatype-oss-release \ + --settings=../settings.xml \ + -DaltDeploymentRepository=exit-gate-ar::https://us-maven.pkg.dev/oss-exit-gate-prod/ff-releases--mavencentral \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase="${GPG_PASSPHRASE}" \ + -Dgpg.homedir="${GNUPGHOME}" + +# ============================================================================== +# 4. Copy artifacts to 'artifacts/' folder for Kokoro Attestation Generation +# ============================================================================== +ARTIFACTS_DIR="${REPO_DIR}/artifacts" +mkdir -p "${ARTIFACTS_DIR}" + +# Copy target jars and poms (excluding test jars) to be captured by build.cfg +find target/ -maxdepth 1 -name "*.jar" -o -name "*.pom" | grep -v "test" | xargs -I {} cp {} "${ARTIFACTS_DIR}/" diff --git a/.kokoro/release.cfg b/.kokoro/release.cfg index 08d0ac9f..c617e165 100644 --- a/.kokoro/release.cfg +++ b/.kokoro/release.cfg @@ -1,30 +1,23 @@ +# -*- protobuffer -*- +# proto-file: google3/devtools/kokoro/config/proto/build.proto +# proto-message: BuildConfig + build_file: "functions-framework-java/.kokoro/release.sh" +container_properties { + docker_image: "us-docker.pkg.dev/artifact-foundry-prod/docker-3p-trusted/ubuntu:22.04" +} -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 75669 - keyname: "functions-framework-java-release-bot-sonatype-password" - } - keystore_resource { - keystore_config_id: 75669 - keyname: "functions-framework-release-sonatype-central-portal-username" - } - keystore_resource { - keystore_config_id: 75669 - keyname: "functions-framework-release-sonatype-central-portal-password" - } - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-pubkeyring" - } - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-keyring" - } - keystore_resource { - keystore_config_id: 70247 - keyname: "maven-gpg-passphrase" +fileset_artifacts { + name: "manifest" + artifact_globs: "manifest.json" + error_if_missing: true + destinations { + store_attestation: false + gcs { + gcs_root_path: "oss-exit-gate-prod-projects-bucket/ff-releases/mavencentral/manifests" + populate_content_type: true } } + generate_sbom_from_fileset: false + generate_attestation: false } diff --git a/.kokoro/release.sh b/.kokoro/release.sh old mode 100644 new mode 100755 index b85e6003..58b865a6 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -1,84 +1,10 @@ #!/bin/bash +set -euo pipefail -# Stop execution when any command fails. -set -e +cd "${KOKORO_ARTIFACTS_DIR}" -# update the Maven version to 3.9.11 -pushd /usr/local -wget https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.tar.gz -tar -xvzf apache-maven-3.9.11-bin.tar.gz apache-maven-3.9.11 -rm -f /usr/local/apache-maven -ln -s /usr/local/apache-maven-3.9.11 /usr/local/apache-maven -rm apache-maven-3.9.11-bin.tar.gz -popd - - -# Get secrets from keystore and set and environment variables. -setup_environment_secrets() { - export GPG_TTY=$(tty) - export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) - - # Add the key ring files to $GNUPGHOME to verify the GPG credentials. - export GNUPGHOME=/tmp/gpg - mkdir $GNUPGHOME - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GNUPGHOME/pubring.gpg - mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GNUPGHOME/secring.gpg - gpg -k -} - -create_settings_xml_file() { - echo " - - - - true - - - ${GPG_PASSPHRASE} - - - - - - sonatype-central-portal - $(cat "${KOKORO_KEYSTORE_DIR}/75669_functions-framework-release-sonatype-central-portal-username") - $(cat "${KOKORO_KEYSTORE_DIR}/75669_functions-framework-release-sonatype-central-portal-password") - - -" > $1 +cat > manifest.json <<'EOF' +{ + "publish_all": true } - -setup_environment_secrets - -# Pick the right package to release based on the Kokoro job name. -cd ${KOKORO_ARTIFACTS_DIR}/github/functions-framework-java -create_settings_xml_file "settings.xml" -echo "KOKORO_JOB_NAME=${KOKORO_JOB_NAME}" -if [[ $KOKORO_JOB_NAME == *"function-maven-plugin"* ]]; then - cd function-maven-plugin -elif [[ $KOKORO_JOB_NAME == *"functions-framework-api"* ]]; then - cd functions-framework-api -else - cd invoker -fi -echo "pwd=$(pwd)" - -# Make sure `JAVA_HOME` is set and using jdk17. -JDK_VERSION=17 -apt-get update -# Install new JDK version -apt-get install -y openjdk-"${JDK_VERSION}"-jdk -export JAVA_HOME="$(update-java-alternatives -l | grep "1.${JDK_VERSION}" | head -n 1 | tr -s " " | cut -d " " -f 3)" -echo "JAVA_HOME=$JAVA_HOME" - -SUPPRESS_LOGS='-q' -if [[ -n "${ENABLE_LOGS}" ]]; then - SUPPRESS_LOGS='' -fi - -mvn clean deploy -B ${SUPPRESS_LOGS} \ - -P sonatype-oss-release \ - --settings=../settings.xml \ - -Dgpg.executable=gpg \ - -Dgpg.passphrase=${GPG_PASSPHRASE} \ - -Dgpg.homedir=${GNUPGHOME} +EOF