From 157dcfebac207b4bcab7aad4d6f983d71de93b28 Mon Sep 17 00:00:00 2001 From: ace-n Date: Thu, 12 May 2022 16:07:45 -0700 Subject: [PATCH 1/6] feat(functions/slack): add GCF v2 decorators --- functions/slack/main.py | 2 ++ functions/slack/requirements.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/functions/slack/main.py b/functions/slack/main.py index 47f3ef037aff..af840a89e184 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -17,6 +17,7 @@ from flask import jsonify import googleapiclient.discovery from slack.signature import SignatureVerifier +import functions_framework kgsearch = googleapiclient.discovery.build( @@ -89,6 +90,7 @@ def make_search_request(query): # [START functions_slack_search] +@functions_framework.http def kg_search(request): if request.method != 'POST': return 'Only POST requests are accepted', 405 diff --git a/functions/slack/requirements.txt b/functions/slack/requirements.txt index 94ee178e30fa..08c9316f9288 100644 --- a/functions/slack/requirements.txt +++ b/functions/slack/requirements.txt @@ -1,3 +1,4 @@ google-api-python-client==2.41.0 flask==2.1.0 +functions-framework==3.0.0 slackclient==2.9.4 From 8f8d74be58d13b278d45ce4492b35c793bea4b4c Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Thu, 12 May 2022 16:13:08 -0700 Subject: [PATCH 2/6] Fix lint --- functions/slack/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index af840a89e184..8a279a98fb27 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -15,9 +15,9 @@ import os from flask import jsonify +import functions_framework import googleapiclient.discovery from slack.signature import SignatureVerifier -import functions_framework kgsearch = googleapiclient.discovery.build( From 1e0ed836aa9d4dd71ba9a074c2997278e67f9ed9 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Thu, 12 May 2022 16:16:25 -0700 Subject: [PATCH 3/6] Fix copyright --- functions/slack/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index 8a279a98fb27..92cf8698da5e 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -1,4 +1,4 @@ -# Copyright 2018, Google, LLC. +# Copyright 2022, 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 From 433aeeba639f50e5e41ac085c5408b2cd15b53c6 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Thu, 12 May 2022 16:18:25 -0700 Subject: [PATCH 4/6] Bots hate commas --- functions/slack/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index 92cf8698da5e..a0b8a6d63baa 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -1,4 +1,4 @@ -# Copyright 2022, Google, LLC. +# Copyright 2022 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 From 08f772fd4b6f1cdeb6da22384aadb298ee4425d7 Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Thu, 12 May 2022 16:19:23 -0700 Subject: [PATCH 5/6] Humans hate commas too --- functions/slack/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index a0b8a6d63baa..1ddd289b3c67 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google, LLC. +# Copyright 2022 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 From 63769507ebc1e0b2717e52711c95e2ee50cae7ce Mon Sep 17 00:00:00 2001 From: Ace Nassri Date: Fri, 13 May 2022 09:50:20 -0700 Subject: [PATCH 6/6] Fix copyright Co-authored-by: Dan Lee <71398022+dandhlee@users.noreply.github.com> --- functions/slack/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/slack/main.py b/functions/slack/main.py index 1ddd289b3c67..31f50ea9ee79 100644 --- a/functions/slack/main.py +++ b/functions/slack/main.py @@ -1,4 +1,4 @@ -# Copyright 2022 Google LLC. +# Copyright 2018 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