Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs Updates #70

Merged
merged 8 commits into from Sep 9, 2019
Merged

Docs Updates #70

merged 8 commits into from Sep 9, 2019

Conversation

grant
Copy link
Contributor

@grant grant commented Aug 1, 2019

  • Unignores the docs
  • Adds events and docker docs

@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@grant
Copy link
Contributor Author

grant commented Aug 5, 2019

@googlebot I consent.

@grant grant requested a review from ace-n August 7, 2019 05:43
Copy link

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

More coffee edit: see requested changes below.

docs/events.md Outdated Show resolved Hide resolved
docs/events.md Show resolved Hide resolved
docs/events.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@grant grant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated and tested the guide.
Thanks for the comments. PTAL.

docs/events.md Show resolved Hide resolved
docs/events.md Outdated Show resolved Hide resolved
docs/events.md Outdated Show resolved Hide resolved
Copy link

@ace-n ace-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM other than a few nits.

@@ -0,0 +1,77 @@
## 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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: link to quickstart?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove? (Maybe italicize signature type instead?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bolded sig type instead as it is important.


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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Requests (add s)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


### 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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capitalization nit: cloud function -> Cloud Function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: would locally hosted function be better than Cloud Function here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor Author

@grant grant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed all comments.
Thanks for the review.

@@ -0,0 +1,77 @@
## 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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


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:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bolded sig type instead as it is important.


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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


### 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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@grant grant added cla: yes and removed cla: no labels Sep 9, 2019
@googlebot
Copy link

A Googler has manually verified that the CLAs look good.

(Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.)

ℹ️ Googlers: Go here for more info.

@grant
Copy link
Contributor Author

grant commented Sep 9, 2019

Merging as I have signed the CLA and I am squashing.

@grant grant merged commit f1a50e4 into master Sep 9, 2019
@grant grant deleted the comolongo-ReadMeUpdate branch September 9, 2019 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants