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

Cloud Task + GAE + Functions Tutorial #1488

Merged
merged 28 commits into from
Oct 1, 2019
Merged

Cloud Task + GAE + Functions Tutorial #1488

merged 28 commits into from
Oct 1, 2019

Conversation

averikitsch
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 18, 2019
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 18, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 18, 2019
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 18, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 18, 2019
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 19, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 19, 2019
Copy link
Collaborator

@grayside grayside left a comment

Choose a reason for hiding this comment

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

This review covers everything up to but not including the function. As discussed in comments and in chat, I think there's some security/abuse issues that need sorting, and a number of other nits worth considering.

cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/app/index.js Outdated Show resolved Hide resolved
cloud-tasks/app/index.js Outdated Show resolved Hide resolved
cloud-tasks/app/package.json Outdated Show resolved Hide resolved
cloud-tasks/app/package.json Outdated Show resolved Hide resolved
cloud-tasks/app/test/create_task.test.js Outdated Show resolved Hide resolved
cloud-tasks/app/test/create_task.test.js Outdated Show resolved Hide resolved
cloud-tasks/app/test/create_task.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@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.

Thanks for the PR. I've added some comments and requested changes.

Can we have more of a PR description and background to this change? Any internal docs we can link for more background?

For example:

  • Why do we need to use GAE and GCF together?
  • How does this compare to other samples?
  • Why was SendGrid chosen?


Before you can deploy the sample, you will need to do the following:

1. Enable the Cloud Function and Cloud Tasks APIs in the
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Please use direct links
  • Please ensure the product names are correct (Cloud Functions)

Suggestion

1. [Enable](https://console.cloud.google.com/flows/enableapi?apiid=cloudfunctions.googleapis.com,cloudtasks.googleapis.com) the Cloud Functions and Cloud Tasks APIs
  1. Enable the Cloud Functions and Cloud Tasks APIs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I say, for example, "The Cloud Function does ..." or should I just say "The function does ..."?

cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/README.md Outdated Show resolved Hide resolved
cloud-tasks/function/index.js Show resolved Hide resolved
cloud-tasks/function/index.js Outdated Show resolved Hide resolved
cloud-tasks/function/index.js Outdated Show resolved Hide resolved
cloud-tasks/function/index.js Outdated Show resolved Hide resolved
cloud-tasks/function/test/index.test.js Outdated Show resolved Hide resolved
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 20, 2019
@averikitsch averikitsch added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 25, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 25, 2019
@averikitsch
Copy link
Contributor Author

Thank you @grant and @grayside for the thorough reviews. Can you look over the updates?

cloud-tasks/app/static/index.css Outdated Show resolved Hide resolved
cloud-tasks/function/index.js Outdated Show resolved Hide resolved
cloud-tasks/function/package.json Outdated Show resolved Hide resolved
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/node:10-user"
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why does cloud-tasks need a customized common.cfg? So far most products don't need one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Every folder in .kokoro has a common.cfg file, but you are right it is a duplication of the parents.

Copy link
Collaborator

@grayside grayside left a comment

Choose a reason for hiding this comment

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

Thank you for taking my security feedback into account, things are looking good. I gave it another careful review and while I have a number of new comments, none of them seem like merge blockers: I'm comfortable with you merging without them or taking them as useful polish feedback.

cloud-tasks/app/app.yaml Show resolved Hide resolved
cloud-tasks/app/createTask.js Show resolved Hide resolved
return response.name;
} catch (error) {
// Construct error for Stackdriver Error Reporting
console.error(Error(error.message));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Non-Blocking.

Did you end up confirming that console.error(error) does not work?

It would be worth comparing the output from the two commands and seeing what the difference is, it might be fixable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did run some more isolated tests and console.error(error) did not show up in Error Reporting.

cloud-tasks/app/index.js Show resolved Hide resolved
cloud-tasks/app/index.js Outdated Show resolved Hide resolved
cloud-tasks/function/index.js Show resolved Hide resolved
cloud-tasks/function/test/index.test.js Outdated Show resolved Hide resolved
cloud-tasks/function/test/index.test.js Outdated Show resolved Hide resolved
@fhinkel
Copy link
Contributor

fhinkel commented Oct 1, 2019

You can fix the lint errors with npm run lint -- --fix in the parent directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants