Add missing GCF samples (other than tutorials)#1614
Conversation
|
@andrewsg something broke in Nox.py, and it no longer supports linting a specific directory. (You have to lint all of Can you (or another Python person) submit a PR to address this? |
|
Edit: addressed the Nox issues in #1630. Force pushed to this branch to include the new changes. |
Change-Id: I2362e4ee8031fd3ea6880ffcec5eb253615df5ba
Change-Id: Ieb2b5b3421bd6821bc6d5626b7986c23e9d82350
Change-Id: I0fb311114bf8c3554e2f052ca00f1dd9eef1cf69
Change-Id: I5ed6d6dc3792e28b12162c47c7e6f5c974a7477f
Change-Id: I1a17e1c72bea6e7a8d18b9ed5910db09bedb753d
Change-Id: I3d99531c68b5ca3272cb6208777f3ab9bde8f9bd
Change-Id: I06c2a5cb46fd2cb497af7ba9e02e43a4e97de972
Change-Id: Ie8682514d99aa6f82786a76719535efd58a5c1bf
Change-Id: Ief7e96a43948af12de32627b20031c95953ade09
Change-Id: Idc9854ba256271081078c15f7e62d3fd6bbec449
Change-Id: Ib1b6f8eb47511fe9b19ed6d773b4f9c6ef0dc8ed
andrewsg
left a comment
There was a problem hiding this comment.
Why are all of the requirements files extended?
|
IIRC believe this step was required to get the builds passing previously. That being said, I'll revert it and see if the build still passes now that the Nox issues have been fixed. |
|
It looks like that removed requirements.txt entirely for some samples such as slack and tips. |
Change-Id: I8fe4f70869deeb3aac0f9c6016f5c5e45a172731
|
Removed that commit in favor of shrinking the existing |
Change-Id: Iba2165bd2af99306feb47b7e29640ebf7d8f3e95
|
Build is passing - PTAL? |
Change-Id: I585f2a6a31cf5e23a54eb02fb366a8685601ea23
| @@ -0,0 +1 @@ | |||
| pytest==3.6.0 | |||
functions/log/main.py
Outdated
| # [END functions_log_retrieve] | ||
|
|
||
| # [START functions_logs_retrieve] | ||
| from google.cloud import logging as cloud_logging |
There was a problem hiding this comment.
Why "import as" here instead of just "import google.cloud.logging"?
| # [START functions_log_retrieve] | ||
| cloud_client = cloud_logging.Client() | ||
| log_name = 'cloudfunctions.googleapis.com%2Fcloud-functions' | ||
| cloud_logger = cloud_client.logger(log_name.format(os.getenv('GCP_PROJECT'))) |
There was a problem hiding this comment.
Do we mention in the readme or anywhere else that this env variable has to be set for it to work locally?
functions/tips/main_test.py
Outdated
| from unittest.mock import MagicMock, Mock, patch | ||
|
|
||
| import flask | ||
| from mock import MagicMock, Mock, patch |
There was a problem hiding this comment.
Why did this need to be changed?
functions/tips/main_test.py
Outdated
| import flask | ||
| from mock import MagicMock, Mock, patch | ||
| import pytest | ||
|
|
There was a problem hiding this comment.
Was this change required by the linter?
functions/tips/requirements.txt
Outdated
| google-cloud-error-reporting==0.30.0 | ||
| python-dateutil==2.7.3 No newline at end of file | ||
| google-cloud-pubsub==0.35.4 | ||
| mock==2.0.0 |
There was a problem hiding this comment.
This is not needed as it's included in testing requirements.
Change-Id: Ibb5a518f60d06c7637cc39ab54e81a234ea188ec
| # [END functions_http_signed_url] | ||
|
|
||
| # [START functions_http_form_data] | ||
| from werkzeug.utils import secure_filename |
There was a problem hiding this comment.
I believe this will work as-is, even without werkzeug in requirements.txt, but have you tested it in production just to make sure (since clearing requirements.txt)?
There was a problem hiding this comment.
Made some (unrelated) bugfixes and confirmed it works.
Change-Id: If71dba3d86954e8e0bf7168638c5c73eb40fe599
|
@dpebot merge when green |
|
Okay! I'll merge when all statuses are green and all reviewers approve. |
No description provided.