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

cosalib/gcp.py: check the name for an upload against GCP's regex. #1052

Merged
merged 1 commit into from Jan 14, 2020

Conversation

@darkmuggle
Copy link
Contributor

darkmuggle commented Jan 14, 2020

Use GCP's regex to enforce the naming of GCP uploads.

@darkmuggle

This comment has been minimized.

Copy link
Contributor Author

darkmuggle commented Jan 14, 2020

I really want to include Mocking tests for this sort of thing.

@ashcrow

This comment has been minimized.

Copy link
Member

ashcrow commented Jan 14, 2020

src/cosalib/gcp.py:12:1: E302 expected 2 blank lines, found 1
@darkmuggle darkmuggle force-pushed the darkmuggle:pr/fix-gcp-naming branch from 0afe498 to 3fd2b66 Jan 14, 2020
@jlebon
jlebon approved these changes Jan 14, 2020
Copy link
Member

jlebon left a comment

Optional nit, LGTM otherwise!

import urllib
from cosalib.cmdlib import run_verbose
from tenacity import (
retry,
stop_after_attempt
)

GCP_NAMING_RE = r"[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}"

This comment has been minimized.

Copy link
@jlebon

jlebon Jan 14, 2020

Member

Optional: link to GCP doc with regex would be neat

This comment has been minimized.

Copy link
@darkmuggle

darkmuggle Jan 14, 2020

Author Contributor

That came from the API :) But link added.

@darkmuggle darkmuggle force-pushed the darkmuggle:pr/fix-gcp-naming branch from 3fd2b66 to 4c8985f Jan 14, 2020
@darkmuggle darkmuggle force-pushed the darkmuggle:pr/fix-gcp-naming branch from 4c8985f to 0b43305 Jan 14, 2020
@darkmuggle darkmuggle merged commit b8be801 into coreos:master Jan 14, 2020
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/jenkins/pr-merge This commit is being built
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@darkmuggle darkmuggle deleted the darkmuggle:pr/fix-gcp-naming branch Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.