-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add support for S3 bucket as source for anod #669
base: master
Are you sure you want to change the base?
Conversation
Part of it/org/software-supply-chain/product-security/issues#24
Note that there are some errors
|
@@ -20,6 +21,8 @@ | |||
from collections.abc import Callable | |||
from e3.mypy import assert_never | |||
|
|||
SupportedVCS = Literal["git"] | Literal["svn"] | Literal["external"] | Literal["s3"] |
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.
You must use typing.Union
. |
is not supported for type aliasing.
@@ -84,6 +87,8 @@ def update( | |||
update = self.update_svn | |||
elif vcs == "external": | |||
update = self.update_external | |||
elif vcs == "s3": | |||
update = self.update_s3 | |||
else: | |||
assert_never() |
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 function takes one argument as parameter.
"""Update working dir using a S3 bucket as source. | ||
|
||
:param url: s3 url to a s3 directory. s3://[profile@]bucket/suffix | ||
:param revision: ignored |
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 create an ignored parameter?
# url validation | ||
m = re.match("s3://([a-zA-Z0-9_-]+@)?(.+)$", url) | ||
if m is None: | ||
raise e3.error.E3Error("invalid s3 url: {url}") |
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.
missing f"..."
|
||
# Extract profile from the url and perform basic | ||
# url validation | ||
m = re.match("s3://([a-zA-Z0-9_-]+@)?(.+)$", url) |
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.
Maybe should we compile this regex?
Part of it/org/software-supply-chain/product-security/issues#24