profile
viewpoint

Pull request review commentDefinitelyTyped/DefinitelyTyped

[@types/google-apps-script] Add Range#setBackground(null) and fix Spreadsheet#getSheetByName(string) return type

 declare namespace GoogleAppsScript {       getGradientCondition(): GradientCondition;       getRanges(): Range[];       setBackground(color: string): ConditionalFormatRuleBuilder;

Use ‘string?’

proudust

comment created time in a day

pull request commentGoogleCloudPlatform/java-docs-samples

feat: add functions_env_vars

Not exactly sure what to do in terms of mocking System.getenv.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: Add GCF Java Tips

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_tips_scopes]+// [START run_tips_global_scope]+import java.io.IOException;+import java.io.PrintWriter;+import java.net.URI;+import java.net.http.HttpClient;+import java.net.http.HttpRequest;+import java.net.http.HttpResponse;+import java.net.http.HttpResponse.BodyHandlers;+import java.time.Duration;+import java.util.Arrays;+import java.util.List;++import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Tips {++  // Create a client with some reasonable defaults. This client can be reused for multiple requests.+  private static HttpClient client =+      HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();++  // [END functions_tips_scopes]+  // [END run_tips_global_scope]+  private static int lightComputation() {+      List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);+      return numbers.stream().reduce((t, x) -> t + x).get();+  }++  private static int heavyComputation() {+      List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);+      return numbers.stream().reduce((t, x) -> t + x).get();+  }++  // [START functions_tips_scopes]+  // [START run_tips_global_scope]+  // Global (instance-wide) scope+  // This computation runs at instance cold-start+  public static final int INSTANCE_VAR = heavyComputation();++  /**

Removed.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: Add GCF Java Tips

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_tips_scopes]+// [START run_tips_global_scope]+import java.io.IOException;+import java.io.PrintWriter;+import java.net.URI;+import java.net.http.HttpClient;+import java.net.http.HttpRequest;+import java.net.http.HttpResponse;+import java.net.http.HttpResponse.BodyHandlers;+import java.time.Duration;+import java.util.Arrays;+import java.util.List;++import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Tips {++  // Create a client with some reasonable defaults. This client can be reused for multiple requests.+  private static HttpClient client =+      HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();++  // [END functions_tips_scopes]+  // [END run_tips_global_scope]+  private static int lightComputation() {+      List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);+      return numbers.stream().reduce((t, x) -> t + x).get();+  }++  private static int heavyComputation() {+      List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);+      return numbers.stream().reduce((t, x) -> t + x).get();+  }++  // [START functions_tips_scopes]+  // [START run_tips_global_scope]+  // Global (instance-wide) scope+  // This computation runs at instance cold-start+  public static final int INSTANCE_VAR = heavyComputation();

Moved to the very top. Not sure if we need the context listener.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: Add GCF Java Tips

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_tips_scopes]+// [START run_tips_global_scope]+import java.io.IOException;+import java.io.PrintWriter;+import java.net.URI;+import java.net.http.HttpClient;+import java.net.http.HttpRequest;+import java.net.http.HttpResponse;+import java.net.http.HttpResponse.BodyHandlers;+import java.time.Duration;+import java.util.Arrays;+import java.util.List;++import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Tips {++  // Create a client with some reasonable defaults. This client can be reused for multiple requests.+  private static HttpClient client =+      HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();++  // [END functions_tips_scopes]+  // [END run_tips_global_scope]+  private static int lightComputation() {+      List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);+      return numbers.stream().reduce((t, x) -> t + x).get();+  }++  private static int heavyComputation() {

Ah, fixed.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: Add GCF Java Tips

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_tips_scopes]+// [START run_tips_global_scope]+import java.io.IOException;+import java.io.PrintWriter;+import java.net.URI;+import java.net.http.HttpClient;+import java.net.http.HttpRequest;+import java.net.http.HttpResponse;+import java.net.http.HttpResponse.BodyHandlers;+import java.time.Duration;+import java.util.Arrays;+import java.util.List;++import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Tips {++  // Create a client with some reasonable defaults. This client can be reused for multiple requests.+  private static HttpClient client =+      HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();++  // [END functions_tips_scopes]

Sure. I was just following the other samples that exclude them. Can include them at the bottom.

grant

comment created time in a day

push eventGoogleCloudPlatform/java-docs-samples

Grant Timmerman

commit sha cc081203932f883286cb949d40cd4dcbf5964826

Fix: Simplify PR

view details

push time in a day

pull request commentGoogleCloudPlatform/java-docs-samples

feat: Add functions_tips_scopes

Ah, this is actually a duplicate PR.

grant

comment created time in a day

push eventGoogleCloudPlatform/java-docs-samples

Grant Timmerman

commit sha 1ca02d552c5267bfbf051afe9480f92d44307f4c

Fix: Fix tests by debugging locally

view details

push time in a day

create barnchGoogleCloudPlatform/java-docs-samples

branch : functions_tips_scopes

created branch time in a day

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

Docs Updates

+## Local Testing of Cloud Events++The setup for cloud functions that accept events is very similar to the instructions in the quickstart, with the following adjustments:++In your `package.json`, add a signature type (in bold) to your start command:++<pre>+  "scripts": {+    "start": "functions-framework --target=helloWorld <b>--signature-type=event"</b>+  }+</pre>++Upon running ```sh npm start ```, you'll see the function is still being served at `http://localhost:8080/`. However, it is no longer accessible via GET requests from the browser. Instead, send a POST request where the request body conforms to the API defined by [push subscriptions](https://cloud.google.com/pubsub/docs/push). ++### Submitting POST Request to Simulate Pub/Sub messages++Create a `mockPubsub.json` file with the following contents:++```json+{+  "message": {+    "attributes": {+      "key": "value"+    },+    "data": "SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==",+    "messageId": "136969346945"+  },+  "subscription": "projects/myproject/subscriptions/mysubscription"+}+```++The file can be in any folder on your computer. From the terminal, go to the directory where `mockPubsub.json` is located, and run the following command (assuming your cloud function is hosted locally on port 8080):++```sh +curl -d "@mockPubsub.json" \+  -X POST \+  -H "Ce-Type: true" \+  -H "Ce-Specversion: true" \+  -H "Ce-Source: true" \+  -H "Ce-Id: true" \+  http://localhost:8080+```+ +### Using the Pub/Sub emulator++Another way to test your cloud function Pub/Sub endpoint is to use the [Pub/Sub Emulator](https://cloud.google.com/pubsub/docs/emulator). This allows you to use the Pub/Sub notification from another service to trigger your cloud function.++The high level approach is to:+1. Start the Pub/Sub Emulator+2. Use the Pub/Sub client library to create a subscription and set the `pushEndpoint` to `http://localhost:8080`.++After setup, all notifications to the subscription topic will be pushed to your cloud function.++Here is a sample script for creating subscription with a `pushEndpoint`:++ ```js+{ PubSub } require('@google-cloud/pubsub');++async function main() {+  const pubsub = new PubSub({+    apiEndpoint: 'localhost:8085', // Pubsub emulator endpoint

Yes. It is a constant in the docs linked above. See: https://cloud.google.com/pubsub/docs/emulator

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

Docs Updates

+## Local Testing of Cloud Events++The setup for cloud functions that accept events is very similar to the instructions in the quickstart, with the following adjustments:++In your `package.json`, add a signature type (in bold) to your start command:++<pre>+  "scripts": {+    "start": "functions-framework --target=helloWorld <b>--signature-type=event"</b>+  }+</pre>++Upon running ```sh npm start ```, you'll see the function is still being served at `http://localhost:8080/`. However, it is no longer accessible via GET requests from the browser. Instead, send a POST request where the request body conforms to the API defined by [push subscriptions](https://cloud.google.com/pubsub/docs/push). ++### Submitting POST Request to Simulate Pub/Sub messages++Create a `mockPubsub.json` file with the following contents:++```json+{+  "message": {+    "attributes": {+      "key": "value"+    },+    "data": "SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==",+    "messageId": "136969346945"+  },+  "subscription": "projects/myproject/subscriptions/mysubscription"+}+```++The file can be in any folder on your computer. From the terminal, go to the directory where `mockPubsub.json` is located, and run the following command (assuming your cloud function is hosted locally on port 8080):++```sh +curl -d "@mockPubsub.json" \+  -X POST \+  -H "Ce-Type: true" \+  -H "Ce-Specversion: true" \+  -H "Ce-Source: true" \+  -H "Ce-Id: true" \+  http://localhost:8080+```+ +### Using the Pub/Sub emulator++Another way to test your cloud function Pub/Sub endpoint is to use the [Pub/Sub Emulator](https://cloud.google.com/pubsub/docs/emulator). This allows you to use the Pub/Sub notification from another service to trigger your cloud function.++The high level approach is to:+1. Start the Pub/Sub Emulator+2. Use the Pub/Sub client library to create a subscription and set the `pushEndpoint` to `http://localhost:8080`.++After setup, all notifications to the subscription topic will be pushed to your cloud function.++Here is a sample script for creating subscription with a `pushEndpoint`:++ ```js+{ PubSub } require('@google-cloud/pubsub');

Fixed this basic mistake.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/functions-framework-nodejs

Docs Updates

+## Local Testing of Cloud Events++The setup for cloud functions that accept events is very similar to the instructions in the quickstart, with the following adjustments:++In your `package.json`, add a signature type (in bold) to your start command:++<pre>+  "scripts": {+    "start": "functions-framework --target=helloWorld <b>--signature-type=event"</b>+  }+</pre>++Upon running ```sh npm start ```, you'll see the function is still being served at `http://localhost:8080/`. However, it is no longer accessible via GET requests from the browser. Instead, send a POST request where the request body conforms to the API defined by [push subscriptions](https://cloud.google.com/pubsub/docs/push). ++### Submitting POST Request to Simulate Pub/Sub messages++Create a `mockPubsub.json` file with the following contents:++```json+{+  "message": {+    "attributes": {+      "key": "value"+    },+    "data": "SGVsbG8gQ2xvdWQgUHViL1N1YiEgSGVyZSBpcyBteSBtZXNzYWdlIQ==",+    "messageId": "136969346945"+  },+  "subscription": "projects/myproject/subscriptions/mysubscription"+}+```++The file can be in any folder on your computer. From the terminal, go to the directory where `mockPubsub.json` is located, and run the following command (assuming your cloud function is hosted locally on port 8080):++```sh +curl -d "@mockPubsub.json" \+  -X POST \+  -H "Ce-Type: true" \+  -H "Ce-Specversion: true" \+  -H "Ce-Source: true" \+  -H "Ce-Id: true" \+  http://localhost:8080+```+ +### Using the Pub/Sub emulator++Another way to test your cloud function Pub/Sub endpoint is to use the [Pub/Sub Emulator](https://cloud.google.com/pubsub/docs/emulator). This allows you to use the Pub/Sub notification from another service to trigger your cloud function.++The high level approach is to:+1. Start the Pub/Sub Emulator+2. Use the Pub/Sub client library to create a subscription and set the `pushEndpoint` to `http://localhost:8080`.

8080 is the default config value for PORT.

grant

comment created time in a day

push eventGoogleCloudPlatform/functions-framework-nodejs

Grant Timmerman

commit sha b81d69d1c143bf05bf92b7fbb8a433ddcc154a80

docs: Fix and test sample code for Pub/Sub emulation.

view details

Grant Timmerman

commit sha 672baa280372a8a5c63f94114f9cc36a8be95e53

Merge branch 'comolongo-ReadMeUpdate' of github.com:GoogleCloudPlatform/functions-framework-nodejs into comolongo-ReadMeUpdate

view details

push time in a day

push eventGoogleCloudPlatform/java-docs-samples

Grant Timmerman

commit sha b47c2f9e11b901e663653249f60730448dff4098

fix: Address function_ent comments around naming and tests

view details

push time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: add functions_env_vars

 public void helloBackgroundTest() throws IOException {     new HelloBackground().helloBackground(request, response);     assertThat(responseOut.toString(), containsString("Hello John!"));       }++  @Test+  public void envTest() throws IOException {+    new Env().env(request, response);+    assertThat(responseOut.toString(), containsString(""));

OK. Thanks.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: add functions_env_vars

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_env_vars]+import java.io.IOException;+import java.io.PrintWriter;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Env {

This suggested name is too verbose and not in line with other class names. It is not common to add Example to all the other examples. Looking at the other 3 languages, I've changed the name to EnvVars.

grant

comment created time in a day

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: add functions_env_vars

+/*+ * Copyright 2019 Google LLC+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */++// [START functions_env_vars]+import java.io.IOException;+import java.io.PrintWriter;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++public class Env {+  public void env(HttpServletRequest request, HttpServletResponse response)

Done.

grant

comment created time in a day

push eventgoogle/clasp

PopGoesTheWza

commit sha 5a65e9541617db754a0b5d4e3614806e68409d7f

Small things (#690) * 2.1.0 * Low impact changes (#619) * dependencies clean-up * types for child_process' spawnSync * types for child_process' spawnSync + options fix * linting * Relative rootdir (#620) * relative rootDir support * relative rootDir support (untrackedFiles behavior changed) * relative rootDir doc changes * Cleanup before next pr (#621) * prettier + sort imports * splitLines types * unused package 'connect' * ucfirst, isOnline types * ellipsize types * redundant package 'fs-copy-file-sync' * removing extra line * // TODO * packages dependencies update * comment fix * fixes * nicer ellipsize typing * better? * Refactor `inquirer` package (#622) * regroup `inquirer` into a single file * fix typo * linting * switch to `find-up` * switch to `find-up` & `strip-bom` * dependencies update * findUp implementation fix * enum accessor fix * fs-extra & typescript dependency fix * linting * dependencies clean-up (again) * non any cast * import cleanup & TODO resolve * prettier * ch-ch-changes

view details

push time in a day

PR merged google/clasp

Small things cla: yes

Fixes no effective code

  • [ ] npm run test succeeds.
  • [x] npm run lint succeeds.
  • [ ] Appropriate changes to README are included in PR.
+20 -27

0 comment

12 changed files

PopGoesTheWza

pr closed time in a day

pull request commentGoogleCloudPlatform/functions-framework-nodejs

Release @google-cloud/functions-framework v1.3.0

Not sure what happened.

hdp617

comment created time in a day

PR opened GoogleCloudPlatform/python-docs-samples

refactor: Rename data to event

Consistently use the term event for events: b/139649933

+7 -7

0 comment

1 changed file

pr created time in 2 days

create barnchGoogleCloudPlatform/python-docs-samples

branch : grant-139649933

created branch time in 2 days

issue commentgoogleapis/gapic-generator-typescript

Empty Repo

Barely...

grant

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 requestRetry = requestRetry.defaults({   retryDelay: 1000, }); -const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;-const {BLURRED_BUCKET_NAME} = process.env;  const safeFileName = 'bicycle.jpg'; const offensiveFileName = 'zombie.jpg';-+const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;+const {BLURRED_BUCKET_NAME} = process.env;+const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME); const cwd = path.join(__dirname, '..'); -const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME);+// Successfully generated images require cleanup.+let cleanupRequired = false;  describe('functions/imagemagick tests', () => {-  const startFF = port => {-    return execPromise(-      `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,-      {timeout: 15000, shell: true, cwd}-    );-  };--  const stopFF = async ffProc => {-    try {-      return await ffProc;-    } catch (err) {-      // Timeouts always cause errors on Linux, so catch them-      if (err.name && err.name === 'ChildProcessError') {-        const {stdout, stderr} = err;-        return {stdout, stderr};+  let startFF, stopFF;++  before(() => {+    startFF = port => {+      return execPromise(+        `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,+        {timeout: 15000, shell: true, cwd}+      );+    };++    stopFF = async ffProc => {+      try {+        return await ffProc;+      } catch (err) {+        // Timeouts always cause errors on Linux, so catch them+        if (err.name && err.name === 'ChildProcessError') {+          const {stdout, stderr} = err;+          return {stdout, stderr};+        }++        throw err;       }+    };+  });++  before(async () => {+    let exists = await storage+      .bucket(BUCKET_NAME)+      .file(offensiveFileName)+      .exists();+    if (!exists[0]) {

Sounds fine.

grayside

comment created time in 2 days

push eventgooglecodelabs/slides-api

Malcolm Gin

commit sha 17703bd7aa6a73f248f9067800e0c5a5ecfa5951

Fix lineSpacing for slides Current setting at value "10" means make line spacing 10% of normal and squishes all the lines together on the body of the generated slide. value of "100.0" is normal. I think single line spacing. Looks better and is more readable on generated slides.

view details

Grant Timmerman

commit sha dbd88d458a5ec8dbc6a22e76713aa86f00796e4d

Merge pull request #5 from tsaomao/patch-1 Fix lineSpacing for slides

view details

push time in 2 days

PR merged googlecodelabs/slides-api

Fix lineSpacing for slides

Current setting at value "10" means make line spacing 10% of normal and squishes all the lines together on the body of the generated slide. value of "100.0" is normal. I think single line spacing. Looks better and is more readable on generated slides.

+1 -1

4 comments

1 changed file

tsaomao

pr closed time in 2 days

pull request commentGoogleCloudPlatform/functions-framework-nodejs

Release @google-cloud/functions-framework v1.3.0

@hdp617 What's the plan for merging this PR? Do you want to merge?

hdp617

comment created time in 2 days

delete branch GoogleCloudPlatform/functions-framework-nodejs

delete branch : fix-code-location

delete time in 2 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Huy Pham

commit sha ac28899a3d91dee8a0c11e027cee720d1fffdd2b

fix: change the default function directory to the current working directory instead of root ('/') (#77)

view details

push time in 2 days

PR merged GoogleCloudPlatform/functions-framework-nodejs

Change the default function directory to the current working directory instead of root cla: yes

This was the default before introducing the --source flag. Making root ('/') the default breaks existing projects if users don't specify --source.

+2 -2

0 comment

2 changed files

hdp617

pr closed time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 requestRetry = requestRetry.defaults({   retryDelay: 1000, }); -const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;-const {BLURRED_BUCKET_NAME} = process.env;  const safeFileName = 'bicycle.jpg'; const offensiveFileName = 'zombie.jpg';-+const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;+const {BLURRED_BUCKET_NAME} = process.env;+const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME); const cwd = path.join(__dirname, '..'); -const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME);+// Successfully generated images require cleanup.+let cleanupRequired = false;  describe('functions/imagemagick tests', () => {-  const startFF = port => {-    return execPromise(-      `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,-      {timeout: 15000, shell: true, cwd}-    );-  };--  const stopFF = async ffProc => {-    try {-      return await ffProc;-    } catch (err) {-      // Timeouts always cause errors on Linux, so catch them-      if (err.name && err.name === 'ChildProcessError') {-        const {stdout, stderr} = err;-        return {stdout, stderr};+  let startFF, stopFF;++  before(() => {+    startFF = port => {+      return execPromise(+        `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,+        {timeout: 15000, shell: true, cwd}+      );+    };++    stopFF = async ffProc => {+      try {+        return await ffProc;+      } catch (err) {+        // Timeouts always cause errors on Linux, so catch them+        if (err.name && err.name === 'ChildProcessError') {+          const {stdout, stderr} = err;+          return {stdout, stderr};+        }++        throw err;       }+    };+  });++  before(async () => {+    let exists = await storage+      .bucket(BUCKET_NAME)+      .file(offensiveFileName)+      .exists();+    if (!exists[0]) {

I'd rather see if (!exists) { by setting let exists = ... .exists()[0];

See example where we declare exists to be the first element of the data array: https://cloud.google.com/nodejs/docs/reference/storage/1.6.x/Bucket#exists

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 const blurImage = async (file, blurredBucketName) => {     await blurredBucket.upload(tempLocalPath, {destination: file.name});     console.log(`Uploaded blurred image to: ${gcsPath}`);   } catch (err) {-    console.error(`Unable to upload blurred image to ${gcsPath}:`, err);-    return Promise.reject(err);+    throw new Error(`Unable to upload blurred image to ${gcsPath}: ${err}`);

Same comment about err.message.

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 requestRetry = requestRetry.defaults({   retryDelay: 1000, }); -const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;-const {BLURRED_BUCKET_NAME} = process.env;  const safeFileName = 'bicycle.jpg'; const offensiveFileName = 'zombie.jpg';-+const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;

Nit: It would be nice if we just used FUNCTIONS_BUCKET so that we could destruct process.env in the same way:

  • FUNCTIONS_BUCKET
  • BLURRED_FUNCTIONS_BUCKET
grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 requestRetry = requestRetry.defaults({   retryDelay: 1000, }); -const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;-const {BLURRED_BUCKET_NAME} = process.env;  const safeFileName = 'bicycle.jpg'; const offensiveFileName = 'zombie.jpg';-+const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;+const {BLURRED_BUCKET_NAME} = process.env;+const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME); const cwd = path.join(__dirname, '..'); -const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME);+// Successfully generated images require cleanup.+let cleanupRequired = false;

The identifier cleanupRequired should be scoped within the describe closure rather than file-scoped. Could we put the boolean next to let startFF, stopFF;?

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 requestRetry = requestRetry.defaults({   retryDelay: 1000, }); -const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;-const {BLURRED_BUCKET_NAME} = process.env;  const safeFileName = 'bicycle.jpg'; const offensiveFileName = 'zombie.jpg';-+const BUCKET_NAME = process.env.FUNCTIONS_BUCKET;+const {BLURRED_BUCKET_NAME} = process.env;+const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME); const cwd = path.join(__dirname, '..'); -const blurredBucket = storage.bucket(BLURRED_BUCKET_NAME);+// Successfully generated images require cleanup.+let cleanupRequired = false;  describe('functions/imagemagick tests', () => {-  const startFF = port => {-    return execPromise(-      `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,-      {timeout: 15000, shell: true, cwd}-    );-  };--  const stopFF = async ffProc => {-    try {-      return await ffProc;-    } catch (err) {-      // Timeouts always cause errors on Linux, so catch them-      if (err.name && err.name === 'ChildProcessError') {-        const {stdout, stderr} = err;-        return {stdout, stderr};+  let startFF, stopFF;++  before(() => {+    startFF = port => {+      return execPromise(+        `functions-framework --target=blurOffensiveImages --signature-type=event --port=${port}`,+        {timeout: 15000, shell: true, cwd}+      );+    };++    stopFF = async ffProc => {+      try {+        return await ffProc;+      } catch (err) {+        // Timeouts always cause errors on Linux, so catch them+        if (err.name && err.name === 'ChildProcessError') {+          const {stdout, stderr} = err;+          return {stdout, stderr};+        }++        throw err;       }+    };+  });++  before(async () => {+    let exists = await storage+      .bucket(BUCKET_NAME)+      .file(offensiveFileName)+      .exists();+    if (!exists[0]) {+      throw Error(`Missing required file: gs://${BUCKET_NAME}/${offensiveFileName}`);+    } -      throw err;+    exists = await storage+      .bucket(BUCKET_NAME)+      .file(safeFileName)+      .exists();+    if (!exists[0]) {+      throw Error(`Missing required file: gs://${BUCKET_NAME}/${safeFileName}`);     }-  };+  });+ -  beforeEach(tools.stubConsole);-  afterEach(tools.restoreConsole);+//  beforeEach(tools.stubConsole);

This block needs a comment as to why these two lines are disabled rather than deleted.

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 const blurImage = async (file, blurredBucketName) => {      console.log(`Downloaded ${file.name} to ${tempLocalPath}.`);   } catch (err) {-    console.error('File download failed.', err);-    return Promise.reject(err);+    throw new Error(`File download failed: ${err}`);

Are we sure this will stringify correctly? Do we not mean to provide the ${err.message}?

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 exports.blurOffensiveImages = async event => {     const detections = result.safeSearchAnnotation || {};      if (+      // Levels are defined in https://cloud.google.com/vision/docs/reference/rpc/google.cloud.vision.v1#google.cloud.vision.v1.Likelihood

Please link REST, not RPC reference, as we are using a REST client.

grayside

comment created time in 2 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

Functions: ImageMagick tutorial: Idiomatic & Robustness Improvements

 const fs = require('fs'); const {promisify} = require('util'); const path = require('path'); const {Storage} = require('@google-cloud/storage');-const storage = new Storage();-const vision = require('@google-cloud/vision').v1p1beta1;+const vision = require('@google-cloud/vision'); +const storage = new Storage();

Not sure why separated defining and instantiating Storage. I'd undo change L24 to L26.

grayside

comment created time in 2 days

create barnchGoogleCloudPlatform/functions-framework

branch : master

created branch time in 3 days

issue commentcloudevents/sdk-javascript

TypeScript types

I can't continue since this repo doesn't seem to follow the CNCF standards of having reviews. Need to check on Slack and with others first.

micheleangioni

comment created time in 3 days

Pull request review commentgoogle/clasp

Small things

 Did you provide the correct scriptId?`, Did you provide the correct scriptId? Are you logged in to the correct account with the script?`,   SETTINGS_DNE: `-No valid ${DOT.PROJECT.PATH} project file. You may need to \`create\` or \`clone\` a project first.`,+  No valid ${DOT.PROJECT.PATH} project file. You may need to \`create\` or \`clone\` a project first.`,

This change will introduce extra whitespace. Please revert.

PopGoesTheWza

comment created time in 3 days

Pull request review commentgoogle/clasp

Small things

 const logEntryCache: { [key: string]: boolean } = {};  * Prints log entries  * @param entries {any[]} StackDriver log entries.  */-// TODO: unnecessary export-export function printLogs(-  entries: logging_v2.Schema$LogEntry[] = [],-  formatJson: boolean,-  simplified: boolean,-) {+function printLogs(entries: logging_v2.Schema$LogEntry[] = [], formatJson: boolean, simplified: boolean) {

Revert this. The previous format was readable.

PopGoesTheWza

comment created time in 3 days

Pull request review commentgoogle/clasp

Small things

 export async function getProjectFiles(rootDir: string = path.join('.', '/'), cal         // Can't rename, conflicting files         abortPush = true;         // only print error once (for .gs)-        if (path.extname(name) === '.gs') {+          if (path.extname(name) === '.gs') {

Bad formatting change

PopGoesTheWza

comment created time in 3 days

push eventgoogle/clasp

PopGoesTheWza

commit sha 732c9877af0a20cfc09aa7039af22ec4b66c5ca6

Packages cleanup (#689) * 2.1.0 * Low impact changes (#619) * dependencies clean-up * types for child_process' spawnSync * types for child_process' spawnSync + options fix * linting * Relative rootdir (#620) * relative rootDir support * relative rootDir support (untrackedFiles behavior changed) * relative rootDir doc changes * Cleanup before next pr (#621) * prettier + sort imports * splitLines types * unused package 'connect' * ucfirst, isOnline types * ellipsize types * redundant package 'fs-copy-file-sync' * removing extra line * // TODO * packages dependencies update * comment fix * fixes * nicer ellipsize typing * better? * Refactor `inquirer` package (#622) * regroup `inquirer` into a single file * fix typo * linting * switch to `find-up` * switch to `find-up` & `strip-bom` * dependencies update * findUp implementation fix * enum accessor fix * fs-extra & typescript dependency fix * linting * dependencies clean-up (again) * non any cast * convert to import * commander v3 * no padEnd polyfill with node 8 * less but newer packages * prettier

view details

push time in 3 days

PR merged google/clasp

Packages cleanup cla: yes

Fixes no specific issue

  • [ ] npm run test succeeds.
  • [x] npm run lint succeeds.
  • [ ] Appropriate changes to README are included in PR.
+182 -288

0 comment

10 changed files

PopGoesTheWza

pr closed time in 3 days

PR closed google/clasp

[WIP] 616 cla: yes

Fixes #616

  • [?] npm run test succeeds.
  • [x] npm run lint succeeds.
  • [ ] Appropriate changes to README are included in PR.
+682 -341

6 comments

21 changed files

PopGoesTheWza

pr closed time in 3 days

pull request commentgoogle/clasp

[WIP] 616

Please create smaller PRs that only do 1 thing. Like bump commander.

Let's continue conversation in an issue or new small PR.

PopGoesTheWza

comment created time in 3 days

pull request commentgoogle/clasp

[WIP] 616

Oops. Didn't mean to approve. Just the commander change looked okay.

Looking for a smaller PR.

PopGoesTheWza

comment created time in 4 days

push eventgoogle/clasp

Michael Archer

commit sha 6303ae11cc13d93e117c8bc2c1c0a834979da0ba

Issue 668: Fix logging out on windows (#684) * Fix bug where logout didn't work on windows * Remove unnecessary comment * remove trailing whitespace

view details

push time in 5 days

PR merged google/clasp

Issue 668: Fix logging out on windows cla: yes

Fixes #668

I removed the del library, as it was only used in this one location. For more info read Issue.

There was a comment about relative paths not working for the del library? That may or may not be relevant now, but I looked over the functionality and I believe that you still need both lines.

  • [ ] npm run test succeeds.
  • [ ] npm run lint succeeds.
  • [ ] Appropriate changes to README are included in PR.
+17 -154

2 comments

3 changed files

mikearche

pr closed time in 5 days

issue closedgoogle/clasp

Tests not working on Windows

Expected Behavior

SpawnSync should output the appropriate stdout when running tests.

I'm currently running into an issue where Windows Virtual Terminal Sequences are being outputted. On multiple tests I get: expected '\u001b[2K\u001b[1G' to include 'string from test here'.

I've been running the tests on git bash for windows. When I ran this on command prompt I get the same issue as well.

I'm a little stumped on this one, and spent a few days trying to fix.

May be related to #231

Actual Behavior

The tests should output the appropriate stdout on Windows.

Steps to Reproduce the Problem

  1. Run the tests on Windows 10

Specifications

  • Node version (node -v): 12.4.0
  • Version (clasp -v): 2.2.1
  • OS (Mac/Linux/Windows): Windows 10 Version 1809

closed time in 5 days

mikearche

issue commentgoogle/clasp

environment vars & cli options to specify dotfiles

Want to start simple. Also flags may conflict with existing command flags.

PopGoesTheWza

comment created time in 9 days

issue commentgoogle/clasp

Install clasp without sudo instructions

Hmm, must be my laptop or certain Node setups.

grant

comment created time in 9 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Carlos Betancourt Carrero

commit sha 37ceee75a177e7948307e846419c45d15d5753ab

New section documentation on how to perform local PubSub testing (#76) * Added new section in README.md to clarify how to do local testing of event functions * Line regarding #37 removed

view details

push time in 9 days

issue closedGoogleCloudPlatform/functions-framework-nodejs

Documentation: Unclear how to use events signature-type and test pubsub

Hi, I was able to setup and do local testing using http signature. However my goal is to do local development on a cloud function that consumes PubSub. What is the best development workflow for this?

I was thinking I may need to set signature-type to event, and somehow pass in a mock pubsub event object, how the current documentation doesn't give me many clues. Could someone point me the way?

Thanks!

closed time in 9 days

comolongo

issue commentgoogle/clasp

environment vars & cli options to specify dotfiles

A design/PR that only included the following would be fine:

  • CLASP_PROJECT
  • CLASP_IGNORE

no flags, ignore file would be in the project. Be sure to document the variables.

PopGoesTheWza

comment created time in 9 days

issue openedgoogle/clasp

Install clasp without sudo instructions

Expected Behavior

You should be able to install clasp if you don't have sudo permissions.

Actual Behavior

We don't have instructions for this.

Steps to Reproduce the Problem

npm i @google/clasp
alias clasp=./node_modules/\@google/clasp/src/index.js

created time in 9 days

PR closed GoogleCloudPlatform/functions-framework-nodejs

Added new section in README.md to clarify how to do local testing of … cla: yes

Added new section in README.md to clarify how to do local testing of event functions. Fixes the questions raised in issue #37.

+67 -0

10 comments

1 changed file

comolongo

pr closed time in 9 days

Pull request review commentGoogleCloudPlatform/java-docs-samples

feat: add functions_env_vars

 public void helloBackgroundTest() throws IOException {     new HelloBackground().helloBackground(request, response);     assertThat(responseOut.toString(), containsString("Hello John!"));       }++  @Test+  public void envTest() throws IOException {+    new Env().env(request, response);+    assertThat(responseOut.toString(), containsString(""));

I'm not sure how to set an env var in a test and tried doing so. Do you know how to set an env var?

grant

comment created time in 9 days

pull request commentGoogleCloudPlatform/java-docs-samples

feat: Add GCF Java Tips

Looks like I need to fix some linting issues:

[ERROR] src/main/java/Tips.java:[42] (indentation) Indentation: 'method def' child has incorrect indentation level 6, expected level should be 4.
[ERROR] src/main/java/Tips.java:[43] (indentation) Indentation: 'method def' child has incorrect indentation level 6, expected level should be 4.
[ERROR] src/main/java/Tips.java:[47] (indentation) Indentation: 'method def' child has incorrect indentation level 6, expected level should be 4.
[ERROR] src/main/java/Tips.java:[48] (indentation) Indentation: 'method def' child has incorrect indentation level 6, expected level should be 4.
[ERROR] src/main/java/Tips.java:[63,15] (naming) MethodName: Method name 'ScopesDemo' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9_]*$'.
[ERROR] src/main/java/Tips.java:[74,15] (naming) MethodName: Method name 'TipsRetry' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9_]*$'.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (default) on project functions-snippets: You have 6 Checkstyle violations. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
grant

comment created time in 9 days

PR opened GoogleCloudPlatform/java-docs-samples

Reviewers
feat: add functions_env_vars

Adds devrel/samples/599.

+41 -0

0 comment

2 changed files

pr created time in 9 days

PR opened GoogleCloudPlatform/java-docs-samples

Reviewers
feat: Add GCF Java Tips

Adds GCF Tips snippets: https://cloud.google.com/functions/docs/bestpractices/tips

+104 -1

0 comment

2 changed files

pr created time in 9 days

create barnchGoogleCloudPlatform/java-docs-samples

branch : grant_functions_tips

created branch time in 9 days

create barnchGoogleCloudPlatform/hackathon-toolkit

branch : grant-readme

created branch time in 9 days

delete branch GoogleCloudPlatform/java-docs-samples

delete branch : grant_functions_helloworld_background

delete time in 9 days

push eventGoogleCloudPlatform/java-docs-samples

Grant Timmerman

commit sha c2bc743d380e470b0b4f037348f28d3334fb7762

Feat: Adds functions_helloworld_background (#1549)

view details

push time in 9 days

PR merged GoogleCloudPlatform/java-docs-samples

Feat: Adds functions_helloworld_background cla: yes

Adds bg functions snippet https://devrel.corp.google.com/samples/82

+55 -0

1 comment

2 changed files

grant

pr closed time in 9 days

issue commentgoogle/clasp

Proposal for the addition of checks of the current Advanced Services

@oshliaer Looking forward to the PR!

oshliaer

comment created time in 9 days

push eventgrant/talks

Grant Timmerman

commit sha b71783632767d9d03b555513eca512e04bde1125

Update applications.md

view details

push time in 9 days

issue openedcloudevents/sdk-javascript

Don't Push Directly to Master

I don't think we're allowed to push directly to master. It seems like we must get 1 reviewer cross company.

Wanted to create a PR to convert to TS, but the library was changing too often. See https://github.com/cloudevents/sdk-javascript/issues/9 CC @n3wscott

created time in 9 days

delete branch gsuitedevs/java-samples

delete branch : grant-travis-jdk

delete time in 10 days

PR opened gsuitedevs/java-samples

fix: Use JDK 11 (8 is broken)

Travis is failing because JDK 8 is broken.

Use a newer version. https://travis-ci.community/t/install-jdk-sh-failing-for-openjdk9-and-10/3998

+1 -2

0 comment

1 changed file

pr created time in 10 days

create barnchgsuitedevs/java-samples

branch : grant-travis-jdk

created branch time in 10 days

push eventgoogle/clasp

MattiasMartens

commit sha 94f0a1c62d2f18237b363e1c5b3774a617487f82

Login status (#685) * Status functionality * Add all-important auth scopes * deploymentIdPrompt returns an entire configuration not just an ID so rename the 'name' of the prompt and type it properly to avoid confusion This is in service of fixing an errant linter error * fix method being referenced but not called, add try-catch so API request failure doesn't get printed to console * remove errant console.log

view details

push time in 10 days

PR merged google/clasp

Login status cla: yes

Fulfils #676. clasp login --status which fetches user's email.

  • [ ] npm run test succeeds. I wasn't able to get tests working locally in general. Most of them fail. I did set the environment variables but no luck. Would appreciate if someone else could confirm that tests pass.

  • [X] npm run lint succeeds.

  • [X] Appropriate changes to README are included in PR.

+112 -59

2 comments

7 changed files

MattiasMartens

pr closed time in 10 days

Pull request review commentgoogle/clasp

Login status

 export function getAPIFileType(filePath: string): string { /**  * Checks if the network is available. Gracefully exits if not.  */-export async function checkIfOnline() {+export async function safeIsOnline() {

Would rather combine safeIsOnline and checkIfOnline. Have a param with checkIfOnline like checkIfOnline(canThrowError = false).

MattiasMartens

comment created time in 10 days

push eventgoogle/clasp

Grant Timmerman

commit sha 6136ddbec92d236c0c74b653e30ee36e151715dd

fix: Fixes lint errors

view details

push time in 10 days

delete branch grant/community-connectors

delete branch : grant_readme_travis

delete time in 10 days

issue commentgoogle/clasp

Feature Request: Add command for checking login-status.

PRs welcome. May get to this eventually.

diminishedprime

comment created time in 10 days

push eventgsuitedevs/java-samples

Grant Timmerman

commit sha 34846383a327169acfc5c33248751c5c039abe5e

fix: Remove Drive URL from Slides snippets

view details

push time in 10 days

pull request commentgoogle/clasp

Issue 668: Fix logging out on windows

Thanks!

Here's the error from Travis:

ERROR: /home/travis/build/google/clasp/src/commands/openCmd.ts:73:71 - Type declaration of 'any' loses type-safety. Consider replacing it with a more precise type.
ERROR: /home/travis/build/google/clasp/src/commands/openCmd.ts:76:39 - Missing trailing comma
mikearche

comment created time in 10 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

Documentation: Unclear how to use events signature-type and test pubsub

Thanks a lot @grant Is there a location where the bug report can be done.

There's a feedback button on the page for creating the bug report.

comolongo

comment created time in 10 days

issue commentgoogle/clasp

Clasp can't seem to see bound script projects

Have someone Issue a feature request? I did not found any. If so, them link here.

Nobody has filed a FR yet.

ShowMeBillyJo

comment created time in 10 days

issue commentgoogle/clasp

Push failed when using variable of type "let" in script.

Apps Script doesn't support let. So this is an error from the API.

If you want to use let, you must use TypeScript and have your file end with .ts.

Oshio09

comment created time in 11 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

Documentation: Unclear how to use events signature-type and test pubsub

I am able to call the function using the instruction given, however instead of the variable being available in the pubSubEvent variable, its available on the context variable. Any idea what needs to be done

I don't know at the moment.

Node functions for Pub/Sub triggers should look like this: https://cloud.google.com/functions/docs/calling/pubsub#sample_code

If we think there is a bug with following that code, we should file a bug with expected/actual behavior that might be in this framework or elsewhere.

comolongo

comment created time in 12 days

Pull request review commentGoogleCloudPlatform/nodejs-docs-samples

functions/imagemagick: fix "callback must be a function" error

 const blurImage = async (file, blurredBucketName) => {   }    // Delete the temporary file.-  return promisify(fs.unlink(tempLocalPath));+  const unlink = promisify(fs.unlink);+  return unlink(tempLocalPath);

Got it. Disregard the suggestion then.

grayside

comment created time in 12 days

push eventGoogleCloudPlatform/functions-framework-nodejs

Jan Kremeň

commit sha 2c1245b9dc9e0f4a3fdda39b5d45d9515b208f2e

Adding null check in catch block (#71) Catch null ex.stack

view details

push time in 12 days

PR merged GoogleCloudPlatform/functions-framework-nodejs

Adding null check in catch block cla: yes

During our cloud function deployment we encountered error:

Deployment failure:
Function failed on loading user code. Error message: /srv/functions/node_modules/@google-cloud/functions-framework/build/src/invoker.js:89
        if (ex.stack.includes('Cannot find module')) {
                     ^
TypeError: Cannot read property 'includes' of undefined
    at Object.getUserFunction (/srv/functions/node_modules/@google-cloud/functions-framework/build/src/invoker.js:89:22)
    at Object.<anonymous> (/srv/functions/node_modules/@google-cloud/functions-framework/build/src/index.js:67:33)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

The ex.stack can be null, so I added tiny null check.

+1 -1

3 comments

1 changed file

captain-refactor

pr closed time in 12 days

issue commentGoogleCloudPlatform/functions-framework-nodejs

Documentation: Unclear how to use events signature-type and test pubsub

@Sabyasachi2k Does this guide help?

https://github.com/GoogleCloudPlatform/functions-framework-nodejs/pull/40/files?short_path=04c6e90#diff-04c6e90faac2675aa89e2176d2eec7d8

We're working on an event guide. I agree it would be useful.

comolongo

comment created time in 12 days

delete branch gsuitedevs/browser-samples

delete branch : grant-slides_create_image

delete time in 12 days

more