From a290d09a1178cb85d8de0061386ba9bcbf1dc9b5 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Mon, 5 Feb 2024 15:09:48 +0100 Subject: [PATCH 001/116] 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 002/116] 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 003/116] 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 004/116] 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 005/116] 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 006/116] 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 007/116] 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 008/116] 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 009/116] 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 010/116] 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 011/116] 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 012/116] 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 013/116] 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 014/116] 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 015/116] 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 016/116] 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 017/116] 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 018/116] 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 019/116] 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 020/116] 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 021/116] 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 022/116] 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 023/116] 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 024/116] 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 025/116] 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 026/116] 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 027/116] 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 028/116] 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 029/116] 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 030/116] 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 031/116] 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 032/116] 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 033/116] 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 034/116] 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 035/116] 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 036/116] =?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 037/116] 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 038/116] 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 039/116] 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 040/116] 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 041/116] 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 042/116] 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 043/116] 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 044/116] 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 045/116] 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 046/116] 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 047/116] 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 048/116] 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 049/116] 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 050/116] 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 051/116] 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 052/116] 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 053/116] 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 054/116] 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 055/116] 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 056/116] 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 057/116] 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