-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: refactor postgres sample to use slim app #1099
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
feat: refactor postgres sample to use slim app #1099
Conversation
| @@ -0,0 +1,150 @@ | |||
| <?php | |||
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.
Oh yeah, got some tests!
Is there a plan to add integration/end-to-end tests in the future? Mocking the database for a database usage sample only gets you so far.
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.
@bshaffer what's the standard course here?
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 Cloud SQL DPEs have an OKR around e2e testing for every sample next quarter.
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.
please don't forget this one!!
kurtisvg
left a 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.
I know very little about PHP, so I'll defer to @shubha-rajan and @grayside to provide a more throughout review. This is OK with me as long as it's consistent with the MySQL and SQLServer samples going forward.
cloud_sql/postgres/pdo/README.md
Outdated
|
|
||
| ```bash | ||
| $ gcloud app deploy | ||
| $ gcloud beta app 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.
Does this really need to be beta?
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.
I got that from here and given that the app.yaml has a beta_settings section in it, assumed that beta was required in the command.
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.
Looks like this is still a beta setting for flex, but not standard: https://cloud.google.com/sql/docs/mysql/connect-app-engine#flexible
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.
FYI I tested this using gcloud app deploy (no beta flag) for flex and it worked as expected with no discernible differences.
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.
I removed beta_settings and the app failed. But it seems that using beta does not make a difference.
|
@jdpedrie it looks like there's a merge conflict in the README. do you mind fixing that and updating the PR? |
shubha-rajan
left a 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.
LGTM since most of this looks similar to the other two samples. PTAL at my comment about the timeout region tag.
cloud_sql/postgres/pdo/README.md
Outdated
|
|
||
| ```bash | ||
| $ gcloud app deploy | ||
| $ gcloud beta app 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.
Looks like this is still a beta setting for flex, but not standard: https://cloud.google.com/sql/docs/mysql/connect-app-engine#flexible
|
@GoogleCloudPlatform/php-admins ping for codeowner review |
|
@jdpedrie just a few more minor changes before we can merge this. PTAL at the review comments |
…les into cloudsql/postgres
|
@bshaffer @shubha-rajan done |
|
@bshaffer ping for review |
bshaffer
left a 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.
Seems like a lot of dependencies for a microframework, but if that's what is required then it's fine by me.
|
@bshaffer good to merge? |
cloud_sql/postgres/pdo/app.flex.yaml
Outdated
| # serve a custom PHP front controller (e.g. "serve backend/index.php") or to | ||
| # run a long-running PHP script as a worker process (e.g. "php worker.php"). | ||
| # | ||
| # entrypoint: serve index.php |
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.
I believe this comment is only valid for app engine standard, and not for app engine 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.
fixed
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.
I tested this and found some very strange behavior:
entrypoint: serve index.php=>entrypoint1: serve index.php- throws error "unexpected attribute entrypoint2"entrypoint: serve index.php=>entrypoint: serve index1.php- does not throw error, application works as expected, even thoughindex1.phpdoesn't exist.entrypoint: serve1 index.php=>entrypoint: serve index1.php- does not throw error, application works as expected, even thoughserve1doesn't exist.
My theory is that this attribute has been deprecated and while is "valid" is no longer being used in App Engine Flex.
Adding @tmatsuo for 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.
Just realized I've been using gcloud app deploy instead of gcloud beta app deploy. I'll test everything again with the beta command.
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.
OK, done. The beta command had no effect.
No description provided.