-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Merge samples for Flex and Std #590
Merge samples for Flex and Std #590
Conversation
…s and solve conflicts
appengine/analytics/README.md
Outdated
|
||
With `npm`: | ||
gcloud app deploy app.standard.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit - these indentations are different.
@@ -10,16 +10,14 @@ | |||
"url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git" | |||
}, | |||
"engines": { | |||
"node": ">=4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmdobry @lukesneeringer Which versions of Node do we support? AFAIK, this is too restrictive (at least for Flex).
@michaelawyu if you make any changes as a result of this comment, please apply those changes to any other package.json
files that have this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 4+, until April 30 when Node 4 reaches end of life and we can switch our samples to support Node 6+
"start": "node app.js", | ||
"lint": "repo-tools lint", | ||
"pretest": "npm run lint", | ||
"system-test": "repo-tools test app", | ||
"test": "npm run system-test", | ||
"e2e-test": "repo-tools test deploy" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed? (Perhaps because npm run deploy
no longer works?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's removed because npm run deploy
no longer works.
"private": true, | ||
"main": "server.js", | ||
"scripts": { | ||
"lint": "samples lint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In README.md
, you specify start
and deploy
scripts. Make sure to add those (and their respective commands) here, or remove them from your README.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
test.beforeEach(utils.stubConsole); | ||
test.afterEach.always(utils.restoreConsole); | ||
|
||
test.cb.serial(`should send greetings`, (t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jmdobry what are your thoughts on using repo-tools
instead of this test file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can still do the same tests while deleting code, let's do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for building-an-app/build/ are now done by repo-tools
.
const app = express(); | ||
app.enable('trust proxy'); | ||
|
||
const METADATA_NETWORK_INTERFACE_URL = 'http://metadata/computeMetadata/v1/' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: combine this into one string (and ignore line length limits, or split onto multiple lines using backticks)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
return request(METADATA_NETWORK_INTERFACE_URL, options) | ||
.then((response) => response.body) | ||
.catch((err) => { | ||
if (err || err.statusCode !== 200) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean &&
instead of ||
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed :)
appengine/redis/README.md
Outdated
app. | ||
|
||
You can also read the [node_redis documentation][3]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo (missing an i): addit-i-onally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed :)
appengine/sendgrid/app.standard.yaml
Outdated
|
||
# [START env_variables] | ||
env_variables: | ||
SENDGRID_API_KEY: <your-sendgrid-api-key> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto to "do not commit this file" comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
@@ -0,0 +1,40 @@ | |||
# Node.js Google Cloud Storage sample for Google App Engine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be split into separate standard
and flexible
samples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is split as App Engine Node.js Std does not support the resumable upload feature in Cloud Storage client library. Should we use the sample w/ resumable upload disabled for both std and flex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frankyn WDYT?
Codecov Report
@@ Coverage Diff @@
## master #590 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 1 1
Lines 3 3
=====================================
Hits 3 3 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once you switch the appropriate tests to using @google-cloud/repo-tools
. (Ping @jmdobry or myself if you want us to give you an intro on that library.)
@@ -1,15 +1,17 @@ | |||
# Cloud SQL for MySQL Node.js sample on App Engine flexible environment | |||
# Cloud SQL for PostgresSQL Node.js sample on App Engine flexible environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: IIRC, it's PostgreSQL
(extra S).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me and my fat fingers :( It's been fixed
@michaelawyu I see places where you use |
Hi @lesv ! It is intended actually: samples that share the same code between Flex and Std are merged together and have two .YAML files; samples that use different code for different environments are kept separate and have one .YAML file in each folder; getting-started samples are always kept separate so that beginners can use |
SGTM |
General comment: When referring to an "environment" of App Engine, it should be lowercase, either:
(with the exceptions of either a title or the start of a sentence, in which case you should capitalize the first letter). |
appengine/sendgrid/README.md
Outdated
@@ -16,7 +18,8 @@ Before you can run or deploy the sample, you will need to do the following: | |||
1. [Create a SendGrid Account](http://sendgrid.com/partner/google). As of | |||
September 2015, Google users start with 25,000 free emails per month. | |||
1. Configure your SendGrid settings in the environment variables section in | |||
`app.yaml`. | |||
`app.standard.yaml` (if you are deploying to App Engine Standard Environment) or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The inline code comment in the /sendgrid/app.js file refers to "app.yaml" which could be confusing now that we have these two environment specific files, which are named differently.
To assist with learning this concept of "uniquely-named, service-specific app.yaml files", perhaps add to the "app.js" file:
(for example, app.standard.yaml or app.flexible.yaml)
-> therefore you instead have:
"....variables are set by app.yaml (for example, app.standard.yaml or app.flexible.yaml) when running on ......"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
LGTM - @michaelawyu feel free to merge once @RichieEscarez (and maybe @lesv) also approve(s). |
I just had a nit. |
So LGTM from me. |
* chore(main): release 4.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 4.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
No description provided.