Uh oh!
There was an error while loading. Please reload this page.
Storage: ProjectID Regex - #4543
Conversation
chemelnucfin
commented
Dec 7, 2017
Hmm. it is locally 100%. Investigating |
9becd22 to
98c9695CompareStrange. Let's see if #4544 fixes it. |
| name = match.group('name') | ||
| project = match.group('project') | ||
| if project and len(project) > 30: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| class TestProjectID(unittest.TestCase): | ||
| from google.cloud.storage import notification |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| PROJECT = notification._PROJECT_PATTERN | ||
| def test_min_length_fail(self): | ||
| import re |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| def test_leading_digit_fail(self): | ||
| import re | ||
| project = re.match(self.PROJECT, '1''a' * 5) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
a5a865b to
563bcc2Compare| _TOPIC_REF_FMT = '//pubsub.googleapis.com/projects/{}/topics/{}' | ||
| _PROJECT_PATTERN = r'(?P<project>[a-z][a-z0-9-]{4,28}[a-z0-9])' | ||
| _PROJECT_PATTERN = r'(?P<project>\A[a-z][a-z0-9-]{4,28}[a-z0-9]\Z)' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
21ac69c to
1ae80fdCompare| _TOPIC_NAME_PATTERN = r'(?P<name>[A-Za-z](\w|[-_.~+%])+)' | ||
| _TOPIC_REF_PATTERN = _TOPIC_REF_FMT.format( | ||
| _PROJECT_PATTERN, _TOPIC_NAME_PATTERN) | ||
| _PROJECT_PATTERN.replace(r'^', '').replace(r'$', ''), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
left a comment
There was a problem hiding this comment.
@chemelnucfin Let's make sure to get this merged tomorrow?
| _TOPIC_NAME_PATTERN = r'(?P<name>[A-Za-z](\w|[-_.~+%])+)' | ||
| _TOPIC_REF_PATTERN = _TOPIC_REF_FMT.format( | ||
| _PROJECT_PATTERN, _TOPIC_NAME_PATTERN) | ||
| _PROJECT_PATTERN.replace(r'\A', '').replace(r'\Z', ''), |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| import mock | ||
| class TestProjectID(unittest.TestCase): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| pattern = notification._PROJECT_PATTERN | ||
| project = re.match(pattern, 'z0123456789\nmalicious', re.M) | ||
| self.assertIsNone(project) | ||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
40335cf to
89e5c89Comparegooglebot
commented
Dec 12, 2017
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were 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 here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
dhermes
commented
Dec 12, 2017
@chemelnucfin I did a small re-factor to push this over the finish line. Some things worth noting:
|
chemelnucfin
commented
Dec 12, 2017
2, 3. ok. Sometimes I'm hesitant to refactor for fear of breaking things. So is it ok to merge? |
dhermes
commented
Dec 12, 2017
@chemelnucfin Yes go ahead and merge (make sure to squash). |
Made the regex check in `BucketNotification.from_api_repr` into a standalone helper. This way all the tests can be in "one place".
89e5c89 to
6fc8dedCompare* Storage: ProjectID Regex from https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects#Project.FIELDS.project_id * Re-factor as part of review process. Made the regex check in `BucketNotification.from_api_repr` into a standalone helper. This way all the tests can be in "one place".
ProjectID description from https://cloud.google.com/resource-manager/reference/rest/v1beta1/projects#Project.FIELDS.project_id
#4447